墒情数据接口

This commit is contained in:
zhumeixiao
2024-11-21 10:11:21 +08:00
parent 393c942da2
commit db13870ffe
3 changed files with 16 additions and 5 deletions

View File

@ -1,9 +1,13 @@
package com.fastbee.data.controller.aaScreenAgricultural;
import com.fastbee.common.core.domain.AjaxResult;
import com.fastbee.deviceData.domain.DeviceRealtimedataMoisture;
import com.fastbee.deviceData.service.impl.DeviceRealtimedataMoistureServiceImpl;
import com.fastbee.deviceInfo.service.impl.DeviceInformationMoistureServiceImpl;
import io.lettuce.core.dynamic.annotation.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@ -12,13 +16,19 @@ import org.springframework.web.bind.annotation.RestController;
public class DeviceRealtimedataMoistureController {
@Autowired
private DeviceRealtimedataMoistureServiceImpl deviceRealtimedataMoistureServiceImpl;
@Autowired
private DeviceInformationMoistureServiceImpl deviceInformationMoistureServiceImpl;
/**
* 获取最新一条墒情数据
* @return
*/
@GetMapping("/weather/realtimedata")
public AjaxResult getLatestWeatherRealtimedata() {
return AjaxResult.success(deviceRealtimedataMoistureServiceImpl.getLatestWeatherRealtimedata());
public AjaxResult getLatestWeatherRealtimedata( String deviceId) {
return AjaxResult.success(deviceRealtimedataMoistureServiceImpl.getLatestWeatherRealtimedata(deviceId));
}
@GetMapping("/weather/pullDown")
public AjaxResult getLatestWeatherPullDown() {
return AjaxResult.success(deviceInformationMoistureServiceImpl.selectDeviceInformationMoistureList(null));
}
}