48 lines
1.3 KiB
Go
48 lines
1.3 KiB
Go
package dto
|
|
|
|
import "github.com/gogf/gf/v2/frame/g"
|
|
|
|
type RegisterReq struct {
|
|
g.Meta `path:"/parent/register" method:"post" summary:"家长注册"`
|
|
Phone string `v:"required|length:11,11|regex:^1[3-9][0-9]{9}$" json:"phone"`
|
|
Password string `v:"required|length:6,32" json:"password"`
|
|
Nickname string `v:"required|length:1,32" json:"nickname"`
|
|
}
|
|
|
|
type RegisterRes struct {
|
|
Token string `json:"token"`
|
|
ParentId int64 `json:"parent_id"`
|
|
}
|
|
|
|
type LoginReq struct {
|
|
g.Meta `path:"/parent/login" method:"post" summary:"家长登录"`
|
|
Phone string `v:"required|length:11,11|regex:^1[3-9][0-9]{9}$" json:"phone"`
|
|
Password string `v:"required|length:6,32" json:"password"`
|
|
}
|
|
|
|
type LoginRes struct {
|
|
Token string `json:"token"`
|
|
ParentId int64 `json:"parent_id"`
|
|
}
|
|
|
|
// ---------- 后台管理 ----------
|
|
|
|
type AdminParentItem struct {
|
|
Id int64 `json:"id"`
|
|
Phone string `json:"phone"`
|
|
Openid string `json:"openid"`
|
|
Nickname string `json:"nickname"`
|
|
Avatar string `json:"avatar"`
|
|
Status int `json:"status"`
|
|
CreatedAt string `json:"created_at"`
|
|
ChildCount int `json:"child_count"`
|
|
}
|
|
|
|
type AdminParentListReq struct {
|
|
g.Meta `path:"/parent/list" method:"get" summary:"家长列表(含孩子数)"`
|
|
}
|
|
|
|
type AdminParentListRes struct {
|
|
List []*AdminParentItem `json:"list"`
|
|
}
|