Files
36Wisdom/biz/model/dto/level.go
T
2026-08-14 16:11:10 +08:00

194 lines
6.3 KiB
Go

package dto
import "github.com/gogf/gf/v2/frame/g"
type LevelDetailReq struct {
g.Meta `path:"/level/detail" method:"get" summary:"关卡详情"`
LevelId int64 `v:"required" json:"level_id"`
ChildId int64 `v:"required" json:"child_id"`
}
type ElementVO struct {
Id int64 `json:"id"`
EType int `json:"e_type"`
Name string `json:"name"`
NamePinyin string `json:"name_pinyin"`
Image string `json:"image"`
Audio string `json:"audio"`
Description string `json:"description"`
}
type OptionVO struct {
OptionId int64 `json:"option_id"`
Text string `json:"text"`
TextPinyin string `json:"text_pinyin"`
FeedbackPros string `json:"feedback_pros"`
FeedbackCons string `json:"feedback_cons"`
Audio string `json:"audio"`
Prop *ElementVO `json:"prop"`
}
type NodeVO struct {
NodeId int64 `json:"node_id"`
Title string `json:"title"`
Content string `json:"content"`
ContentPinyin string `json:"content_pinyin"`
Image string `json:"image"`
Audio string `json:"audio"`
Character *ElementVO `json:"character"`
InteractionType int `json:"interaction_type"`
Config string `json:"config"`
Script string `json:"script"`
NodeType int `json:"node_type"`
ResultType int `json:"result_type"`
Options []OptionVO `json:"options"`
}
type LevelDetailRes struct {
LevelId int64 `json:"level_id"`
Title string `json:"title"`
Scene *ElementVO `json:"scene"`
SceneContent string `json:"scene_content"`
SceneContentPinyin string `json:"scene_content_pinyin"`
SceneImage string `json:"scene_image"`
SceneAudio string `json:"scene_audio"`
Entry NodeVO `json:"entry"`
TotalFinals int `json:"total_finals"`
Perfect bool `json:"perfect"`
Stars int `json:"stars"`
}
type ChooseReq struct {
g.Meta `path:"/level/choose" method:"post" summary:"分支闯关选择"`
ChildId int64 `v:"required" json:"child_id"`
LevelId int64 `v:"required" json:"level_id"`
NodeId int64 `v:"required" json:"node_id"`
OptionId int64 `v:"required" json:"option_id"`
}
type ChooseRes struct {
Next *NodeVO `json:"next"`
Final *FinalSettle `json:"final"`
}
type FinalSettle struct {
ResultType int `json:"result_type"`
Stars int `json:"stars"`
ScoreDelta int `json:"score_delta"`
Cleared bool `json:"cleared"`
Perfect bool `json:"perfect"`
UnlockNext bool `json:"unlock_next"`
CollectionUnlocked bool `json:"collection_unlocked"`
NewLevel int `json:"new_level"`
BalanceAfter int `json:"balance_after"`
FinalNode *NodeVO `json:"final_node"`
}
// ---------- 后台管理 ----------
type AdminLevelItem struct {
Id int64 `json:"id"`
StrategyId int64 `json:"strategy_id"`
Title string `json:"title"`
SceneId int64 `json:"scene_id"`
SceneName string `json:"scene_name"`
SceneContent string `json:"scene_content"`
SceneImage string `json:"scene_image"`
SceneAudio string `json:"scene_audio"`
AgeGroup string `json:"age_group"`
ContentVersion int `json:"content_version"`
SortOrder int `json:"sort_order"`
Status int `json:"status"`
NodeCount int `json:"node_count"`
}
type AdminLevelListReq struct {
g.Meta `path:"/level/list" method:"get" summary:"关卡列表(按计策)"`
StrategyId int64 `v:"required|min:1" json:"strategy_id"`
}
type AdminLevelListRes struct {
List []*AdminLevelItem `json:"list"`
}
type AdminLevelCreateReq struct {
g.Meta `path:"/level/create" method:"post" summary:"新增关卡"`
StrategyId int64 `v:"required|min:1" json:"strategy_id"`
Title string `v:"required|length:1,64" json:"title"`
SceneId int64 `json:"scene_id"`
SceneContent string `json:"scene_content"`
SceneImage string `json:"scene_image"`
SceneAudio string `json:"scene_audio"`
AgeGroup string `v:"required|in:4-6,6-8" json:"age_group"`
SortOrder int `json:"sort_order"`
}
type AdminLevelCreateRes struct {
Id int64 `json:"id"`
}
type AdminLevelUpdateReq struct {
g.Meta `path:"/level/update" method:"post" summary:"编辑关卡"`
Id int64 `v:"required|min:1" json:"id"`
StrategyId int64 `v:"required|min:1" json:"strategy_id"`
Title string `v:"required|length:1,64" json:"title"`
SceneId int64 `json:"scene_id"`
SceneContent string `json:"scene_content"`
SceneImage string `json:"scene_image"`
SceneAudio string `json:"scene_audio"`
AgeGroup string `v:"required|in:4-6,6-8" json:"age_group"`
SortOrder int `json:"sort_order"`
}
type AdminLevelUpdateRes struct{}
type AdminLevelDisableReq struct {
g.Meta `path:"/level/disable" method:"post" summary:"下架关卡"`
Id int64 `v:"required|min:1" json:"id"`
}
type AdminLevelDisableRes struct{}
type AdminLevelEnableReq struct {
g.Meta `path:"/level/enable" method:"post" summary:"上架关卡"`
Id int64 `v:"required|min:1" json:"id"`
}
type AdminLevelEnableRes struct{}
// ---------- 关卡统计 ----------
type AdminStatsNode struct {
NodeId int64 `json:"node_id"`
Content string `json:"content"`
NodeType int `json:"node_type"`
ReachCount int `json:"reach_count"`
None int `json:"none"`
Fail int `json:"fail"`
Good int `json:"good"`
Best int `json:"best"`
}
type AdminStatsOption struct {
OptionId int64 `json:"option_id"`
NodeId int64 `json:"node_id"`
Text string `json:"text"`
ChooseCount int `json:"choose_count"`
Fail int `json:"fail"`
Good int `json:"good"`
Best int `json:"best"`
}
type AdminStatsLevelReq struct {
g.Meta `path:"/stats/level" method:"get" summary:"关卡统计"`
LevelId int64 `v:"required|min:1" json:"level_id"`
}
type AdminStatsLevelRes struct {
Players int `json:"players"`
PerfectCount int `json:"perfect_count"`
PerfectRate float64 `json:"perfect_rate"`
Nodes []*AdminStatsNode `json:"nodes"`
Options []*AdminStatsOption `json:"options"`
}