|
@@ -1,8 +1,12 @@
|
|
|
package com.huimv.receiver.eco.controller;
|
|
|
|
|
|
+import com.huimv.receiver.cloud.service.IWarningInfo;
|
|
|
+import com.huimv.receiver.eco.entity.HumAndTemDto;
|
|
|
import com.huimv.receiver.eco.service.ISysHumidityService;
|
|
|
+import com.huimv.receiver.eco.service.ISysTemperatureService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
@@ -14,10 +18,32 @@ public class EcoController {
|
|
|
@Autowired
|
|
|
private ISysHumidityService sysHumidityService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ISysTemperatureService sysTemperatureService;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
@PostMapping(value = "/save")
|
|
|
- public void save(){
|
|
|
-// sysHumidityService.saveHumAndTem();
|
|
|
+ public String save(@RequestBody HumAndTemDto humAndTemDto){
|
|
|
+ System.out.println("开始");
|
|
|
+ try {
|
|
|
+ sysHumidityService.save(humAndTemDto.getHumidity());
|
|
|
+ }catch (Exception e){
|
|
|
+ System.out.println("湿度存储失败");
|
|
|
+ }
|
|
|
+
|
|
|
+ try {
|
|
|
+ sysTemperatureService.save(humAndTemDto.getTemperature());
|
|
|
+ }catch (Exception e){
|
|
|
+ System.out.println("温度存储失败");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ System.out.println("结束");
|
|
|
+ return "成功";
|
|
|
}
|
|
|
|
|
|
}
|