获取菜单详情新增apis字段
This commit is contained in:
parent
38094bf106
commit
e4bf7e65e7
@ -35,6 +35,7 @@ type getMenu struct {
|
|||||||
Path string `json:"path"` // 页面地址(#表示当前页)
|
Path string `json:"path"` // 页面地址(#表示当前页)
|
||||||
Component string `json:"component"` // 组件名称
|
Component string `json:"component"` // 组件名称
|
||||||
Api []*getAdminMenuApi `json:"api"` // 接口数据
|
Api []*getAdminMenuApi `json:"api"` // 接口数据
|
||||||
|
Apis []string `json:"apis"` // 接口数据
|
||||||
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
|
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
|
||||||
UpdatedAt model.LocalTime `json:"updated_at"` // 修改时间
|
UpdatedAt model.LocalTime `json:"updated_at"` // 修改时间
|
||||||
}
|
}
|
||||||
@ -50,6 +51,7 @@ func GetMenuResponse(adminMenu *model.AdminMenu, adminMenuApi []*model.AdminMenu
|
|||||||
var getMenuResponse *getMenu
|
var getMenuResponse *getMenu
|
||||||
|
|
||||||
getAdminMenuApis := make([]*getAdminMenuApi, len(adminMenuApi))
|
getAdminMenuApis := make([]*getAdminMenuApi, len(adminMenuApi))
|
||||||
|
apis := make([]string, 0, len(adminMenuApi))
|
||||||
|
|
||||||
if adminMenu != nil {
|
if adminMenu != nil {
|
||||||
getMenuResponse = &getMenu{
|
getMenuResponse = &getMenu{
|
||||||
@ -78,9 +80,11 @@ func GetMenuResponse(adminMenu *model.AdminMenu, adminMenuApi []*model.AdminMenu
|
|||||||
|
|
||||||
// 将转换后的结构体添加到新切片中
|
// 将转换后的结构体添加到新切片中
|
||||||
getAdminMenuApis[i] = result
|
getAdminMenuApis[i] = result
|
||||||
|
apis = append(apis, strconv.FormatInt(v.ApiId, 10))
|
||||||
}
|
}
|
||||||
|
|
||||||
getMenuResponse.Api = getAdminMenuApis
|
getMenuResponse.Api = getAdminMenuApis
|
||||||
|
getMenuResponse.Apis = apis
|
||||||
}
|
}
|
||||||
|
|
||||||
return getMenuResponse, nil
|
return getMenuResponse, nil
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user