```
Some checks failed
ci/woodpecker/push/my-first-workflow Pipeline failed

fix(game): 修复扭蛋游戏物品数量检查类型错误

- 将egg game play中的物品数量比较从uint32改为int32类型
- 修改Item模型中ItemCnt字段类型为int32
- 更新CheakItem方法返回类型为int32
- 移除item service中多余的空行
```
This commit is contained in:
昔念
2026-02-04 00:25:41 +08:00
parent 76ee66f616
commit 40057b698d
3 changed files with 4 additions and 4 deletions

View File

@@ -21,7 +21,7 @@ func (h Controller) EggGamePlay(data1 *egg.C2S_EGG_GAME_PLAY, c *player.Player)
data1.EggNum = 10 data1.EggNum = 10
} }
r := c.Service.Item.CheakItem(400501) r := c.Service.Item.CheakItem(400501)
if r < uint32(data1.EggNum) { if r < int32(data1.EggNum) {
return nil, errorcode.ErrorCode(errorcode.ErrorCodes.ErrGachaTicketsInsufficient) return nil, errorcode.ErrorCode(errorcode.ErrorCodes.ErrGachaTicketsInsufficient)
} }

View File

@@ -15,7 +15,7 @@ type Item struct {
BindPet uint32 `json:"bind_pet"` //绑定的精灵 BindPet uint32 `json:"bind_pet"` //绑定的精灵
// 物品数量, // 物品数量,
ItemCnt uint32 `json:"item_cnt"` ItemCnt int32 `json:"item_cnt"`
} }
type SingleItemInfo struct { type SingleItemInfo struct {

View File

@@ -45,7 +45,7 @@ func (s *ItemService) UPDATE(id uint32, count int) {
} }
func (s *ItemService) CheakItem(id uint32) uint32 { func (s *ItemService) CheakItem(id uint32) int32 {
var ttt model.Item var ttt model.Item
m := s.TestModel(s.Model) m := s.TestModel(s.Model)