feat(item): 实现新的金豆商品购买功能 - 移除原有的GoldProductMap配置映射,改用新的商店服务查询商品信息 - 添加购买类型区分(豆子购买和金豆购买)支持 - 集成新的商店服务接口,通过productId查询商品配置 - 完善购买逻辑,支持不同类型的货币扣减和余额更新 - 更新数据结构定义,
30 lines
499 B
Go
30 lines
499 B
Go
package service
|
|
|
|
import (
|
|
"blazing/cool"
|
|
"blazing/modules/config/model"
|
|
)
|
|
|
|
type ShopService struct {
|
|
*cool.Service
|
|
}
|
|
|
|
func NewShopService() *ShopService {
|
|
return &ShopService{
|
|
&cool.Service{
|
|
Model: model.NewShopConfig(),
|
|
PageQueryOp: &cool.QueryOp{
|
|
KeyWordField: []string{"desc", "product_name"},
|
|
},
|
|
},
|
|
}
|
|
}
|
|
func (s *ShopService) Get(product_id uint32) *model.ShopConfig {
|
|
m := dbm(s.Model).Where("product_id", product_id)
|
|
var tt *model.ShopConfig
|
|
m.Scan(&tt)
|
|
|
|
return tt
|
|
|
|
}
|