| | |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.pojo.PermitGroup; |
| | | import com.whyc.pojo.PermitGroupUser; |
| | | import com.whyc.service.PermitGroupService; |
| | | import com.whyc.service.PermitGroupUserService; |
| | | import com.whyc.util.ActionUtil; |
| | | import io.swagger.annotations.Api; |
| | |
| | | @Autowired |
| | | private PermitGroupUserService service; |
| | | |
| | | @PutMapping("userBatch") |
| | | @Autowired |
| | | private PermitGroupService permitGroupService; |
| | | |
| | | @PostMapping("userBatch") |
| | | @ApiOperation(value = "添加|移除用户",notes = "operationFlag为1,添加;-1,移除") |
| | | public Response updateUser(@RequestBody List<PermitGroupUser> groupUserList,@RequestParam int operationFlag){ |
| | | service.updateBatch(groupUserList,operationFlag); |
| | | if(operationFlag==1) { |
| | | return new Response().setII(1, "添加成功"); |
| | | }else{ |
| | | return new Response().setII(1,"移除成功"); |
| | | //验证是否存在permit_edit_permit权限 |
| | | if (!permitGroupService.checkUserPermitWithName("permit_edit_permit")) { |
| | | return new Response<Boolean>().setII(0, "当前用户无编辑权限"); |
| | | }else { |
| | | service.updateBatch(groupUserList, operationFlag); |
| | | if (operationFlag == 1) { |
| | | return new Response().setII(1, "添加成功"); |
| | | } else { |
| | | return new Response().setII(1, "移除成功"); |
| | | } |
| | | } |
| | | } |
| | | |