| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | *角色表 |
| | | * @author SWS |
| | | * @date 2022-09.28 |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | @Api(tags = "运维管理\\角色管理") |
| | | @RestController |
| | | @RequestMapping("/role") |
| | |
| | | @SysLog() |
| | | @ApiOperation(value = "插入一条") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "实体类", dataType = "com.lf.server.entity.sys.RoleEntity", paramType = "body", example = "") |
| | | @ApiImplicitParam(name = "entity", value = "实体类", dataType = "RoleEntity", paramType = "body", example = "") |
| | | }) |
| | | @PostMapping(value = "/insertRole", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> insertRole(@RequestBody RoleEntity entity, HttpServletRequest req) { |
| | |
| | | entity.setCreateUser(ue.getId()); |
| | | } |
| | | |
| | | permsService.clearPermsCache(); |
| | | int count = roleService.insertRole(entity); |
| | | if (count > 0) { |
| | | permsService.clearPermsCache(); |
| | | } |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | |
| | | } |
| | | } |
| | | |
| | | permsService.clearPermsCache(); |
| | | int count = roleService.insertRoles(list); |
| | | if (count > 0) { |
| | | permsService.clearPermsCache(); |
| | | } |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | |
| | | @GetMapping(value = "/deleteRole") |
| | | public ResponseMsg<Integer> deleteRole(int id) { |
| | | try { |
| | | permsService.clearPermsCache(); |
| | | int count = roleService.deleteRole(id); |
| | | if (count > 0) { |
| | | permsService.clearPermsCache(); |
| | | } |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | |
| | | return fail("id数组不能为空", -1); |
| | | } |
| | | |
| | | permsService.clearPermsCache(); |
| | | int count = roleService.deleteRoles(ids); |
| | | if (count > 0) { |
| | | permsService.clearPermsCache(); |
| | | } |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | |
| | | entity.setUpdateUser(ue.getId()); |
| | | } |
| | | |
| | | permsService.clearPermsCache(); |
| | | int count = roleService.updateRole(entity); |
| | | if (count > 0) { |
| | | permsService.clearPermsCache(); |
| | | } |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |