40 lines
968 B
Go
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{})
|
|
}
|