|
@@ -23,7 +23,8 @@ public class SimsController {
|
|
|
@Operation(summary = "获取设备的最新的温湿度")
|
|
|
@GetMapping("/{roads}")
|
|
|
public CommonResult<SensorData> status(@PathVariable String deviceCode, @PathVariable Integer roads) {
|
|
|
- return CommonResult.data(simsService.status(deviceCode,roads));
|
|
|
+ SensorData status = simsService.status(deviceCode, roads);
|
|
|
+ return status == null ? CommonResult.data(new SensorData()) : CommonResult.data(status);
|
|
|
}
|
|
|
|
|
|
|