95 lines
3.1 KiB
Go
95 lines
3.1 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"`
|
|
}
|
|
|
|
// ---------- 后台管理 ----------
|
|
|
|
type AdminChildItem struct {
|
|
Id int64 `json:"id"`
|
|
ParentId int64 `json:"parent_id"`
|
|
Nickname string `json:"nickname"`
|
|
Avatar string `json:"avatar"`
|
|
AgeGroup string `json:"age_group"`
|
|
Points int `json:"points"`
|
|
DailyLimitMinutes int `json:"daily_limit_minutes"`
|
|
Status int `json:"status"`
|
|
CreatedAt string `json:"created_at"`
|
|
PerfectCount int `json:"perfect_count"`
|
|
Level int `json:"level"`
|
|
LevelTitle string `json:"level_title"`
|
|
}
|
|
|
|
type AdminChildListReq struct {
|
|
g.Meta `path:"/child/list" method:"get" summary:"孩子列表"`
|
|
ParentId int64 `json:"parent_id"` // 可选,按家长筛
|
|
}
|
|
|
|
type AdminChildListRes struct {
|
|
List []*AdminChildItem `json:"list"`
|
|
}
|
|
|
|
type AdminProgressItem struct {
|
|
LevelId int64 `json:"level_id"`
|
|
LevelTitle string `json:"level_title"`
|
|
StrategyId int64 `json:"strategy_id"`
|
|
StrategyName string `json:"strategy_name"`
|
|
Stars int `json:"stars"`
|
|
Perfect bool `json:"perfect"`
|
|
ContentVersion int `json:"content_version"`
|
|
CompletedAt string `json:"completed_at"`
|
|
}
|
|
|
|
type AdminChildDetailReq struct {
|
|
g.Meta `path:"/child/detail" method:"get" summary:"孩子详情"`
|
|
ChildId int64 `v:"required|min:1" json:"child_id"`
|
|
}
|
|
|
|
type AdminChildDetailRes struct {
|
|
Child *AdminChildItem `json:"child"`
|
|
Passed int `json:"passed"` // 通关关数
|
|
Perfect int `json:"perfect"` // 完美关数
|
|
Stars int `json:"stars"` // 星星总数
|
|
Progress []*AdminProgressItem `json:"progress"`
|
|
}
|