Files
bl/modules/blazing/model/server_list.go
昔念 2f3ca21165 feat(login): 重构 login 服务启动方式
- 修改 login 服务端口配置,支持动态分配
- 优化 login 服务启动流程,增加信号处理
- 调整 ServerOption 类型,支持 int 类型端口
- 移除 CommendSvrInfo 相关代码,简化结构
- 更新 main 函数,采用新的服务启动方式
2025-07-06 01:49:19 +08:00

39 lines
978 B
Go

package model
import (
"blazing/cool"
)
const TableNameServerList = "server_list"
// ServerList mapped from table <server_list>
type ServerList struct {
*cool.Model
OnlineID uint32 `gorm:"column:online_id;comment:'在线ID';uniqueIndex" json:"online_id"`
//IP string `gorm:"type:varchar(16);comment:'服务器IP'" json:"ip"`
Port uint16 `gorm:"comment:'端口号,通常是小整数'" json:"port"`
//IsOpen bool `gorm:"default:true;not null;comment:'服务器是否开启,默认为开启状态'" json:"is_open"`
}
// 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{})
}