2025-04-27 17:23:19 +08:00

47 lines
1.1 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package model
import (
"admin/apps/game/model/dto"
"admin/internal/db"
"gorm.io/gorm"
"time"
)
func init() {
db.RegisterTableModels(Ban{})
}
type Ban struct {
ID int `gorm:"primarykey" readonly:"true"`
ProjectId string `gorm:"type:varchar(255);uniqueIndex:idx_ban"`
ServerConfID string `gorm:"type:varchar(200);uniqueIndex:idx_server" required:"true"`
BanType string `name:"封禁类型" required:"true" choices:"GetBanTypeChoices" multi_choice:"true"`
Value string `gorm:"type:varchar(128);uniqueIndex:idx_ban" name:"封禁账号" required:"true" desc:"填账号"`
ExpireAt int64 `name:"封禁到期时间" desc:"封禁到期时间0表示永久封禁"`
CreatedAt time.Time `readonly:"true"`
UpdatedAt time.Time `readonly:"true"`
DeletedAt gorm.DeletedAt `gorm:"index" readonly:"true"`
}
func (lm *Ban) TableName() string {
return "ban"
}
func (m *Ban) GetId() int {
return m.ID
}
func (m *Ban) GetBanTypeChoices(projectId string) []*dto.CommonDtoFieldChoice {
return []*dto.CommonDtoFieldChoice{
{
Desc: "作弊",
Value: "作弊",
},
{
Desc: "广告",
Value: "广告",
},
}
}