Files
bl/modules/player/model/item.go
昔念 40057b698d
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中多余的空行
```
2026-02-04 00:25:41 +08:00

53 lines
1.0 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package model
import (
"blazing/cool"
)
const TableNamePlayerBagItem = "player_item"
// PlayerBagItem mapped from table <player_bag_item>
type Item struct {
Base
PlayerID uint64 `gorm:"not null;index:idx_player_bag_item_by_player_id;comment:'所属玩家ID'" json:"player_id"`
// 物品Id
ItemId uint32 `json:"item_id"`
BindPet uint32 `json:"bind_pet"` //绑定的精灵
// 物品数量,
ItemCnt int32 `json:"item_cnt"`
}
type SingleItemInfo struct {
// 物品Id
ItemId uint32 `json:"itemId"`
// 物品数量,
ItemCnt uint32 `json:"itemCnt"`
// 固定值360000
LeftTime uint32 `json:"leftTime"`
// 固定值0
ItemLevel uint32 `json:"itemLevel"`
}
// TableName PlayerBagItem's table name
func (*Item) TableName() string {
return TableNamePlayerBagItem
}
// GroupName PlayerBagItem's table group
func (*Item) GroupName() string {
return "default"
}
// NewPlayerBagItem create a new PlayerBagItem
func NewPlayerBag() *Item {
return &Item{
Base: *NewBase(),
}
}
// init 创建表
func init() {
cool.CreateTable(&Item{})
}