36 lines
745 B
Go
36 lines
745 B
Go
package model
|
|
|
|
import (
|
|
"blazing/cool"
|
|
)
|
|
|
|
const TableNamePlayerInfo = "player_info"
|
|
|
|
type PlayerInfo struct {
|
|
*cool.Model
|
|
PlayerID uint64 `gorm:"not null;index:idx_pet_by_player_id;comment:'所属玩家ID'" json:"player_id"`
|
|
Data string `gorm:"type:text;not null;comment:'全部数据'" json:"data"`
|
|
}
|
|
|
|
// TableName PlayerInfo's table name
|
|
func (*PlayerInfo) TableName() string {
|
|
return TableNamePlayerInfo
|
|
}
|
|
|
|
// GroupName PlayerInfo's table group
|
|
func (*PlayerInfo) GroupName() string {
|
|
return "default"
|
|
}
|
|
|
|
// NewPlayerInfo create a new PlayerInfo
|
|
func NewPlayer() *PlayerInfo {
|
|
return &PlayerInfo{
|
|
Model: cool.NewModel(),
|
|
}
|
|
}
|
|
|
|
// init 创建表
|
|
func init() {
|
|
cool.CreateTable(&PlayerInfo{})
|
|
}
|