2025-06-28 16:16:28 +08:00
|
|
|
|
package model
|
|
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
|
"blazing/cool"
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
const TableNamePlayerBagItem = "player_bag_item"
|
|
|
|
|
|
|
|
|
|
|
|
// PlayerBagItem mapped from table <player_bag_item>
|
2025-08-31 00:27:07 +08:00
|
|
|
|
type Item struct {
|
2025-06-28 16:16:28 +08:00
|
|
|
|
*cool.Model
|
|
|
|
|
|
PlayerID uint64 `gorm:"not null;index:idx_player_bag_item_by_player_id;comment:'所属玩家ID'" json:"player_id"`
|
2025-09-23 15:01:52 +00:00
|
|
|
|
Data string ` gorm:"type:text;not null;comment:'全部数据'" json:"data"`
|
2025-08-30 21:59:52 +08:00
|
|
|
|
}
|
2025-09-23 15:01:52 +00:00
|
|
|
|
type ItemEX struct {
|
|
|
|
|
|
Item
|
|
|
|
|
|
Data map[uint32]SingleItemInfo `orm:"data" json:"data"`
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-09-11 01:07:00 +08:00
|
|
|
|
type SingleItemInfo struct {
|
|
|
|
|
|
// 物品Id,
|
|
|
|
|
|
ItemId uint32 `json:"itemId"`
|
|
|
|
|
|
// 物品数量,
|
|
|
|
|
|
ItemCnt uint32 `json:"itemCnt"`
|
|
|
|
|
|
// 固定值360000,
|
|
|
|
|
|
LeftTime uint32 `json:"leftTime"`
|
|
|
|
|
|
// 固定值0,
|
|
|
|
|
|
ItemLevel uint32 `json:"itemLevel"`
|
2025-06-28 16:16:28 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// TableName PlayerBagItem's table name
|
2025-09-11 01:07:00 +08:00
|
|
|
|
func (*Item) TableName() string {
|
2025-06-28 16:16:28 +08:00
|
|
|
|
return TableNamePlayerBagItem
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// GroupName PlayerBagItem's table group
|
2025-09-11 01:07:00 +08:00
|
|
|
|
func (*Item) GroupName() string {
|
2025-06-28 16:16:28 +08:00
|
|
|
|
return "default"
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// NewPlayerBagItem create a new PlayerBagItem
|
2025-08-31 00:27:07 +08:00
|
|
|
|
func NewPlayerBag() *Item {
|
|
|
|
|
|
return &Item{
|
2025-06-28 16:16:28 +08:00
|
|
|
|
Model: cool.NewModel(),
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// init 创建表
|
|
|
|
|
|
func init() {
|
2025-08-31 00:27:07 +08:00
|
|
|
|
cool.CreateTable(&Item{})
|
2025-06-28 16:16:28 +08:00
|
|
|
|
}
|