| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.swing.*; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @RestController |
| | | @RequestMapping("permitGroupUser") |
| | |
| | | @Autowired |
| | | private PermitGroupUserService service; |
| | | |
| | | @PutMapping("user") |
| | | @Autowired |
| | | private PermitGroupService permitGroupService; |
| | | |
| | | @PostMapping("userBatch") |
| | | @ApiOperation(value = "添加|移除用户",notes = "operationFlag为1,添加;-1,移除") |
| | | public Response updateUser(@RequestBody PermitGroupUser groupUser,@RequestParam int operationFlag){ |
| | | service.update(groupUser,operationFlag); |
| | | if(operationFlag==1) { |
| | | return new Response().setII(1, "添加成功"); |
| | | }else{ |
| | | return new Response().setII(1,"移除成功"); |
| | | public Response updateUser(@RequestBody List<PermitGroupUser> groupUserList,@RequestParam int operationFlag){ |
| | | //验证是否存在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, "移除成功"); |
| | | } |
| | | } |
| | | } |
| | | |