菜单编辑功能 api关联模式变更后台相关

This commit is contained in:
pixel
2019-09-26 13:13:42 +08:00
parent 9f615afdae
commit 59565c042d
8 changed files with 87 additions and 24 deletions

View File

@@ -52,11 +52,11 @@ func GetMenuList(c *gin.Context) {
}
// @Tags menu
// @Summary 分页获取基础menu列表
// @Summary 新增菜单
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body modelInterface.PageInfo true "分页获取基础menu列表"
// @Param data body dbModel.BaseMenu true "新增菜单"
// @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /menu/addBaseMenu [post]
func AddBaseMenu(c *gin.Context) {
@@ -155,3 +155,22 @@ func DeleteBaseMenu(c *gin.Context) {
servers.ReportFormat(c, true, "删除成功", gin.H{})
}
}
// @Tags menu
// @Summary 新增菜单
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body dbModel.BaseMenu true "新增菜单"
// @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /menu/updataBaseMen [post]
func UpdataBaseMenu(c *gin.Context) {
var menu dbModel.BaseMenu
_ = c.BindJSON(&menu)
err := menu.UpdataBaseMenu()
if err != nil {
servers.ReportFormat(c, false, fmt.Sprintf("修改失败:%v", err), gin.H{})
} else {
servers.ReportFormat(c, true, "修改成功", gin.H{})
}
}