| | |
| | | @PostMapping("/create") |
| | | @CloudRequiredPermission("business:device:create") |
| | | public ApiResponse create(@RequestBody Device device,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ |
| | | device.setLoginUserInfo(this.getLoginUser(token)); |
| | | return ApiResponse.success(deviceService.create(device)); |
| | | } |
| | | |
| | |
| | | @GetMapping("/delete/{id}") |
| | | @CloudRequiredPermission("business:device:delete") |
| | | public ApiResponse deleteById(@PathVariable Integer id,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ |
| | | deviceService.deleteById(id); |
| | | deviceService.deleteById(id,this.getLoginUser(token)); |
| | | return ApiResponse.success(null); |
| | | } |
| | | @ApiOperation("修改是否门禁入口") |
| | |
| | | for (String id : idArray) { |
| | | idList.add(Integer.valueOf(id)); |
| | | } |
| | | deviceService.deleteByIdInBatch(idList); |
| | | deviceService.deleteByIdInBatch(idList,this.getLoginUser(token)); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | |
| | | @PostMapping("/updateById") |
| | | @CloudRequiredPermission("business:device:update") |
| | | public ApiResponse updateById(@RequestBody Device device,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ |
| | | |
| | | device.setLoginUserInfo(this.getLoginUser(token)); |
| | | deviceService.updateById(device); |
| | | return ApiResponse.success(null); |
| | | } |