This commit is contained in:
苏尹岚
2020-09-27 13:55:31 +08:00
parent 8f93d2f8de
commit 49ef3ed9e0
4 changed files with 29 additions and 29 deletions

View File

@@ -14,15 +14,15 @@ type PowerController struct {
// @Title 添加功能(菜单)
// @Description 添加功能(菜单)
// @Param token header string true "认证token"
// @Param payload formData string true "Function json实体"
// @Param payload formData string true "Menu json实体"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /AddFunction [post]
func (c *PowerController) AddFunction() {
c.callAddFunction(func(params *tPowerAddFunctionParams) (retVal interface{}, errCode string, err error) {
function := &model.Function{}
if err = utils.UnmarshalUseNumber([]byte(params.Payload), function); err == nil {
err = cms.AddFunction(params.Ctx, function)
// @router /AddMenu [post]
func (c *PowerController) AddMenu() {
c.callAddMenu(func(params *tPowerAddMenuParams) (retVal interface{}, errCode string, err error) {
menu := &model.Menu{}
if err = utils.UnmarshalUseNumber([]byte(params.Payload), menu); err == nil {
err = cms.AddMenu(params.Ctx, menu)
}
return retVal, "", err
})
@@ -33,10 +33,10 @@ func (c *PowerController) AddFunction() {
// @Param token header string true "认证token"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /GetFunction [post]
func (c *PowerController) GetFunction() {
c.callGetFunction(func(params *tPowerGetFunctionParams) (retVal interface{}, errCode string, err error) {
retVal, err = cms.GetFunction(params.Ctx)
// @router /GetMenu [post]
func (c *PowerController) GetMenu() {
c.callGetMenu(func(params *tPowerGetMenuParams) (retVal interface{}, errCode string, err error) {
retVal, err = cms.GetMenu(params.Ctx)
return retVal, "", err
})
}