feat(user-talk): 优化聊天功能中的物品奖励逻辑

重构 Talk 方法中物品奖励的获取方式,使用新的配置服务以支持多物品 ID 奖励机制。
移除了对 github.com/gogf/gf/v2/util/grand 包的依赖,改为通过服务获取实际物品数量。

同时更新了相关模型定义:
- 修改 MineralCollectionConfig 中 ItemID 为数组形式以支持多个物品配置
- 调整 ItemGift 模型字段
This commit is contained in:
2025-12-22 19:04:16 +08:00
parent 8505bfd4e3
commit cf7736a3e7
10 changed files with 86 additions and 49 deletions

View File

@@ -13,8 +13,12 @@ const (
type PetReward struct {
*cool.Model // 嵌入通用Model包含ID/创建时间/更新时间等通用字段保持与BossConfig一致
PetBaseConfig
IsEgg uint32 `gorm:"not null;default:0;comment:'是否蛋'" json:"is_egg"` //奖励是否为扭蛋奖励
MonID int32 `gorm:"not null;comment:'BOSS对应的精灵ID'" json:"mon_id"`
Nature uint32 `gorm:"not null;default:0;comment:'BOSS属性-性格'" json:"nature"`
Effect []uint32 `gorm:"type:jsonb;not null;default:'[]';comment:'BOSS特性'" json:"effect"`
Lv int32 `gorm:"not null;comment:'BOSS等级LvHpMatchUser非0时此配置无效'" json:"lv"`
Color string `gorm:"comment:'BOSS颜色'" json:"color"`
IsEgg uint32 `gorm:"not null;default:0;comment:'是否蛋'" json:"is_egg"` //奖励是否为扭蛋奖励
}
// PetRewardEX 精灵奖励扩展配置模型(用于前端/业务层的复杂数据解析,继承基础模型)