From 6d794428b572db282577b2b9628acbea5db7b843 Mon Sep 17 00:00:00 2001 From: 王家文 Date: Mon, 15 Apr 2024 17:30:07 +0800 Subject: [PATCH] feat✨:星星商店兑换 --- service/cardholder/config.go | 22 +++++++++++----------- service/cardholder/handle.go | 9 +++------ service/constd/games.go | 2 +- 3 files changed, 15 insertions(+), 18 deletions(-) diff --git a/service/cardholder/config.go b/service/cardholder/config.go index a8df256..d84528a 100644 --- a/service/cardholder/config.go +++ b/service/cardholder/config.go @@ -75,14 +75,14 @@ type AlbumConfig struct { // CardConfig 卡牌表 type CardConfig struct { - Id int `json:"id"` // ID - Name int `json:"name"` // 卡牌图片 - Icon string `json:"icon"` // 卡牌id - Desc int `json:"desc"` // 卡牌描述 - SetId int `json:"album_setid"` // 卡组id - Star int `json:"star"` // 星级 - IsGold int `json:"is_gold"` // 是否是金卡 - IsSend int `json:"is_send"` // 卡片是否可赠送 + Id int `json:"id"` // ID + Name int `json:"name"` // 卡牌名字 + Icon int `json:"icon"` // 卡牌图标 + Desc int `json:"desc"` // 卡牌描述 + SetId int `json:"album_setid"` // 卡组id + Star int `json:"star"` // 星级 + IsGold int `json:"is_gold"` // 是否是金卡 + IsSend int `json:"is_send"` // 卡片是否可赠送 } // OpenCardholderConfig 卡包开卡规则表 @@ -115,7 +115,7 @@ type CardSequenceConfig struct { // StarShopConfig 星星商店配置 type StarShopConfig struct { - Id int `json:"id"` // ID - NeedStarNumber int `json:"need_star_number"` // 需求星星数 - CardBagIds string `json:"card_bag_ids"` // 可换取的卡包ID {卡包类型,卡包ID,卡包数量} + Id int `json:"id"` // ID + NeedStarNumber int `json:"need_star_number"` // 需求星星数 + CardBagIds []int `json:"card_bag_ids"` // 可换取的卡包ID {卡包类型,卡包ID,卡包数量} } diff --git a/service/cardholder/handle.go b/service/cardholder/handle.go index 47d1d73..97c0ca6 100644 --- a/service/cardholder/handle.go +++ b/service/cardholder/handle.go @@ -7,7 +7,6 @@ import ( "apigame/util/util-lx/lxtime" "apigame/util/uttype" "strconv" - "strings" ) // HandleGetConfig 活动配置 @@ -172,15 +171,13 @@ func HandleShopExchange(req *models.ReqStarShopExchange) (code string, rsp model } // 判断配置 - cardBagIdsStr := strings.Split(confStarShop.CardBagIds, ",") - cardBagIds := uttype.ListStringToListInt(cardBagIdsStr) - if len(cardBagIds) < 3 { + if len(confStarShop.CardBagIds) < 3 { lxalilog.Errors("StarShopConfig.CardBagIds error", confStarShop.Id) code = constd.RECODE_MERGE_CONFIG_ERROR return } - cardholderId := cardBagIds[1] - cardholderCount := cardBagIds[2] + cardholderId := confStarShop.CardBagIds[1] + cardholderCount := confStarShop.CardBagIds[2] if cardholderCount < 1 { lxalilog.Errors("StarShopConfig.CardBagIds error", confStarShop.Id) code = constd.RECODE_MERGE_CONFIG_ERROR diff --git a/service/constd/games.go b/service/constd/games.go index 3cb3612..6b178ce 100644 --- a/service/constd/games.go +++ b/service/constd/games.go @@ -1,5 +1,5 @@ package constd var ( - GameListCardHolder = []string{"10128"} + GameListCardHolder = []string{"10149"} ) -- libgit2 0.21.0