refactor(model): 重构玩家登录信息结构并优化精灵技能定义

This commit is contained in:
1
2025-08-15 08:17:43 +00:00
parent 20acbfd62e
commit de5ee07a22
13 changed files with 201 additions and 298 deletions

View File

@@ -0,0 +1,35 @@
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{})
}