go-wxhelper/model/entity/menu.go

25 lines
980 B
Go
Raw Normal View History

2024-01-19 12:06:30 +08:00
package entity
import "wechat-robot/pkg/types"
// Menu
// @description: 菜单表
type Menu struct {
types.BaseDbModel
Type types.MenuType `json:"type" gorm:"type:enum('MENU','BUTTON'); default:'MENU'; not null; comment:'菜单类型(菜单或按钮)'"`
Name string `json:"name" gorm:"type:varchar(255);not null;comment:'页面组件名称'"`
2024-01-19 12:06:30 +08:00
Path string `json:"path" gorm:"type:varchar(255);comment:'路径'"`
Title string `json:"title" gorm:"type:varchar(255);not null;comment:'菜单标题'"`
2024-01-19 12:06:30 +08:00
Icon string `json:"icon" gorm:"type:varchar(255);comment:'菜单图标'"`
Sort int `json:"sort" gorm:"type:int(3);not null;comment:'排序值(数字越小约靠前)'"`
ParentId *string `json:"parentId" gorm:"type:varchar(32);comment:'父级菜单ID(0表示顶级菜单)'"`
}
// TableName
// @description: 表名
// @receiver Menu
// @return string
func (Menu) TableName() string {
return "t_menu"
}