Files
bl/modules/config/model/server_list.go

47 lines
1.5 KiB
Go
Raw Normal View History

package model
import (
"blazing/cool"
)
const TableNameServerList = "server_list"
// 服务器设置天气地图|地图是否显示其他人,设置异色概率|ip
// ServerList mapped from table <server_list>
type ServerList struct {
*cool.Model
OnlineID uint16 `gorm:"column:online_id;comment:'在线ID';uniqueIndex" json:"online_id"`
IP string `gorm:"type:string;comment:'服务器IP'" json:"ip"`
Port uint16 `gorm:"comment:'端口号,通常是小整数'" json:"port"`
IsOpen bool `gorm:"default:true;not null;comment:'服务器是否开启,默认为开启状态'" json:"is_open"`
CanPort []uint32 `gorm:"type:jsonb;comment:'可连接端口'" json:"can_port"`
IsVip uint32 `gorm:"default:0;not null;comment:'是否为VIP服务器'" json:"is_vip"`
//服务器异色概率设定ServerList
ShinyRate uint8 `gorm:"default:0;comment:'异色概率'" json:"shiny_rate"`
//服务器天气设定ServerList
WeatherRate uint8 `gorm:"default:0;comment:'天气概率'" json:"weather_rate"`
Desc string `gorm:"comment:'服务器描述'" json:"desc"`
}
// 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{})
}