Files
bl/modules/blazing/model/item.go
昔念 1dbd4169e9 feat(xmlres): 更新 BOSS 配置结构并优化字段注释
新增多个 BOSS 相关配置字段,包括任务关联、奖励机制与挑战限制等,
增强 BOSS 精灵的可配置性与业务表达能力。同时完善字段注释以对齐 XML
实际使用情况,并保留原有部分字段用于兼容历史配置。

fix(fight): 调整战斗胜利回调执行顺序以确保数据一致性

将战斗结束回调移至广播之前执行,保证在发送战斗结果前已完成所有状态
更新,尤其是针对胜利宠物的信息同步
2025-11-22 22:57:32 +08:00

58 lines
1.3 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_bag_item"
// ItemInfo
// 用于表示发放物品的信息
type ItemInfo struct {
ItemId uint32 `json:"itemId" description:"发放物品ID"` // 发放物品ID
ItemCnt uint32 `json:"itemCount" description:"发放物品的数量"` // 发放物品的数量,
}
// PlayerBagItem mapped from table <player_bag_item>
type Item struct {
*cool.Model
PlayerID uint64 `gorm:"not null;index:idx_player_bag_item_by_player_id;comment:'所属玩家ID'" json:"player_id"`
// 物品Id
ItemId uint32 `json:"item_id"`
// 物品数量,
ItemCnt uint32 `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{
Model: cool.NewModel(),
}
}
// init 创建表
func init() {
cool.CreateTable(&Item{})
}