角色后台权限
This commit is contained in:
parent
20fcf97804
commit
a35863f6f0
@ -42,9 +42,10 @@ public class RoleController {
|
||||
@Resource
|
||||
private PermissionService permissionService;
|
||||
|
||||
//TODO 角色权限 先去掉
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建角色")
|
||||
@PreAuthorize("@ss.hasPermission('system:role:create')")
|
||||
// @PreAuthorize("@ss.hasPermission('system:role:create')")
|
||||
public CommonResult<Long> createRole(@Valid @RequestBody RoleSaveReqVO createReqVO) {
|
||||
//创建角色
|
||||
Long roleId = roleService.createRole(createReqVO, null);
|
||||
@ -55,7 +56,7 @@ public class RoleController {
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "修改角色")
|
||||
@PreAuthorize("@ss.hasPermission('system:role:update')")
|
||||
// @PreAuthorize("@ss.hasPermission('system:role:update')")
|
||||
public CommonResult<Boolean> updateRole(@Valid @RequestBody RoleSaveReqVO updateReqVO) {
|
||||
//修改角色
|
||||
roleService.updateRole(updateReqVO);
|
||||
@ -67,7 +68,7 @@ public class RoleController {
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除角色")
|
||||
@Parameter(name = "id", description = "角色编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('system:role:delete')")
|
||||
// @PreAuthorize("@ss.hasPermission('system:role:delete')")
|
||||
public CommonResult<Boolean> deleteRole(@RequestParam("id") Long id) {
|
||||
roleService.deleteRole(id);
|
||||
return success(true);
|
||||
@ -75,7 +76,7 @@ public class RoleController {
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得角色信息")
|
||||
@PreAuthorize("@ss.hasPermission('system:role:query')")
|
||||
// @PreAuthorize("@ss.hasPermission('system:role:query')")
|
||||
public CommonResult<RoleRespVO> getRole(@RequestParam("id") Long id) {
|
||||
//获取角色信息
|
||||
RoleDO role = roleService.getRole(id);
|
||||
@ -88,7 +89,7 @@ public class RoleController {
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得角色分页")
|
||||
@PreAuthorize("@ss.hasPermission('system:role:query')")
|
||||
// @PreAuthorize("@ss.hasPermission('system:role:query')")
|
||||
public CommonResult<PageResult<RoleRespVO>> getRolePage(RolePageReqVO pageReqVO) {
|
||||
PageResult<RoleDO> pageResult = roleService.getRolePage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, RoleRespVO.class));
|
||||
@ -105,7 +106,7 @@ public class RoleController {
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出角色 Excel")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
@PreAuthorize("@ss.hasPermission('system:role:export')")
|
||||
// @PreAuthorize("@ss.hasPermission('system:role:export')")
|
||||
public void export(HttpServletResponse response, @Validated RolePageReqVO exportReqVO) throws IOException {
|
||||
exportReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<RoleDO> list = roleService.getRolePage(exportReqVO).getList();
|
||||
|
Loading…
x
Reference in New Issue
Block a user