12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- package controllers
- import (
- "Medical_ERP/common/global"
- _ "Medical_ERP/common/response"
- "Medical_ERP/dto"
- "Medical_ERP/services"
- "errors"
- "gogs.baozhida.cn/zoie/OAuth-core/pkg/jwtauth/beegouser"
- )
- // 角色权限
- type RoleApi struct {
- BaseController
- }
- // UpdateRoleApi 修改角色路由权限
- // @Title 修改角色路由权限
- // @Summary 对接统一身份认证(前端暂时忽略)
- // @Description 修改角色路由权限
- // @Tags 角色
- // @Accept application/json
- // @Product application/json
- // @Param body body dto.RoleApiUpdateReq true "body"
- // @Success 200 {object} response.Response "{"code": 200, "data": [...]}"
- // @router /api/role-api [post]
- // @Security Bearer
- func (c *RoleApi) UpdateRoleApi() {
- reqData := dto.RoleApiUpdateReq{}
- if err := c.ParseAndValidate(&c.Ctx.Input.RequestBody, &reqData); err != nil {
- err = errors.New("解析表单数据异常")
- c.Error(global.ParseFormErr, err, err.Error())
- return
- }
- var RoleApService services.RoleApi
- reqData.SetUpdateBy(beegouser.GetUserId(c.Ctx))
- err := RoleApService.UpdateRoleApi(&reqData)
- if err != nil {
- c.Error(global.DatabaseOperationErr, err, err.Error())
- }
- c.OK(reqData.RoleKey, "操作成功")
- }
|