go-wxhelper/api/admin/menu/save.go

25 lines
478 B
Go
Raw Normal View History

2024-02-02 11:44:11 +08:00
package menu
import (
"github.com/gin-gonic/gin"
menuParam "wechat-robot/model/param/menu"
"wechat-robot/pkg/response"
"wechat-robot/service/menu"
)
// Save
// @description: 保存菜单
// @param ctx
func Save(ctx *gin.Context) {
var p menuParam.Save
if err := ctx.ShouldBind(&p); err != nil {
response.New(ctx).SetError(err).Fail()
return
}
if err := menu.Save(p); err != nil {
response.New(ctx).SetError(err).Fail()
return
}
response.New(ctx).Success()
}