22 lines
307 B
Go
22 lines
307 B
Go
|
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 "未知类型"
|
||
|
}
|