Files
bl/modules/config/model/server_show.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

40 lines
968 B
Go

package model
import (
"blazing/cool"
"time"
)
const TableNameServerShow = "server_show"
// ServerShow 绑定服务器展示信息(冠名、属主、到期时间)。
type ServerShow struct {
*cool.Model
ServerID uint32 `gorm:"column:server_id;comment:'服务器ID';uniqueIndex" json:"server_id"`
Name string `gorm:"comment:'服务器展示名'" json:"name"`
Owner uint32 `gorm:"comment:'服务器属主'" json:"owner"`
ExpireTime time.Time `gorm:"column:expire_time;default:0;comment:'展示到期时间'" json:"expire_time"`
}
// TableName ServerShow's table name
func (*ServerShow) TableName() string {
return TableNameServerShow
}
// GroupName ServerShow's table group
func (*ServerShow) GroupName() string {
return "default"
}
// NewServerShow create a new ServerShow
func NewServerShow() *ServerShow {
return &ServerShow{
Model: cool.NewModel(),
}
}
// init 创建表
func init() {
cool.CreateTable(&ServerShow{})
}