| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 角色-资源 |
| | | * @author WWW |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | @Api(tags = "运维管理\\角色资源") |
| | | @RestController |
| | | @RequestMapping("/roleRes") |
| | |
| | | @SysLog() |
| | | @ApiOperation(value = "分页查询并返回记录数") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "roleid", value = "角色ID", dataType = "Integer", paramType = "query", example = ""), |
| | | @ApiImplicitParam(name = "roleid", value = "角色ID", dataType = "Integer", paramType = "query", example = "1"), |
| | | @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "Integer", paramType = "query", example = "10"), |
| | | @ApiImplicitParam(name = "pageIndex", value = "分页数(从1开始)", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("每页页数或分页数小于1", null); |
| | | } |
| | | |
| | | int count = roleResService.selectCount(roleid); |
| | | if (count == 0) { |
| | | return success(0, null); |
| | |
| | | entity.setCreateUser(ue.getId()); |
| | | } |
| | | |
| | | permsService.clearPermsCache(); |
| | | int count = roleResService.insert(entity); |
| | | if (count > 0) { |
| | | permsService.clearResCache(); |
| | | } |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | |
| | | } |
| | | } |
| | | |
| | | permsService.clearPermsCache(); |
| | | int count = roleResService.inserts(list); |
| | | if (count > 0) { |
| | | permsService.clearResCache(); |
| | | } |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | |
| | | @GetMapping(value = "/delete") |
| | | public ResponseMsg<Integer> delete(int id) { |
| | | try { |
| | | permsService.clearPermsCache(); |
| | | int count = roleResService.delete(id); |
| | | if (count > 0) { |
| | | permsService.clearResCache(); |
| | | } |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | |
| | | return fail("id数组不能为空", -1); |
| | | } |
| | | |
| | | permsService.clearPermsCache(); |
| | | int count = roleResService.deletes(ids); |
| | | if (count > 0) { |
| | | permsService.clearResCache(); |
| | | } |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | |
| | | entity.setUpdateUser(ue.getId()); |
| | | } |
| | | |
| | | permsService.clearPermsCache(); |
| | | int count = roleResService.update(entity); |
| | | if (count > 0) { |
| | | permsService.clearResCache(); |
| | | } |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | |
| | | } |
| | | } |
| | | |
| | | permsService.clearPermsCache(); |
| | | int count = roleResService.updates(list); |
| | | if (count > 0) { |
| | | permsService.clearResCache(); |
| | | } |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |