This commit is contained in:
苏尹岚
2020-09-27 15:24:36 +08:00
parent 4dd0e7dd8f
commit 5c9b56b5f4
4 changed files with 90 additions and 0 deletions

View File

@@ -59,3 +59,30 @@ func (c *PowerController) UpdateMenu() {
return retVal, "", err
})
}
// @Title 添加角色
// @Description 添加角色
// @Param token header string true "认证token"
// @Param name formData string true "角色名"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /AddRole [post]
func (c *PowerController) AddRole() {
c.callAddRole(func(params *tPowerAddRoleParams) (retVal interface{}, errCode string, err error) {
err = cms.AddRole(params.Ctx, params.Name)
return retVal, "", err
})
}
// @Title 查询角色
// @Description 查询角色
// @Param token header string true "认证token"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /GetRole [get]
func (c *PowerController) GetRole() {
c.callGetRole(func(params *tPowerGetRoleParams) (retVal interface{}, errCode string, err error) {
retVal, err = cms.GetRole(params.Ctx)
return retVal, "", err
})
}