| | |
| | | @ApiOperation(value = "分页查询") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "name", value = "名称", dataType = "String", paramType = "query", example = "sys_role"), |
| | | @ApiImplicitParam(name = "depName", value = "名称", dataType = "String", paramType = "query", example = "sys_role"), |
| | | @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<RoleEntity>> selectByPage(String name, Integer pageSize, Integer pageIndex) { |
| | | public ResponseMsg<List<RoleEntity>> selectByPage(String name,String depName, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("每页页数或分页数小于1", null); |
| | | } |
| | | List<RoleEntity> rs = roleService.selectByPage(name, pageSize, pageSize * (pageIndex - 1)); |
| | | List<RoleEntity> rs = roleService.selectByPage(name,depName, pageSize, pageSize * (pageIndex - 1)); |
| | | return success(rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | |
| | | @ApiOperation(value = "分页查询并返回记录数") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "name", value = "名称", dataType = "String", paramType = "query", example = "1"), |
| | | @ApiImplicitParam(name = "depName", value = "名称", dataType = "String", paramType = "query", example = "sys_role"), |
| | | @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "Integer", paramType = "query", example = "10"), |
| | | @ApiImplicitParam(name = "pageIndex", value = "分页数(从1开始)", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectByPageAndCount") |
| | | public ResponseMsg<List<RoleEntity>> selectByPageAndCount(String name, Integer pageSize, Integer pageIndex) { |
| | | public ResponseMsg<List<RoleEntity>> selectByPageAndCount(String name,String depName, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("每页页数或分页数小于1", null); |
| | |
| | | return success(0, null); |
| | | } |
| | | |
| | | List<RoleEntity> rs = roleService.selectByPage(name, pageSize, pageSize * (pageIndex - 1)); |
| | | List<RoleEntity> rs = roleService.selectByPage(name,depName, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(count, rs); |
| | | } catch (Exception ex) { |
| | |
| | | @ApiImplicitParam(name = "roleEntity", value = "字典实体类", dataType = "com.lf.server.entity.data.RoleEntity", paramType = "body", example = "") |
| | | }) |
| | | @PostMapping(value = "/insertRole", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> insertRole(RoleEntity roleEntity) { |
| | | public ResponseMsg<Integer> insertRole(@RequestBody RoleEntity roleEntity) { |
| | | try { |
| | | int count = roleService.insertRole(roleEntity); |
| | | |
| | |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/updateRole", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> updateRole(RoleEntity roleEntity) { |
| | | public ResponseMsg<Integer> updateRole(@RequestBody RoleEntity roleEntity) { |
| | | try { |
| | | int count = roleService.updateRole(roleEntity); |
| | | |