| | |
| | | import org.springblade.modules.system.entity.User; |
| | | import org.springblade.modules.system.service.IRoleService; |
| | | import org.springblade.modules.system.vo.GrantVO; |
| | | import org.springblade.modules.system.vo.RoleParam; |
| | | import org.springblade.modules.system.vo.RoleVO; |
| | | import org.springblade.modules.system.wrapper.RoleWrapper; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | @AllArgsConstructor |
| | | @RequestMapping(AppConstant.APPLICATION_SYSTEM_NAME + "/role") |
| | | @Api(value = "角色", tags = "角色") |
| | | @PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | //@PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | public class RoleController extends BladeController { |
| | | |
| | | private final IRoleService roleService; |
| | |
| | | return R.data(list); |
| | | } |
| | | |
| | | /** |
| | | * 获取角色列表 |
| | | */ |
| | | @GetMapping("/getRoleListByIds") |
| | | @ApiOperation(value = "获取角色列表", notes = "传入id集合") |
| | | public R<List<Role>> getRoleListByIds(String roleIds) { |
| | | |
| | | List<Role> list = roleService.getRoleListByIds(roleIds); |
| | | return R.data(list); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 自定义列表(只获取当前角色下级角色) |
| | | * @param roleParam |
| | | * @return |
| | | */ |
| | | @GetMapping("/getRoleList") |
| | | public R<List<RoleVO>> getRoleList(RoleParam roleParam) { |
| | | List<Role> list = roleService.getRoleList(roleParam); |
| | | return R.data(RoleWrapper.build().listNodeVO(list)); |
| | | } |
| | | |
| | | |
| | | } |