功能(菜单)接口
This commit is contained in:
10
business/jxstore/cms/permission.go
Normal file
10
business/jxstore/cms/permission.go
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
package cms
|
||||||
|
|
||||||
|
import (
|
||||||
|
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
||||||
|
"git.rosy.net.cn/jx-callback/business/model"
|
||||||
|
)
|
||||||
|
|
||||||
|
func GetFunction(ctx *jxcontext.Context) (functions []*model.Function, err error) {
|
||||||
|
return functions, err
|
||||||
|
}
|
||||||
37
controllers/permission.go
Normal file
37
controllers/permission.go
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
package controllers
|
||||||
|
|
||||||
|
import (
|
||||||
|
"git.rosy.net.cn/jx-callback/business/jxstore/cms"
|
||||||
|
"github.com/astaxie/beego"
|
||||||
|
)
|
||||||
|
|
||||||
|
type PowerController struct {
|
||||||
|
beego.Controller
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Title 添加功能(菜单)
|
||||||
|
// @Description 添加功能(菜单)
|
||||||
|
// @Param token header string true "认证token"
|
||||||
|
// @Param payload formData string true "Function 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) {
|
||||||
|
|
||||||
|
return retVal, "", err
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Title 查询功能(菜单)
|
||||||
|
// @Description 查询功能(菜单)
|
||||||
|
// @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)
|
||||||
|
return retVal, "", err
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -141,6 +141,11 @@ func init() {
|
|||||||
&controllers.EventController{},
|
&controllers.EventController{},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
beego.NSNamespace("/power",
|
||||||
|
beego.NSInclude(
|
||||||
|
&controllers.PowerController{},
|
||||||
|
),
|
||||||
|
),
|
||||||
)
|
)
|
||||||
beego.AddNamespace(ns)
|
beego.AddNamespace(ns)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user