Commit 6d794428b572db282577b2b9628acbea5db7b843

Authored by 王家文
1 parent d57ff0e0
Exists in master and in 1 other branch dev-wjw

feat✨:星星商店兑换

service/cardholder/config.go
... ... @@ -75,14 +75,14 @@ type AlbumConfig struct {
75 75  
76 76 // CardConfig 卡牌表
77 77 type CardConfig struct {
78   - Id int `json:"id"` // ID
79   - Name int `json:"name"` // 卡牌图片
80   - Icon string `json:"icon"` // 卡牌id
81   - Desc int `json:"desc"` // 卡牌描述
82   - SetId int `json:"album_setid"` // 卡组id
83   - Star int `json:"star"` // 星级
84   - IsGold int `json:"is_gold"` // 是否是金卡
85   - IsSend int `json:"is_send"` // 卡片是否可赠送
  78 + Id int `json:"id"` // ID
  79 + Name int `json:"name"` // 卡牌名字
  80 + Icon int `json:"icon"` // 卡牌图标
  81 + Desc int `json:"desc"` // 卡牌描述
  82 + SetId int `json:"album_setid"` // 卡组id
  83 + Star int `json:"star"` // 星级
  84 + IsGold int `json:"is_gold"` // 是否是金卡
  85 + IsSend int `json:"is_send"` // 卡片是否可赠送
86 86 }
87 87  
88 88 // OpenCardholderConfig 卡包开卡规则表
... ... @@ -115,7 +115,7 @@ type CardSequenceConfig struct {
115 115  
116 116 // StarShopConfig 星星商店配置
117 117 type StarShopConfig struct {
118   - Id int `json:"id"` // ID
119   - NeedStarNumber int `json:"need_star_number"` // 需求星星数
120   - CardBagIds string `json:"card_bag_ids"` // 可换取的卡包ID {卡包类型,卡包ID,卡包数量}
  118 + Id int `json:"id"` // ID
  119 + NeedStarNumber int `json:"need_star_number"` // 需求星星数
  120 + CardBagIds []int `json:"card_bag_ids"` // 可换取的卡包ID {卡包类型,卡包ID,卡包数量}
121 121 }
... ...
service/cardholder/handle.go
... ... @@ -7,7 +7,6 @@ import (
7 7 "apigame/util/util-lx/lxtime"
8 8 "apigame/util/uttype"
9 9 "strconv"
10   - "strings"
11 10 )
12 11  
13 12 // HandleGetConfig 活动配置
... ... @@ -172,15 +171,13 @@ func HandleShopExchange(req *models.ReqStarShopExchange) (code string, rsp model
172 171 }
173 172  
174 173 // 判断配置
175   - cardBagIdsStr := strings.Split(confStarShop.CardBagIds, ",")
176   - cardBagIds := uttype.ListStringToListInt(cardBagIdsStr)
177   - if len(cardBagIds) < 3 {
  174 + if len(confStarShop.CardBagIds) < 3 {
178 175 lxalilog.Errors("StarShopConfig.CardBagIds error", confStarShop.Id)
179 176 code = constd.RECODE_MERGE_CONFIG_ERROR
180 177 return
181 178 }
182   - cardholderId := cardBagIds[1]
183   - cardholderCount := cardBagIds[2]
  179 + cardholderId := confStarShop.CardBagIds[1]
  180 + cardholderCount := confStarShop.CardBagIds[2]
184 181 if cardholderCount < 1 {
185 182 lxalilog.Errors("StarShopConfig.CardBagIds error", confStarShop.Id)
186 183 code = constd.RECODE_MERGE_CONFIG_ERROR
... ...
service/constd/games.go
1 1 package constd
2 2  
3 3 var (
4   - GameListCardHolder = []string{"10128"}
  4 + GameListCardHolder = []string{"10149"}
5 5 )
... ...