注册/登录签发 JWT(bcrypt 校验),孩子档案增改查带归属校验, 列表汇总完美关卡数并派生成长等级。 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
45 lines
1.4 KiB
Go
45 lines
1.4 KiB
Go
package dto
|
|
|
|
import "github.com/gogf/gf/v2/frame/g"
|
|
|
|
type ChildCreateReq struct {
|
|
g.Meta `path:"/parent/child/create" method:"post" summary:"创建孩子档案"`
|
|
Nickname string `v:"required|length:1,32" json:"nickname"`
|
|
AgeGroup string `v:"required|in:4-6,6-8" json:"age_group"`
|
|
}
|
|
|
|
type ChildCreateRes struct {
|
|
ChildId int64 `json:"child_id"`
|
|
}
|
|
|
|
type ChildUpdateReq struct {
|
|
g.Meta `path:"/parent/child/update" method:"post" summary:"更新孩子资料"`
|
|
ChildId int64 `v:"required" json:"child_id"`
|
|
Nickname string `v:"length:1,32" json:"nickname"`
|
|
Avatar string `v:"max-length:255" json:"avatar"`
|
|
AgeGroup string `v:"in:4-6,6-8" json:"age_group"`
|
|
DailyLimitMinutes int `v:"min:0|max:600" json:"daily_limit_minutes"`
|
|
}
|
|
|
|
type ChildUpdateRes struct{}
|
|
|
|
type ChildListReq struct {
|
|
g.Meta `path:"/parent/child/list" method:"get" summary:"孩子档案列表"`
|
|
}
|
|
|
|
type ChildListItem struct {
|
|
ChildId int64 `json:"child_id"`
|
|
Nickname string `json:"nickname"`
|
|
Avatar string `json:"avatar"`
|
|
AgeGroup string `json:"age_group"`
|
|
Points int `json:"points"`
|
|
Level int `json:"level"`
|
|
LevelTitle string `json:"level_title"`
|
|
PerfectCount int `json:"perfect_count"`
|
|
DailyLimitMinutes int `json:"daily_limit_minutes"`
|
|
}
|
|
|
|
type ChildListRes struct {
|
|
List []ChildListItem `json:"list"`
|
|
}
|