Browse Source

印尼项目-红外数据获取及规则设置 修改返回值

master
王寅 8 months ago
parent
commit
01f9817b28
1 changed files with 10 additions and 14 deletions
  1. +10
    -14
      inspect-ivs/src/main/java/com/inspect/ivs/controller/IvsDeviceController.java

+ 10
- 14
inspect-ivs/src/main/java/com/inspect/ivs/controller/IvsDeviceController.java View File

@ -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<Map<String, Object>> 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"})


Loading…
Cancel
Save