From 87ce3b2705c814523a199572c77402b96801e794 Mon Sep 17 00:00:00 2001 From: whycxzp <glperry@163.com> Date: 星期日, 30 三月 2025 15:47:11 +0800 Subject: [PATCH] 灭火机器人相关接口 --- src/main/java/com/whyc/service/FireRobotService.java | 34 ++++++++++++++++++++++++++++++++++ 1 files changed, 34 insertions(+), 0 deletions(-) diff --git a/src/main/java/com/whyc/service/FireRobotService.java b/src/main/java/com/whyc/service/FireRobotService.java index db2aca4..2e8b7d2 100644 --- a/src/main/java/com/whyc/service/FireRobotService.java +++ b/src/main/java/com/whyc/service/FireRobotService.java @@ -1,6 +1,7 @@ package com.whyc.service; import com.github.pagehelper.PageInfo; +import com.whyc.dto.EnvironmentThreshold; import com.whyc.dto.InspectionRecord; import com.whyc.dto.Response; import com.whyc.util.HttpUtil; @@ -58,6 +59,39 @@ return response; } + + public Response setInspectionInterval(float hour) { + String httpUrl = "http://192.168.10.45:8085"+"/InspectionIntervals?hour="+2; + Response response = HttpUtil.doPost(httpUrl, (String) null); + //瀵圭粨鏋滆繘琛屽鐞� + if(response.getCode() == 1){ //璇锋眰鎴愬姛,data鏈夋甯告暟鎹� + String dataStr = (String) response.getData(); + //宸℃闂撮殧宸茶缃�: 2.0 h/娆� + response.setMsg(dataStr); + response.setData(null); + } + return response; + } + + public Response setEnvironmentThreshold(EnvironmentThreshold threshold) { + String httpUrl = "http://192.168.10.45:8085"+"/EnvironmentThrSet?tempThold="+threshold.getTempThold()+"&humidityThold="+threshold.getHumidityThold()+"&COTthold="+threshold.getCOTthold()+"&CO2Thold="+threshold.getCO2Thold()+"&CH4Thold="+threshold.getCH4Thold()+"&H2Thold="+threshold.getH2Thold()+"&SmokeThold="+threshold.getSmokeThold(); + Response response = HttpUtil.doPost(httpUrl, (String) null); + //瀵圭粨鏋滆繘琛屽鐞� + if(response.getCode() == 1){ //璇锋眰鎴愬姛,data鏈夋甯告暟鎹� + String dataStr = (String) response.getData(); + //鐜闃堝�间慨鏀规垚鍔燂紝娓╁害闃堝�硷細60.0銆佹箍搴﹂槇鍊硷細60.0銆丆O锛�100.0銆丆O2锛�1500銆丆H4锛�100.0銆丠2锛�100.0銆佺儫鎰燂細100.0 + response.setMsg(dataStr); + response.setData(null); + } + return response; + } + + + public Response getEnvironmentThreshold() { + //TODO 鐜璇诲彇鎺ュ彛 + return null; + } + public Response<PageInfo<InspectionRecord>> getPageOfInspectionRecord(int pageNum, int pageSize, String startDateStr, String endDateStr) { List<InspectionRecord> recordList = new LinkedList<>(); //鏌ヨ鍥哄畾浣嶇疆鐨勬枃浠舵暟 -- Gitblit v1.9.1