forked from lxh/go-wxhelper
23 lines
402 B
Go
23 lines
402 B
Go
|
package types
|
||
|
|
||
|
type MenuType string
|
||
|
|
||
|
const (
|
||
|
MenuTypeMenu = MenuType("MENU") // 菜单
|
||
|
MenuTypeButton = MenuType("BUTTON") // 按钮
|
||
|
)
|
||
|
|
||
|
// 状态对应的描述
|
||
|
var menuTypeMap = map[MenuType]string{
|
||
|
MenuTypeMenu: "菜单",
|
||
|
MenuTypeButton: "按钮",
|
||
|
}
|
||
|
|
||
|
// 处理为看得懂的状态
|
||
|
func (s MenuType) String() string {
|
||
|
if str, ok := menuTypeMap[s]; ok {
|
||
|
return str
|
||
|
}
|
||
|
return string(s)
|
||
|
}
|