|  |  |  | 
|---|
|  |  |  | import com.doumee.config.annotation.CloudRequiredPermission; | 
|---|
|  |  |  | import com.doumee.core.annotation.pr.PreventRepeat; | 
|---|
|  |  |  | import com.doumee.core.constants.OperaType; | 
|---|
|  |  |  | import com.doumee.core.model.ApiResponse; | 
|---|
|  |  |  | import com.doumee.core.model.PageData; | 
|---|
|  |  |  | import com.doumee.core.model.PageWrap; | 
|---|
|  |  |  | import com.doumee.service.business.third.model.ApiResponse; | 
|---|
|  |  |  | import com.doumee.service.business.third.model.PageData; | 
|---|
|  |  |  | import com.doumee.service.business.third.model.PageWrap; | 
|---|
|  |  |  | import com.doumee.core.utils.Constants; | 
|---|
|  |  |  | import com.doumee.dao.system.dto.CreateRoleMenuDTO; | 
|---|
|  |  |  | import com.doumee.dao.system.dto.CreateRolePermissionDTO; | 
|---|
|  |  |  | import com.doumee.dao.system.dto.QuerySystemRoleDTO; | 
|---|
|  |  |  | import com.doumee.dao.system.model.SystemDataPermission; | 
|---|
|  |  |  | import com.doumee.dao.system.model.SystemRole; | 
|---|
|  |  |  | import com.doumee.dao.system.vo.SystemRoleListVO; | 
|---|
|  |  |  | import com.doumee.service.system.SystemRoleService; | 
|---|
|  |  |  | 
|---|
|  |  |  | @PostMapping("/createRoleMenu") | 
|---|
|  |  |  | @CloudRequiredPermission("system:role:createRoleMenu") | 
|---|
|  |  |  | public ApiResponse createRoleMenu (@RequestHeader(Constants.HEADER_USER_TOKEN) String token, @Validated @RequestBody CreateRoleMenuDTO dto) { | 
|---|
|  |  |  | dto.setCreateUser(this.getLoginUser(token).getId()); | 
|---|
|  |  |  | systemRoleBiz.createRoleMenu(dto); | 
|---|
|  |  |  | return ApiResponse.success(null); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | @PostMapping("/createRolePermission") | 
|---|
|  |  |  | @CloudRequiredPermission("system:role:createRolePermission") | 
|---|
|  |  |  | public ApiResponse createRolePermission (@RequestHeader(Constants.HEADER_USER_TOKEN) String token,@Validated @RequestBody CreateRolePermissionDTO dto) { | 
|---|
|  |  |  | dto.setCreateUser(this.getLoginUser(token).getId()); | 
|---|
|  |  |  | systemRoleBiz.createRolePermission(dto); | 
|---|
|  |  |  | return ApiResponse.success(null); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @PreventRepeat | 
|---|
|  |  |  | @ApiOperation("配置角色数据权限") | 
|---|
|  |  |  | @PostMapping("/createRoleDataPermission") | 
|---|
|  |  |  | @CloudRequiredPermission("system:datapermission:create") | 
|---|
|  |  |  | public ApiResponse createRoleDataPermission (@RequestHeader(Constants.HEADER_USER_TOKEN) String token,@Validated @RequestBody SystemDataPermission dto) { | 
|---|
|  |  |  | dto.setLoginUserInfo(this.getLoginUser(token)); | 
|---|
|  |  |  | systemRoleBiz.createRoleDataPermission(dto); | 
|---|
|  |  |  | return ApiResponse.success(null); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | @PostMapping("/create") | 
|---|
|  |  |  | @CloudRequiredPermission("system:role:create") | 
|---|
|  |  |  | public ApiResponse create(@RequestHeader(Constants.HEADER_USER_TOKEN) String token,@Validated(OperaType.Create.class) @RequestBody SystemRole systemRole) { | 
|---|
|  |  |  | systemRole.setCreateUser(this.getLoginUser(token).getId()); | 
|---|
|  |  |  | return ApiResponse.success(systemRoleBiz.create(systemRole)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | @PostMapping("/updateById") | 
|---|
|  |  |  | @CloudRequiredPermission("system:role:update") | 
|---|
|  |  |  | public ApiResponse updateById(@RequestHeader(Constants.HEADER_USER_TOKEN) String token,@Validated(OperaType.Update.class) @RequestBody SystemRole systemRole) { | 
|---|
|  |  |  | systemRole.setUpdateUser(this.getLoginUser(token).getId()); | 
|---|
|  |  |  | systemRoleBiz.updateById(systemRole); | 
|---|
|  |  |  | return ApiResponse.success(null); | 
|---|
|  |  |  | } | 
|---|