75 lines
1.8 KiB
Go
75 lines
1.8 KiB
Go
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
|
||
}
|