角色资源接口删除3个无用的接口,解决根据角色查询报错
| | |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "查询记录数") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "roleid", value = "角色ID", dataType = "Integer", paramType = "query", required = false, example = "") |
| | | }) |
| | | @GetMapping({"/selectCount"}) |
| | | public ResponseMsg<Integer> selectCount(Integer roleid) { |
| | | try { |
| | | int count = roleResService.selectCount(roleid); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "分页查询") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "roleid", value = "角色ID", dataType = "Integer", paramType = "query", example = ""), |
| | | @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "Integer", paramType = "query", example = "10"), |
| | | @ApiImplicitParam(name = "pageIndex", value = "分页数(从1开始)", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectByPage") |
| | | public ResponseMsg<List<RoleResEntity>> selectByPage(Integer roleid, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("每页页数或分页数小于1", null); |
| | | } |
| | | |
| | | List<RoleResEntity> rs = roleResService.selectByPage(roleid, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "分页查询并返回记录数") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "roleid", value = "角色ID", dataType = "Integer", paramType = "query", example = ""), |
| | |
| | | List<RoleResEntity> rs = roleResService.selectByPage(roleid, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(count, rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "查询所有") |
| | | @GetMapping(value = "/selectAll") |
| | | public ResponseMsg<List<RoleResEntity>> selectAll() { |
| | | try { |
| | | List<RoleResEntity> list = roleResService.selectAll(); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | |
| | | <mapper namespace="com.moon.server.mapper.sys.RoleResMapper"> |
| | | <select id="selectResByRole" resultType="com.moon.server.entity.sys.RoleResEntity"> |
| | | with rs as (select id, resid from lf.sys_role_res where roleid = #{roleid}) |
| | | select (select id from rs b where b.resid = a.id) "id", a.id "resid", a.cn_name, a.en_name, a.type, a.pid, a.level, a.sort, a.tab |
| | | select (select id from rs b where b.resid = a.id) "id", a.id "resid", a.cn_name, a.en_name, a.type, a.tab |
| | | from lf.sys_res a; |
| | | </select> |
| | | |