22 lines
922 B
Go
22 lines
922 B
Go
package model
|
|
|
|
import "time"
|
|
|
|
type AdminUser struct {
|
|
ID uint64 `gorm:"primaryKey" json:"id"`
|
|
Username string `gorm:"size:64;not null;uniqueIndex" json:"username"`
|
|
PasswordHash string `gorm:"size:255;not null" json:"-"`
|
|
Nickname string `gorm:"size:64;not null;default:''" json:"nickname"`
|
|
Status string `gorm:"size:32;not null;default:'active'" json:"status"`
|
|
SupportStatus string `gorm:"size:16;not null;default:'offline';index" json:"support_status"`
|
|
TokenVersion int64 `gorm:"not null;default:1" json:"-"`
|
|
PasswordMustChange bool `gorm:"not null;default:false" json:"password_must_change"`
|
|
LastLoginAt *time.Time `json:"last_login_at"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
UpdatedAt time.Time `json:"updated_at"`
|
|
}
|
|
|
|
func (AdminUser) TableName() string {
|
|
return "admin_users"
|
|
}
|