:toda:
This commit is contained in:
22
global/constant/common_constant.go
Normal file
22
global/constant/common_constant.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package constant
|
||||
|
||||
// Status 启用禁用
|
||||
type Status int
|
||||
|
||||
const (
|
||||
Disabled Status = iota
|
||||
Enabled
|
||||
)
|
||||
|
||||
var StatusMap = map[Status]string{
|
||||
Disabled: "禁用",
|
||||
Enabled: "启用",
|
||||
}
|
||||
|
||||
func (u Status) String() string {
|
||||
if v, ok := StatusMap[u]; ok {
|
||||
return v
|
||||
}
|
||||
|
||||
return "未知类型"
|
||||
}
|
||||
Reference in New Issue
Block a user