```
refactor(item): 优化物品添加逻辑并移除冗余代码 - 修改 ItemAdd 方法签名,从可变参数改为两个独立参数 itemId 和 itemCnt - 移除了对 model.ItemInfo 的依赖,简化调用方式 - 更新所有调用 ItemAdd 的地方以适配新接口 - 删除未使用的 imports 和注释掉的旧配置加载逻辑 - 修复购买物品时金币扣除与物品发放的一致性问题 - 增加玩家操作消耗塞尔豆的扣费逻辑(如宠物治疗、技能设置等) 此变更提升了代码简洁性和一致性,并增强了业务逻辑的准确性。 ```
This commit is contained in:
@@ -57,16 +57,16 @@ func (*Talk) GroupName() string {
|
||||
// }
|
||||
// }
|
||||
|
||||
// ResourceConfig 资源配置信息(对应XML中的配置)
|
||||
type ResourceConfig struct {
|
||||
Type uint32 `json:"type"` // 资源类型ID
|
||||
MapID uint32 `json:"map_id"` // 所在地图ID
|
||||
Name string `json:"name"` // 资源名称
|
||||
CollectType string `json:"collect_type"` // 采集类型
|
||||
MaxDailyCnt uint32 `json:"max_daily_cnt"` // 每日最大采集次数
|
||||
Unit string `json:"unit"` // 单位
|
||||
Dir uint32 `json:"dir"` // 方向
|
||||
}
|
||||
// // ResourceConfig 资源配置信息(对应XML中的配置)
|
||||
// type ResourceConfig struct {
|
||||
// Type uint32 `json:"type"` // 资源类型ID
|
||||
// MapID uint32 `json:"map_id"` // 所在地图ID
|
||||
// Name string `json:"name"` // 资源名称
|
||||
// CollectType string `json:"collect_type"` // 采集类型
|
||||
// MaxDailyCnt uint32 `json:"max_daily_cnt"` // 每日最大采集次数
|
||||
// Unit string `json:"unit"` // 单位
|
||||
// Dir uint32 `json:"dir"` // 方向
|
||||
// }
|
||||
|
||||
// 初始化创建表
|
||||
func init() {
|
||||
|
||||
Reference in New Issue
Block a user