- 将 admin 相关服务移动到 internal/service/admin 目录下 - 更新控制器中的服务导入路径引用 - 移除已合并的服务文件 - 添加统一工作约定文档 - 更新 API 接口定义的包路径
34 lines
1.1 KiB
Go
34 lines
1.1 KiB
Go
package menu
|
|
|
|
import "github.com/gogf/gf/v2/frame/g"
|
|
|
|
// RouteMeta mirrors vben admin dynamic route metadata.
|
|
type RouteMeta struct {
|
|
Title string `json:"title"`
|
|
Icon string `json:"icon"`
|
|
Order int `json:"order"`
|
|
Authority []string `json:"authority,omitempty"` // role codes
|
|
HideInMenu bool `json:"hideInMenu,omitempty"`
|
|
KeepAlive bool `json:"keepAlive,omitempty"`
|
|
}
|
|
|
|
// RouteItem is one node of the vben route tree.
|
|
type RouteItem struct {
|
|
Name string `json:"name"`
|
|
Path string `json:"path"`
|
|
Component string `json:"component,omitempty"`
|
|
Meta RouteMeta `json:"meta"`
|
|
Children []*RouteItem `json:"children,omitempty"`
|
|
}
|
|
|
|
// MenuRoutesReq returns the current admin's menu tree as vben routes
|
|
// (backend access mode, login-only endpoint).
|
|
type MenuRoutesReq struct {
|
|
g.Meta `path:"/system/menu/routes" method:"get" tags:"Admin/System/Menu" summary:"Current admin menu routes"`
|
|
}
|
|
|
|
// MenuRoutesRes is the response of MenuRoutesReq.
|
|
type MenuRoutesRes struct {
|
|
Routes []*RouteItem `json:"routes"`
|
|
}
|