feat(user-talk): 优化聊天功能中的物品奖励逻辑
重构 Talk 方法中物品奖励的获取方式,使用新的配置服务以支持多物品 ID 奖励机制。 移除了对 github.com/gogf/gf/v2/util/grand 包的依赖,改为通过服务获取实际物品数量。 同时更新了相关模型定义: - 修改 MineralCollectionConfig 中 ItemID 为数组形式以支持多个物品配置 - 调整 ItemGift 模型字段
This commit is contained in:
@@ -21,9 +21,9 @@ type BaseTowerConfig struct {
|
||||
ElfRewardIds []uint32 `gorm:"not null;type:json;default:'[]';comment:'绑定奖励精灵ID数组,关联config_pet_boss表主键'" json:"elf_reward_ids" description:"绑定奖励精灵数组"`
|
||||
|
||||
// 通用辅助字段(与勇者之塔完全一致,无额外添加)
|
||||
IsEnabled uint32 `gorm:"not null;default:1;comment:'是否启用该层配置(0-禁用 1-启用)'" json:"is_enabled" description:"是否启用"`
|
||||
Remark string `gorm:"size:512;default:'';comment:'试炼之塔层备注'" json:"remark" description:"备注信息"`
|
||||
ItemGift []ItemGift `orm:"with:item_id=id"`
|
||||
IsEnabled uint32 `gorm:"not null;default:1;comment:'是否启用该层配置(0-禁用 1-启用)'" json:"is_enabled" description:"是否启用"`
|
||||
Remark string `gorm:"size:512;default:'';comment:'试炼之塔层备注'" json:"remark" description:"备注信息"`
|
||||
// ItemGift []ItemGift `orm:"with:item_id=id"`
|
||||
}
|
||||
|
||||
func NewBaseTowerConfig() BaseTowerConfig {
|
||||
|
||||
Reference in New Issue
Block a user