菜单编辑功能完成

This commit is contained in:
pixel
2019-09-26 18:03:15 +08:00
parent 59565c042d
commit 324d45f1de
3 changed files with 31 additions and 2 deletions

View File

@@ -174,3 +174,26 @@ func UpdataBaseMenu(c *gin.Context) {
servers.ReportFormat(c, true, "修改成功", gin.H{})
}
}
type GetById struct {
Id float64 `json:"id"`
}
// @Tags menu
// @Summary 根据id获取菜单
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body api.GetById true "根据id获取菜单"
// @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /menu/getBaseMenuById [post]
func GetBaseMenuById(c *gin.Context) {
var idInfo GetById
_ = c.BindJSON(&idInfo)
err, menu := new(dbModel.BaseMenu).GetBaseMenuById(idInfo.Id)
if err != nil {
servers.ReportFormat(c, false, fmt.Sprintf("查询失败:%v", err), gin.H{})
} else {
servers.ReportFormat(c, true, "查询成功", gin.H{"menu": menu})
}
}