32 lines
690 B
Go
32 lines
690 B
Go
package model
|
|
|
|
import (
|
|
"admin/internal/db"
|
|
"gorm.io/gorm"
|
|
"time"
|
|
)
|
|
|
|
func init() {
|
|
db.RegisterTableModels(WhiteList{})
|
|
}
|
|
|
|
type WhiteList struct {
|
|
ID int `gorm:"primarykey" readonly:"true"`
|
|
ProjectId string `gorm:"type:varchar(256);uniqueIndex:idx_whitelist"`
|
|
Account string `gorm:"type:varchar(128);uniqueIndex:idx_whitelist"`
|
|
AccountType int `gorm:"uniqueIndex:idx_whitelist"`
|
|
Desc string
|
|
|
|
CreatedAt time.Time `readonly:"true"`
|
|
UpdatedAt time.Time `readonly:"true"`
|
|
DeletedAt gorm.DeletedAt `gorm:"index" readonly:"true"`
|
|
}
|
|
|
|
func (lm *WhiteList) TableName() string {
|
|
return "whitelist"
|
|
}
|
|
|
|
func (m *WhiteList) GetId() int {
|
|
return m.ID
|
|
}
|