Files
bl/modules/config/model/server_list.go
xinian 90f1447d48
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
refactor: 重构服务器冠名逻辑至独立表
2026-04-10 19:36:59 +08:00

41 lines
898 B
Go

package model
import (
"blazing/cool"
"blazing/cool/coolconfig"
)
const TableNameServerList = "server_list"
// 服务器设置天气地图|地图是否显示其他人,设置异色概率|ip
// ServerList mapped from table <server_list>
type ServerList struct {
*cool.Model
coolconfig.ServerList
ServerShow *ServerShow `orm:"with:server_id=online_id" json:"server_show,omitempty"`
// isonline
IsOnline uint8 `gorm:"column:isonline;default:0;comment:'是否在线'" json:"isonline"`
}
// TableName ServerList's table name
func (*ServerList) TableName() string {
return TableNameServerList
}
// GroupName ServerList's table group
func (*ServerList) GroupName() string {
return "default"
}
// NewServerList create a new ServerList
func NewServerList() *ServerList {
return &ServerList{
Model: cool.NewModel(),
}
}
// init 创建表
func init() {
cool.CreateTable(&ServerList{})
}