- 重构了登录控制器和登录服务,使用了cool框架的控制器和服务结构 - 移除了注册相关代码和不必要的示例代码 - 更新了登录服务,关联了服务器列表模型 - 删除了与示例相关的模型和服务文件
38 lines
954 B
Go
38 lines
954 B
Go
package model
|
||
|
||
import (
|
||
"blazing/cool"
|
||
)
|
||
|
||
const TableNamePlayerBagItem = "player_bag_item"
|
||
|
||
// PlayerBagItem mapped from table <player_bag_item>
|
||
type PlayerBagItem struct {
|
||
*cool.Model
|
||
PlayerID uint64 `gorm:"not null;index:idx_player_bag_item_by_player_id;comment:'所属玩家ID'" json:"player_id"`
|
||
ItemID int32 `gorm:"not null;comment:'道具唯一编号'" json:"item_id"`
|
||
Quantity int32 `gorm:"not null;default:0;comment:'拥有数量(uint16)'" json:"quantity"`
|
||
}
|
||
|
||
// TableName PlayerBagItem's table name
|
||
func (*PlayerBagItem) TableName() string {
|
||
return TableNamePlayerBagItem
|
||
}
|
||
|
||
// GroupName PlayerBagItem's table group
|
||
func (*PlayerBagItem) GroupName() string {
|
||
return "default"
|
||
}
|
||
|
||
// NewPlayerBagItem create a new PlayerBagItem
|
||
func NewPlayerBagItem() *PlayerBagItem {
|
||
return &PlayerBagItem{
|
||
Model: cool.NewModel(),
|
||
}
|
||
}
|
||
|
||
// init 创建表
|
||
func init() {
|
||
cool.CreateTable(&PlayerBagItem{})
|
||
}
|