增加菜单参数配置功能
移除视图中复杂sql更改为model映射模式
This commit is contained in:
@@ -2,7 +2,12 @@ package model
|
||||
|
||||
type SysMenu struct {
|
||||
SysBaseMenu
|
||||
MenuId string `json:"menuId" gorm:"comment:'菜单ID'"`
|
||||
AuthorityId string `json:"-" gorm:"comment:'角色ID'"`
|
||||
Children []SysMenu `json:"children"`
|
||||
MenuId string `json:"menuId" gorm:"comment:'菜单ID'"`
|
||||
AuthorityId string `json:"-" gorm:"comment:'角色ID'"`
|
||||
Children []SysMenu `json:"children"`
|
||||
Parameters []SysBaseMenuParameter `json:"parameters" gorm:"ForeignKey:MenuId"`
|
||||
}
|
||||
|
||||
func (s SysMenu) TableName() string {
|
||||
return "authority_menu"
|
||||
}
|
||||
|
||||
@@ -14,8 +14,9 @@ type SysBaseMenu struct {
|
||||
Component string `json:"component" gorm:"comment:'对应前端文件路径'"`
|
||||
Sort int `json:"sort" gorm:"comment:'排序标记'"`
|
||||
Meta `json:"meta" gorm:"comment:'附加属性'"`
|
||||
SysAuthoritys []SysAuthority `json:"authoritys" gorm:"many2many:sys_authority_menus;"`
|
||||
Children []SysBaseMenu `json:"children"`
|
||||
SysAuthoritys []SysAuthority `json:"authoritys" gorm:"many2many:sys_authority_menus;"`
|
||||
Children []SysBaseMenu `json:"children"`
|
||||
Parameters []SysBaseMenuParameter `json:"parameters"`
|
||||
}
|
||||
|
||||
type Meta struct {
|
||||
@@ -24,3 +25,11 @@ type Meta struct {
|
||||
Title string `json:"title" gorm:"comment:'菜单名'"`
|
||||
Icon string `json:"icon" gorm:"comment:'菜单图标'"`
|
||||
}
|
||||
|
||||
type SysBaseMenuParameter struct {
|
||||
gorm.Model
|
||||
SysBaseMenuId uint
|
||||
Type string `json:"type" gorm:"commit:'地址栏携带参数为params还是query'"`
|
||||
Key string `json:"key" gorm:"commit:'地址栏携带参数的key'"`
|
||||
Value string `json:"value" gorm:"commit:'地址栏携带参数的值'"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user