- api/admin/v1 拆 base/system/admin 三子包,路由前缀 /admin/v1/{base,system,admin}
- system: auth/menu/role;admin: 管理员;base: log
- controller 改 import 子包;006_menu_paths_v2.sql 更新接口路径映射
- 权限码与路由分离,permission 标识不变
- 冒烟测试新路径 8 接口全通过
34 lines
1.1 KiB
Go
34 lines
1.1 KiB
Go
package system
|
|
|
|
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"`
|
|
}
|