feat(talk): 优化采集逻辑并移除冗余字典服务调用

- 移除了 talk.go 中对 dict 模块的依赖,直接使用配置中的 ItemID
- 修改了 talkconfig.go 中的 ItemID 类型为 uint32,提升一致性
- 调整 talk.go 和 talkconfig.go 的缓存获取方式,增强性能
- 更新了 pet_fusion_material_service.go 中字典服务调用方法
- 修复 talk 模型中 TalkID 字段的唯一索引问题
- 日志记录由 Error 改为 Info,避免误导性
This commit is contained in:
2025-12-09 00:09:51 +08:00
parent 36ca75aa03
commit cc5a2aaf46
9 changed files with 36 additions and 53 deletions

View File

@@ -6,9 +6,6 @@ import (
"blazing/logic/service/player"
"blazing/modules/blazing/service"
dict "blazing/modules/dict/service"
"github.com/gogf/gf/v2/util/gconv"
"github.com/gogf/gf/v2/util/grand"
)
@@ -39,11 +36,11 @@ func (h Controller) TalkCate(data *item.TalkCateInboundInfo, c *player.Player) (
for _, v := range config {
count := grand.N(int(v.ItemMinCount), int(v.ItemMaxCount))
r := dict.DictInfoServiceS.DataID("fusion")
trueitemid := gconv.Uint32(r[gconv.Uint32(v.ItemID)].Remark)
ret := c.ItemAdd(trueitemid, uint32(count))
// r := dict.DictInfoServiceS.DataID("fusion")
// trueitemid := gconv.Uint32(r[gconv.Uint32(v.ItemID)].Remark)
ret := c.ItemAdd(uint32(v.ItemID), uint32(count))
if ret {
result.OutList = append(result.OutList, item.CateInfo{ID: trueitemid, Count: uint32(count)})
result.OutList = append(result.OutList, item.CateInfo{ID: v.ItemID, Count: uint32(count)})
}
}