23 lines
429 B
Go
23 lines
429 B
Go
package model
|
|
|
|
type UserStatus string
|
|
|
|
const (
|
|
UserStatePending UserStatus = "pending"
|
|
UserStateComfirmed UserStatus = "confirmed"
|
|
)
|
|
|
|
type UserModel struct {
|
|
BaseModel
|
|
ID uint `gorm:"primarykey"`
|
|
Username string
|
|
Passhash string
|
|
Secret string
|
|
State UserStatus `gorm:"type:enum('pending', 'confirmed')"`
|
|
IsAdmin bool `gorm:"default:false"`
|
|
}
|
|
|
|
func (m *UserModel) TableName() string {
|
|
return "users"
|
|
}
|