| | |
| | | */ |
| | | @ApiOperation(value = "新增设备档案") |
| | | @PostMapping("/addDocument") |
| | | public Result addDocument(DeviceDocuments document) { |
| | | public Result addDocument(@RequestBody DeviceDocuments document) { |
| | | if (document.getDeviceId() == null) { |
| | | throw new RuntimeException("设备id为空"); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "查询设备档案信息") |
| | | @GetMapping("/id") |
| | | @GetMapping("/getDocumentById") |
| | | public Result getDocumentById(Integer id) { |
| | | return Result.success(deviceDocumentsService.getById(id)); |
| | | } |
| | |
| | | |
| | | /** |
| | | * 查询设备档案列表 |
| | | * @param id |
| | | * @param deviceId |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "查询设备档案列表") |
| | | @GetMapping("/getAllDocuments") |
| | | public Result getAllDocuments(Integer id) { |
| | | public Result getAllDocuments(Integer deviceId) { |
| | | LambdaQueryWrapper<DeviceDocuments> lambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | lambdaQueryWrapper.eq(DeviceDocuments::getDeviceId, id); |
| | | lambdaQueryWrapper.eq(DeviceDocuments::getDeviceId, deviceId); |
| | | return Result.success(deviceDocumentsService.list(lambdaQueryWrapper)); |
| | | } |
| | | |