| | |
| | | @Autowired |
| | | private RoleService roleService; |
| | | |
| | | @PreAuthorize("hasAuthority('sys:role:list')") |
| | | @PreAuthorize("hasAuthority('system:role:list')") |
| | | @PostMapping("/role/page") |
| | | public R page(@RequestBody Map<String, Object> map) { |
| | | BaseParam baseParam = buildParam(map, BaseParam.class); |
| | |
| | | return R.ok().add(roleService.page(pageParam, pageParam.buildWrapper(true))); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('sys:role:list')") |
| | | @PreAuthorize("hasAuthority('system:role:list')") |
| | | @PostMapping("/role/list") |
| | | public R list(@RequestBody Map<String, Object> map) { |
| | | return R.ok().add(roleService.list()); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('sys:role:list')") |
| | | @PreAuthorize("hasAuthority('system:role:list')") |
| | | @GetMapping("/role/{id}") |
| | | public R get(@PathVariable("id") Long id) { |
| | | return R.ok().add(roleService.getById(id)); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('sys:role:save')") |
| | | @PreAuthorize("hasAuthority('system:role:save')") |
| | | @OperationLog("添加角色") |
| | | @PostMapping("/role/save") |
| | | public R save(@RequestBody Role role) { |
| | |
| | | return R.ok("添加成功"); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('sys:role:update')") |
| | | @PreAuthorize("hasAuthority('system:role:update')") |
| | | @OperationLog("修改角色") |
| | | @PostMapping("/role/update") |
| | | public R update(@RequestBody Role role) { |
| | |
| | | return R.ok("修改成功"); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('sys:role:remove')") |
| | | @PreAuthorize("hasAuthority('system:role:remove')") |
| | | @OperationLog("删除角色") |
| | | @PostMapping("/role/remove/{ids}") |
| | | public R remove(@PathVariable Long[] ids) { |
| | |
| | | return R.ok("删除成功"); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('sys:role:list')") |
| | | @PreAuthorize("hasAuthority('system:role:list')") |
| | | @PostMapping("/role/query") |
| | | public R query(@RequestParam(required = false) String condition) { |
| | | List<KeyValVo> vos = new ArrayList<>(); |
| | |
| | | return R.ok().add(vos); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('sys:role:list')") |
| | | @PreAuthorize("hasAuthority('system:role:list')") |
| | | @PostMapping("/role/export") |
| | | public void export(@RequestBody Map<String, Object> map, HttpServletResponse response) throws Exception { |
| | | ExcelUtil.build(ExcelUtil.create(roleService.list(), Role.class), response); |