mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-08-26 16:46:14 +08:00
发布v2.7.6版本
This commit is contained in:
@@ -6,95 +6,73 @@
|
||||
package adminin
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"hotgo/internal/model"
|
||||
"hotgo/internal/model/entity"
|
||||
"hotgo/internal/model/input/form"
|
||||
)
|
||||
|
||||
// MenuMaxSortReq 菜单最大排序
|
||||
type MenuMaxSortReq struct {
|
||||
g.Meta `path:"/menu/maxSort" method:"get" tags:"菜单" summary:"菜单最大排序"`
|
||||
Id int64 `json:"id" dc:"菜单ID"`
|
||||
}
|
||||
type MenuMaxSortRes struct {
|
||||
Sort int `json:"sort" dc:"排序"`
|
||||
}
|
||||
|
||||
// MenuCodeUniqueReq 菜单编码是否唯一
|
||||
type MenuCodeUniqueReq struct {
|
||||
g.Meta `path:"/menu/code_unique" method:"get" tags:"菜单" summary:"菜单编码是否唯一"`
|
||||
Code string `json:"code" v:"required#菜单编码不能为空" dc:"菜单编码"`
|
||||
Id int64 `json:"id" dc:"菜单ID"`
|
||||
}
|
||||
type MenuCodeUniqueRes struct {
|
||||
IsUnique bool `json:"is_unique" dc:"是否唯一"`
|
||||
}
|
||||
|
||||
// MenuNameUniqueReq 菜单名称是否唯一
|
||||
type MenuNameUniqueReq struct {
|
||||
g.Meta `path:"/menu/name_unique" method:"get" tags:"菜单" summary:"菜单名称是否唯一"`
|
||||
Name string `json:"name" v:"required#菜单名称不能为空" dc:"菜单名称"`
|
||||
Id int64 `json:"id" dc:"菜单ID"`
|
||||
}
|
||||
type MenuNameUniqueRes struct {
|
||||
IsUnique bool `json:"is_unique" dc:"是否唯一"`
|
||||
}
|
||||
|
||||
// MenuEditReq 修改/新增菜单
|
||||
type MenuEditReq struct {
|
||||
g.Meta `path:"/menu/edit" method:"post" tags:"菜单" summary:"修改/新增菜单"`
|
||||
// MenuEditInp 修改/新增菜单
|
||||
type MenuEditInp struct {
|
||||
entity.AdminMenu
|
||||
}
|
||||
type MenuEditRes struct{}
|
||||
|
||||
// MenuDeleteReq 删除菜单
|
||||
type MenuDeleteReq struct {
|
||||
g.Meta `path:"/menu/delete" method:"post" tags:"菜单" summary:"删除菜单"`
|
||||
Id interface{} `json:"id" v:"required#菜单ID不能为空" dc:"菜单ID"`
|
||||
}
|
||||
type MenuDeleteRes struct{}
|
||||
|
||||
// MenuViewReq 获取指定菜单信息
|
||||
type MenuViewReq struct {
|
||||
g.Meta `path:"/menu/view" method:"get" tags:"菜单" summary:"获取指定菜单信息"`
|
||||
Id string `json:"id" v:"required#菜单ID不能为空" dc:"菜单ID"`
|
||||
}
|
||||
type MenuViewRes struct {
|
||||
*entity.AdminMenu
|
||||
func (in *MenuEditInp) Filter(ctx context.Context) (err error) {
|
||||
if in.Title == "" {
|
||||
err = gerror.New("菜单名称不能为空")
|
||||
return
|
||||
}
|
||||
if in.Type != 3 && in.Path == "" {
|
||||
err = gerror.New("路由地址不能为空")
|
||||
return
|
||||
}
|
||||
if in.Name == "" {
|
||||
err = gerror.New("路由名称不能为空")
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// MenuListReq 获取菜单列表
|
||||
type MenuListReq struct {
|
||||
g.Meta `path:"/menu/list" method:"get" tags:"菜单" summary:"获取菜单列表"`
|
||||
type MenuEditModel struct{}
|
||||
|
||||
// MenuDeleteInp 删除菜单
|
||||
type MenuDeleteInp struct {
|
||||
Id interface{} `json:"id" v:"required#菜单ID不能为空" dc:"菜单ID"`
|
||||
}
|
||||
|
||||
func (in *MenuDeleteInp) Filter(ctx context.Context) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
type MenuDeleteModel struct{}
|
||||
|
||||
// MenuListInp 获取菜单列表
|
||||
type MenuListInp struct {
|
||||
form.PageReq
|
||||
Pid int64 `json:"pid" dc:"父ID"`
|
||||
}
|
||||
|
||||
type MenuListRes struct {
|
||||
func (in *MenuListInp) Filter(ctx context.Context) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
type MenuListModel struct {
|
||||
List []*entity.AdminMenu `json:"list" dc:"数据列表"`
|
||||
form.PageRes
|
||||
}
|
||||
|
||||
// MenuSearchListReq 查询菜单列表
|
||||
type MenuSearchListReq struct {
|
||||
g.Meta `path:"/menu/search_list" method:"get" tags:"菜单" summary:"获取菜单列表"`
|
||||
Name string `json:"name" dc:"菜单名称"`
|
||||
// MenuSearchListInp 查询菜单列表
|
||||
type MenuSearchListInp struct {
|
||||
Name string `json:"name" dc:"菜单名称"`
|
||||
form.StatusReq
|
||||
}
|
||||
|
||||
type MenuSearchListRes []*model.TreeMenu
|
||||
|
||||
// MenuRoleListReq 查询角色菜单列表
|
||||
type MenuRoleListReq struct {
|
||||
g.Meta `path:"/menu/role_list" method:"get" tags:"菜单" summary:"查询角色菜单列表"`
|
||||
RoleId string `json:"role_id" dc:"角色ID"`
|
||||
func (in *MenuSearchListInp) Filter(ctx context.Context) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
type MenuRoleListRes struct {
|
||||
Menus []*model.LabelTreeMenu `json:"menus" dc:"菜单列表"`
|
||||
CheckedKeys []int64 `json:"checkedKeys" dc:"选择的菜单ID"`
|
||||
}
|
||||
type MenuSearchListModel []*model.TreeMenu
|
||||
|
||||
// MenuTree 菜单树结构
|
||||
type MenuTree struct {
|
||||
|
Reference in New Issue
Block a user