2026-01-05 01:04:52 +08:00
|
|
|
package model
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"blazing/cool"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// 表名常量
|
|
|
|
|
const TableNamePlayerTitle = "player_title"
|
|
|
|
|
|
|
|
|
|
// PlayerTitle 对应数据库表 <player_title>
|
|
|
|
|
type Title struct {
|
2026-01-08 03:30:18 +08:00
|
|
|
Base
|
2026-01-05 01:04:52 +08:00
|
|
|
PlayerID uint64 `gorm:"not null;index:idx_player_title_by_player_id;comment:'所属玩家ID'" json:"player_id"`
|
2026-01-12 00:04:10 +08:00
|
|
|
//TitleID uint32 `gorm:"not null;comment:'称号ID'" json:"title_id"`
|
2026-01-05 01:04:52 +08:00
|
|
|
//可用称号
|
2026-01-20 06:15:55 +08:00
|
|
|
AvailableTitle []uint32 `gorm:"type:jsonb; comment:'可用称号'" json:"available_title"`
|
2026-01-05 01:04:52 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// TableName 返回表名
|
|
|
|
|
func (*Title) TableName() string {
|
|
|
|
|
return TableNamePlayerTitle
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// GroupName 返回表组名
|
|
|
|
|
func (*Title) GroupName() string {
|
|
|
|
|
return "default"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// NewPlayerTitle 创建一个新的称号记录
|
|
|
|
|
func NewPlayerTitle() *Title {
|
|
|
|
|
return &Title{
|
2026-01-08 03:30:18 +08:00
|
|
|
Base: *NewBase(),
|
2026-01-05 01:04:52 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// init 程序启动时自动创建表
|
|
|
|
|
func init() {
|
|
|
|
|
cool.CreateTable(&Title{})
|
|
|
|
|
}
|