2024-03-06 16:24:49 +08:00
|
|
|
package constant
|
|
|
|
|
|
|
|
type UserType int
|
|
|
|
|
|
|
|
const (
|
|
|
|
NormalAdmin UserType = iota
|
|
|
|
SuperAdmin
|
|
|
|
)
|
|
|
|
|
|
|
|
var UserTypeMap = map[UserType]string{
|
|
|
|
NormalAdmin: "普通管理员",
|
|
|
|
SuperAdmin: "超级管理员",
|
|
|
|
}
|
|
|
|
|
|
|
|
func (u UserType) String() string {
|
|
|
|
if v, ok := UserTypeMap[u]; ok {
|
|
|
|
return v
|
|
|
|
}
|
|
|
|
|
|
|
|
return "未知类型"
|
|
|
|
}
|
2024-03-07 11:03:46 +08:00
|
|
|
|
|
|
|
type UserStatus int
|
|
|
|
|
|
|
|
const (
|
|
|
|
Disabled UserStatus = iota
|
|
|
|
Normal
|
|
|
|
)
|
|
|
|
|
|
|
|
var UserStatusMap = map[UserStatus]string{
|
|
|
|
Disabled: "禁用",
|
|
|
|
Normal: "正常",
|
|
|
|
}
|
|
|
|
|
|
|
|
func (u UserStatus) String() string {
|
|
|
|
if v, ok := UserStatusMap[u]; ok {
|
|
|
|
return v
|
|
|
|
}
|
|
|
|
|
|
|
|
return "未知类型"
|
|
|
|
}
|