feat(item): 实现新的金豆商品购买功能

- 移除原有的GoldProductMap配置映射,改用新的商店服务查询商品信息
- 添加购买类型区分(豆子购买和金豆购买)支持
- 集成新的商店服务接口,通过productId查询商品配置
- 完善购买逻辑,支持不同类型的货币扣减和余额更新
- 更新数据结构定义,
This commit is contained in:
2026-01-10 03:14:23 +08:00
parent 4cd34f5009
commit 1a20ca75f4
4 changed files with 70 additions and 38 deletions

View File

@@ -52,8 +52,8 @@ var (
ShopMap map[int]ShopItem
SkillTypeMap map[int]SkillType
RelationsMap map[int]Relation
GoldProductMap = make(map[int]GoldProductItem, 0)
EVOLVMAP map[int]Evolve
//GoldProductMap = make(map[int]GoldProductItem, 0)
EVOLVMAP map[int]Evolve
)
func Initfile() {
@@ -127,12 +127,12 @@ func Initfile() {
}
GoldProductMap = utils.ToMap(getXml[GoldProductConfig](path+"30001.xml").Items,
func(m GoldProductItem) int {
return gconv.Int(m.ProductID)
// GoldProductMap = utils.ToMap(getXml[GoldProductConfig](path+"30001.xml").Items,
// func(m GoldProductItem) int {
// return gconv.Int(m.ProductID)
},
)
// },
// )
}