| | |
| | | |
| | | @PostMapping("/add") |
| | | public ResponseVO<Object> addGroup(@RequestBody @Validated PoleGroupParam param) { |
| | | if (!permissionConfig.check(MenuEnum.GROUP_ADD.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | return ResponseUtil.success(poleGroupService.addGroup(param)); |
| | | } |
| | | |
| | | @PostMapping("/update/{groupId}") |
| | | public ResponseVO<Object> updateGroup(@PathVariable Long groupId, @RequestBody @Validated PoleGroupParam param) { |
| | | if (!permissionConfig.check(MenuEnum.GROUP_UPDATE.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | return ResponseUtil.success(poleGroupService.updateGroup(groupId, param)); |
| | | } |
| | | |
| | | @PostMapping("/delete/{groupId}") |
| | | public ResponseVO<Object> delGroup(@PathVariable Long groupId) { |
| | | if (!permissionConfig.check(MenuEnum.GROUP_DELETE.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | return ResponseUtil.success(poleGroupService.deleteGroup(groupId)); |
| | | } |
| | | |
| | |
| | | |
| | | @PostMapping("/bind/{groupId}") |
| | | public ResponseVO<Object> bindPole(@PathVariable Long groupId, @RequestBody PoleGroupRelationParam param) { |
| | | if (!permissionConfig.check(MenuEnum.GROUP_BINDING_POLE.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | return ResponseUtil.success(poleGroupService.bindPole(groupId, param.getPoleIdList())); |
| | | } |
| | | } |