新增菜单和角色关联接口
This commit is contained in:
@ -3,6 +3,9 @@ package model
|
||||
type BatchDeleteIn struct {
|
||||
Ids []int
|
||||
}
|
||||
type BatchDeleteOut struct {
|
||||
Ids []int
|
||||
}
|
||||
type LoginOut struct {
|
||||
Token string
|
||||
}
|
||||
|
||||
74
internal/model/menu.go
Normal file
74
internal/model/menu.go
Normal file
@ -0,0 +1,74 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// Menu 菜单信息
|
||||
type Menu struct {
|
||||
g.Meta `orm:"table:menus"`
|
||||
Id int64 `json:"id" dc:"菜单ID" orm:"id"`
|
||||
ParentId int64 `json:"parentId" dc:"父级菜单ID" orm:"parent_id"`
|
||||
Name string `json:"name" dc:"菜单名称" orm:"name"`
|
||||
Path string `json:"path" dc:"前端路由路径" orm:"path"`
|
||||
Component string `json:"component" dc:"前端组件路径" orm:"component"`
|
||||
Type int `json:"type" dc:"类型:1=目录,2=菜单" orm:"type"`
|
||||
Icon string `json:"icon" dc:"图标" orm:"icon"`
|
||||
Sort int `json:"sort" dc:"排序" orm:"sort"`
|
||||
Hidden bool `json:"hidden" dc:"是否隐藏:0=显示,1=隐藏" orm:"hidden"`
|
||||
Status int `json:"status" dc:"状态:1=启用,2=禁用" orm:"status"`
|
||||
}
|
||||
|
||||
// MenuCreateInput 创建菜单输入参数
|
||||
type MenuCreateInput struct {
|
||||
ParentId int64
|
||||
Name string
|
||||
Path string
|
||||
Component string
|
||||
Type int
|
||||
Icon string
|
||||
Sort int
|
||||
Hidden bool
|
||||
Status int
|
||||
}
|
||||
|
||||
// MenuUpdateInput 更新菜单输入参数
|
||||
type MenuUpdateInput struct {
|
||||
Id int64
|
||||
ParentId int64
|
||||
Name string
|
||||
Path string
|
||||
Component string
|
||||
Type int
|
||||
Icon string
|
||||
Sort int
|
||||
Hidden bool
|
||||
Status int
|
||||
}
|
||||
|
||||
// MenuListInput 获取菜单列表输入参数
|
||||
type MenuListInput struct {
|
||||
Page int
|
||||
Size int
|
||||
ParentId int64
|
||||
Name string
|
||||
Path string
|
||||
Type int
|
||||
Status int
|
||||
}
|
||||
|
||||
// MenuListOutput 获取菜单列表输出参数
|
||||
type MenuListOutput struct {
|
||||
List []Menu
|
||||
Total int
|
||||
}
|
||||
|
||||
// MenuGetByIdInput 根据ID获取菜单输入参数
|
||||
type MenuGetByIdInput struct {
|
||||
Id int64
|
||||
}
|
||||
|
||||
// MenuDeleteInput 删除菜单输入参数
|
||||
type MenuDeleteInput struct {
|
||||
Id int64
|
||||
}
|
||||
24
internal/model/roleMenu.go
Normal file
24
internal/model/roleMenu.go
Normal file
@ -0,0 +1,24 @@
|
||||
package model
|
||||
|
||||
import "github.com/gogf/gf/v2/frame/g"
|
||||
|
||||
type RoleMenu struct {
|
||||
g.Meta `orm:"table:role_menus"`
|
||||
Id int64 `json:"id" orm:"id" dc:"角色菜单ID"`
|
||||
RoleId int64 `json:"roleId" orm:"role_id" dc:"角色ID"`
|
||||
MenuId int64 `json:"menuId" orm:"menu_id" dc:"菜单ID"`
|
||||
}
|
||||
type RoleMenuListInput struct {
|
||||
Page int
|
||||
Size int
|
||||
RoleId int64
|
||||
}
|
||||
type RoleMenuListOutput struct {
|
||||
List []RoleMenu
|
||||
Total int
|
||||
}
|
||||
|
||||
type RoleMenuSaveInput struct {
|
||||
RoleId int
|
||||
MenuIds []int
|
||||
}
|
||||
Reference in New Issue
Block a user