feat(model): 新增金豆消费、CDK配置、炫彩皮肤及双塔模型,优化物品奖励和BOSS配置

This commit is contained in:
1
2025-12-21 18:13:54 +00:00
parent 4cffc3d510
commit edee754a22
12 changed files with 579 additions and 26 deletions

View File

@@ -17,19 +17,10 @@ type ItemGift struct {
ItemID uint32 `gorm:"not null;default:0;comment:'物品ID关联物品配置表主键'" json:"item_id"`
Remark string `gorm:"size:512;default:'';comment:'物品奖励备注说明(如使用场景、特殊说明等)'" json:"remark"`
IsEnabled uint32 `gorm:"not null;default:1;comment:'是否启用0-禁用 1-启用)'" json:"is_enabled"`
IsGacha uint32 `gorm:"not null;default:0;comment:'是否为扭蛋物品0-否 1-是)'" json:"is_gacha"`
IsEgg uint32 `gorm:"not null;default:0;comment:'是否蛋'" json:"is_egg"` //奖励是否为扭蛋奖励
ItemCount uint32 `gorm:"not null;default:1;comment:'物品奖励数量'" json:"item_count"`
}
// ItemGiftEX 物品奖励扩展配置模型(用于前端/业务层复杂数据展示,非数据库存储字段)
type ItemGiftEX struct {
ItemGift // 嵌入基础物品奖励模型
ItemName string `json:"item_name"` // 物品名称(前端展示用,关联物品表查询得到)
ItemIcon string `json:"item_icon"` // 物品图标路径(前端展示用,非数据库存储字段)
StatusDesc string `json:"status_desc"` // 启用状态描述(如"启用"/"禁用",前端展示用)
GachaDesc string `json:"gacha_desc"` // 扭蛋标识描述(如"扭蛋专属"/"普通物品",前端展示用)
}
// TableName 指定ItemGift对应的数据库表名遵循现有代码规范
func (*ItemGift) TableName() string {
return TableNameItemGift
@@ -46,7 +37,7 @@ func NewItemGift() *ItemGift {
Model: cool.NewModel(), // 初始化通用Model字段ID/创建时间/更新时间等)
// 字段默认值与gorm tag中default配置保持一致
IsEnabled: 1,
IsGacha: 0,
ItemCount: 1,
}
}