| | |
| | | @Log(title = "角色管理", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public R<Void> add(@Validated @RequestBody SysRoleBo role) { |
| | | roleService.checkRoleAllowed(role); |
| | | if (!roleService.checkRoleNameUnique(role)) { |
| | | return R.fail("新增角色'" + role.getRoleName() + "'失败,角色名称已存在"); |
| | | } else if (!roleService.checkRoleKeyUnique(role)) { |
| | |
| | | |
| | | /** |
| | | * 获取角色选择框列表 |
| | | * |
| | | * @param roleIds 角色ID串 |
| | | */ |
| | | @SaCheckPermission("system:role:query") |
| | | @GetMapping("/optionselect") |
| | | public R<List<SysRoleVo>> optionselect() { |
| | | return R.ok(roleService.selectRoleAll()); |
| | | public R<List<SysRoleVo>> optionselect(@RequestParam(required = false) Long[] roleIds) { |
| | | return R.ok(roleService.selectRoleByIds(roleIds == null ? null : List.of(roleIds))); |
| | | } |
| | | |
| | | /** |