Documentation
¶
Index ¶
Constants ¶
View Source
const ( RoleGuestUser = 0 RoleCommonUser = 1 RoleAdminUser = 10 RoleRootUser = 100 )
View Source
const ( UserStatusEnabled = 1 // don't use 0, 0 is the default value! UserStatusDisabled = 2 // also don't use 0 UserStatusDeleted = 3 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Rule ¶
type Rule struct {
Key int `json:"key"`
Disabled bool `json:"disabled"`
Href string `json:"href"`
Avatar string `json:"avatar"`
Name string `json:"name"`
Owner string `json:"owner"`
Desc string `json:"desc"`
CallNo int `json:"callNo"`
Status string `json:"status"`
UpdatedAt time.Time `json:"updatedAt"`
CreatedAt time.Time `json:"createdAt"`
Progress int `json:"progress"`
}
Rule 规则列表项
type User ¶
type User struct {
ID uint `json:"userid" gorm:"primaryKey"`
Username string `json:"name" gorm:"unique;index"`
Password string `json:"password" gorm:"not null;" validate:"min=8,max=20"`
Avatar string `json:"avatar" gorm:"type:varchar(255)"`
Email string `json:"email" gorm:"type:varchar(255)"`
Phone string `json:"phone" gorm:"type:varchar(255)"`
Address string `json:"address" gorm:"type:varchar(255)"`
Group string `json:"group" gorm:"type:varchar(255)"`
Access string `json:"access" gorm:"type:varchar(255)"`
CreatedAt string `json:"createdAt" gorm:"autoCreateTime"`
UpdatedAt string `json:"updatedAt" gorm:"autoUpdateTime"`
Role int `json:"role" gorm:"type:int;default:1"` // admin, util
Status int `json:"status" gorm:"type:int;default:1"` // enabled, disabled
}
Click to show internal directories.
Click to hide internal directories.