package v1
|
|
import (
|
"aps_crm/model/response"
|
"aps_crm/pkg/contextx"
|
"aps_crm/pkg/ecode"
|
"github.com/gin-gonic/gin"
|
)
|
|
type MenuApi struct{}
|
|
// List
|
//
|
// @Tags Menu
|
// @Summary 获取菜单树
|
// @Security ApiKeyAuth
|
// @param Authorization header string true "Authorization"
|
// @Produce application/json
|
// @Success 200 {object} contextx.Response{data=response.MenuTreeResponse}
|
// @Router /api/menu/getMenu [get]
|
func (m *MenuApi) List(c *gin.Context) {
|
ctx, ok := contextx.NewContext(c, nil)
|
if !ok {
|
return
|
}
|
|
list, errCode := menuService.GetMenuTree()
|
if errCode != ecode.OK {
|
ctx.Fail(errCode)
|
return
|
}
|
|
ctx.OkWithDetailed(response.MenuTreeResponse{
|
List: list,
|
})
|
}
|