From 01f9817b2817b88c2bcce45126205fb9e0f8639a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=AF=85?= <97163845@qq.com> Date: Fri, 18 Apr 2025 10:34:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=B0=E5=B0=BC=E9=A1=B9=E7=9B=AE-=E7=BA=A2?= =?UTF-8?q?=E5=A4=96=E6=95=B0=E6=8D=AE=E8=8E=B7=E5=8F=96=E5=8F=8A=E8=A7=84?= =?UTF-8?q?=E5=88=99=E8=AE=BE=E7=BD=AE=20=E4=BF=AE=E6=94=B9=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ivs/controller/IvsDeviceController.java | 24 ++++++++----------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/inspect-ivs/src/main/java/com/inspect/ivs/controller/IvsDeviceController.java b/inspect-ivs/src/main/java/com/inspect/ivs/controller/IvsDeviceController.java index 10aa8c9..394703d 100644 --- a/inspect-ivs/src/main/java/com/inspect/ivs/controller/IvsDeviceController.java +++ b/inspect-ivs/src/main/java/com/inspect/ivs/controller/IvsDeviceController.java @@ -55,7 +55,7 @@ public class IvsDeviceController { * 设置红外规则 */ @PostMapping("/setHwConfig") - public String setHwConfig(@RequestBody TempConfiguration tempConfiguration) throws Exception { + public Response setHwConfig(@RequestBody TempConfiguration tempConfiguration) throws Exception { JSONObject json = new JSONObject(); JSONObject configItem = new JSONObject(); List> alarmSettingListEx = new ArrayList<>(); @@ -120,13 +120,12 @@ public class IvsDeviceController { System.out.println(json); String message = JSON.toJSONString(json); String resp = ivsCommonService.sendSSLPostString(address+"/device/setdeviceconfig", message); - return "0"; -// JSONObject jsonObject = JSON.parseObject(resp); -// String resultCode = jsonObject.getString("resultCode"); -// if(resultCode.equals("0")){ -// return Response.ok(); -// } -// return Response.fail(); + JSONObject jsonObject = JSON.parseObject(resp); + String resultCode = jsonObject.getString("resultCode"); + if(resultCode.equals("0")){ + return Response.ok(); + } + return Response.fail(); } @@ -137,20 +136,17 @@ public class IvsDeviceController { * @throws Exception */ @PostMapping("/temper") - public Response temper(@RequestBody Temp temp){ + public String temper(@RequestBody Temp temp){ String cameraCode = temp.getCameraCode(); //cameraCode摄像机编码 int presetId = temp.getPresetId(); //预设位ID - int ruleId = temp.getRuleId(); //规则ID 暂时写死取12就行 + int ruleId = 12; //规则ID 暂时写死取12就行 // int meterType = temp.getMeterType(); String requestMsg = "presetId=" + presetId+ "&" + "ruleId=" + ruleId + "&" + "meterType=" + 3; //发送请求 String resp = ivsCommonService.sendsslGetCookie(address+"/device/radiometry-temper/"+cameraCode, requestMsg, "UTF-8"); JSONObject jsonObject = JSON.parseObject(resp); String resultCode = jsonObject.getString("resultCode"); - if(resultCode.equals("0")){ - return Response.ok(); - } - return Response.fail(); + return "0"; } @GetMapping({"channelsnap"})