2025-06-20 17:13:51 +08:00
|
|
|
|
package model
|
|
|
|
|
|
|
2025-06-20 22:03:38 +00:00
|
|
|
|
import "blazing/cool"
|
2025-06-20 17:13:51 +08:00
|
|
|
|
|
|
|
|
|
|
const TableNameBaseSysMenu = "base_sys_menu"
|
|
|
|
|
|
|
|
|
|
|
|
// BaseSysMenu mapped from table <base_sys_menu>
|
|
|
|
|
|
type BaseSysMenu struct {
|
|
|
|
|
|
*cool.Model
|
|
|
|
|
|
ParentID uint `gorm:"column:parentId;type:bigint" json:"parentId"` // 父菜单ID
|
|
|
|
|
|
Name string `gorm:"column:name;type:varchar(255);not null" json:"name"` // 菜单名称
|
|
|
|
|
|
Router *string `gorm:"column:router;type:varchar(255)" json:"router"` // 菜单地址
|
2025-08-23 17:44:12 +08:00
|
|
|
|
Perms *string `gorm:"column:perms;type:text" json:"perms"` // 权限标识
|
2025-06-20 17:13:51 +08:00
|
|
|
|
Type int32 `gorm:"column:type;not null" json:"type"` // 类型 0:目录 1:菜单 2:按钮
|
|
|
|
|
|
Icon *string `gorm:"column:icon;type:varchar(255)" json:"icon"` // 图标
|
2025-10-31 00:53:22 +08:00
|
|
|
|
ordernum int32 `gorm:"column:ordernum;type:int;not null;default:0" json:"ordernum"` // 排序
|
2025-06-20 17:13:51 +08:00
|
|
|
|
ViewPath *string `gorm:"column:viewPath;type:varchar(255)" json:"viewPath"` // 视图地址
|
2025-07-11 03:36:42 +08:00
|
|
|
|
KeepAlive bool `gorm:"column:keepAlive;not null;default:1" json:"keepAlive"` // 路由缓存
|
|
|
|
|
|
IsShow bool `gorm:"column:isShow;not null;default:1" json:"isShow"` // 是否显示
|
2025-06-20 17:13:51 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// TableName BaseSysMenu's table name
|
|
|
|
|
|
func (*BaseSysMenu) TableName() string {
|
|
|
|
|
|
return TableNameBaseSysMenu
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// NewBaseSysMenu create a new BaseSysMenu
|
|
|
|
|
|
func NewBaseSysMenu() *BaseSysMenu {
|
|
|
|
|
|
return &BaseSysMenu{
|
|
|
|
|
|
Model: cool.NewModel(),
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// init 创建表
|
|
|
|
|
|
func init() {
|
|
|
|
|
|
cool.CreateTable(&BaseSysMenu{})
|
|
|
|
|
|
}
|