| | |
| | | import io.swagger.v3.oas.annotations.Parameter; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.util.*; |
| | | import java.io.IOException; |
| | | |
| | |
| | | return success(BeanUtils.toBean(device, DeviceRespVO.class)); |
| | | } |
| | | |
| | | @GetMapping("/get-by-dev-id") |
| | | @Operation(summary = "获得设备") |
| | | @Parameter(name = "devId", description = "编号", required = true, example = "1024") |
| | | @PreAuthorize("@ss.hasPermission('ecg:doctor:task')") |
| | | public CommonResult<DeviceRespVO> getDevice(@RequestParam("dev-id") String devId) { |
| | | DeviceDO device = deviceService.getDevice(devId); |
| | | return success(BeanUtils.toBean(device, DeviceRespVO.class)); |
| | | } |
| | | |
| | | @PostMapping("/update-dev-state") |
| | | @Operation(summary = "更新设备状态") |
| | | @Parameter(name = "devId", description = "编号", required = true, example = "1024") |
| | | @PreAuthorize("@ss.hasPermission('ecg:doctor:task')") |
| | | public CommonResult<Integer> updateDeviceState(@Valid @RequestBody DeviceSaveReqVO updateReqVO) { |
| | | updateReqVO.setStateDate( LocalDate.now() ); |
| | | Integer ret = deviceService.updateDeviceState(updateReqVO); |
| | | return success(ret); |
| | | } |
| | | |
| | | @GetMapping("/page") |
| | | @Operation(summary = "获得设备分页") |
| | | @PreAuthorize("@ss.hasPermission('ecg:device:query')") |