feat: 常量集中(表名/状态/默认参数)
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
package consts
|
||||
|
||||
// 积分档位(技术设计.md 4.4)
|
||||
const (
|
||||
PointsBest = 30 // 首次到达最佳终局
|
||||
PointsGood = 10 // 首次到达良好终局
|
||||
PointsFail = -10 // 未通关时到达失败终局
|
||||
PointsPerfect = 20 // 达成完美(走完全部终局)
|
||||
PointsReview = 10 // 章末温故完成
|
||||
PointsSummary = 5 // 智慧总结答对
|
||||
PointsSignIn = 5 // 每日签到
|
||||
PointsTask = 20 // 生活任务确认
|
||||
)
|
||||
|
||||
// 默认参数
|
||||
const (
|
||||
FailNoDeductAfter = 2 // 同一关连续失败 N 次后不再扣分
|
||||
ReviewLevelCount = 3 // 章末温故抽取计谋数(2-3,取 3 且不超过已学)
|
||||
AuthExpireSeconds = 7 * 24 * 3600 // 家长 token 有效期(7 天)
|
||||
)
|
||||
@@ -0,0 +1,82 @@
|
||||
package consts
|
||||
|
||||
// 内容通用状态
|
||||
const (
|
||||
StatusEnabled = 1
|
||||
StatusDisabled = 0
|
||||
)
|
||||
|
||||
// 节点类型
|
||||
const (
|
||||
NodeDecision = 1
|
||||
NodeFinal = 2
|
||||
)
|
||||
|
||||
// 终局评级
|
||||
const (
|
||||
ResultNone = 0 // 非终局
|
||||
ResultFail = 1 // 失败终局
|
||||
ResultGood = 2 // 良好终局
|
||||
ResultBest = 3 // 最佳终局
|
||||
)
|
||||
|
||||
// 互动形态(scene_node.interaction_type)
|
||||
const (
|
||||
InteractionOption = 1 // 选项选择
|
||||
InteractionProp = 2 // 道具选择
|
||||
InteractionOrder = 3 // 步骤排序
|
||||
InteractionAction = 4 // 动作过关(config 配子模式:jump/climb/dodge/run)
|
||||
InteractionDrag = 5 // 拖拽放置
|
||||
InteractionCatch = 6 // 接取收集
|
||||
InteractionFind = 7 // 找线索
|
||||
InteractionConnect = 8 // 连线配对
|
||||
)
|
||||
|
||||
// 徽章条件类型(badge.cond_type)
|
||||
const (
|
||||
BadgeCollect = 1 // 集卡数
|
||||
BadgeSignIn = 2 // 连续签到
|
||||
BadgeClear = 3 // 通关数
|
||||
BadgePoints = 4 // 积分
|
||||
BadgePerfect = 5 // 完美关卡数
|
||||
BadgeReview = 6 // 复习完成数
|
||||
)
|
||||
|
||||
// 积分流水原因(point_log.reason_type)
|
||||
const (
|
||||
ReasonLevel = 1 // 闯关结算
|
||||
ReasonSignIn = 2 // 每日签到
|
||||
ReasonRedeem = 3 // 兑换扣减
|
||||
ReasonAdmin = 4 // 管理调整
|
||||
ReasonReview = 5 // 章末温故
|
||||
ReasonSummary = 6 // 智慧总结
|
||||
ReasonTask = 7 // 生活任务
|
||||
)
|
||||
|
||||
// 兑换状态(redemption.status)
|
||||
const (
|
||||
RedeemPending = 1 // 待领取(虚拟)
|
||||
RedeemWaiting = 2 // 待发货(实物)
|
||||
RedeemShipped = 3 // 已发货
|
||||
RedeemCanceled = 4 // 已取消
|
||||
RedeemReceived = 5 // 已领取(家长确认)
|
||||
)
|
||||
|
||||
// 生活任务状态(life_task_log.status)
|
||||
const (
|
||||
TaskIssued = 1 // 已下发
|
||||
TaskConfirming = 2 // 待家长确认
|
||||
TaskConfirmed = 3 // 已确认
|
||||
)
|
||||
|
||||
// 年龄段档位(child.age_group / level.age_group)
|
||||
const (
|
||||
AgeGroup4_6 = "4-6"
|
||||
AgeGroup6_8 = "6-8"
|
||||
)
|
||||
|
||||
// 角色(token 鉴权 role)
|
||||
const (
|
||||
RoleParent = "parent"
|
||||
RoleAdmin = "admin"
|
||||
)
|
||||
@@ -0,0 +1,24 @@
|
||||
package consts
|
||||
|
||||
// 全部业务表名,与 biz/model/entity 一一对应。
|
||||
const (
|
||||
TableParent = "parent"
|
||||
TableChild = "child"
|
||||
TableStrategy = "strategy"
|
||||
TableLevel = "level"
|
||||
TableSceneNode = "scene_node"
|
||||
TableNodeOption = "node_option"
|
||||
TableElement = "element"
|
||||
TableUserProgress = "user_progress"
|
||||
TableChapterReview = "chapter_review"
|
||||
TableUserRouteLog = "user_route_log"
|
||||
TableUserCollection = "user_collection"
|
||||
TableBadge = "badge"
|
||||
TableUserBadge = "user_badge"
|
||||
TablePointLog = "point_log"
|
||||
TablePrize = "prize"
|
||||
TableRedemption = "redemption"
|
||||
TableAdminUser = "admin_user"
|
||||
TableLifeTask = "life_task"
|
||||
TableLifeTaskLog = "life_task_log"
|
||||
)
|
||||
Reference in New Issue
Block a user