|
@@ -1,5 +1,6 @@
|
|
|
package com.genersoft.iot.vmp.vmanager.gb28181.aiLib;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
import com.genersoft.iot.vmp.conf.SipConfig;
|
|
|
import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
|
|
|
import com.genersoft.iot.vmp.vmanager.bean.*;
|
|
@@ -139,11 +140,17 @@ public class AiControl {
|
|
|
@PostMapping("/alarm")
|
|
|
@ResponseBody
|
|
|
public WVPResult alarm(BodyAiAlarm bodyAiAlarm){
|
|
|
+ System.out.println("Received request body: " + bodyAiAlarm);
|
|
|
+ System.out.println("Received request body: " + bodyAiAlarm.getReco_info());
|
|
|
+ logger.info("body{}",bodyAiAlarm);
|
|
|
+ logger.info("devId:{}",bodyAiAlarm.getDev_id());
|
|
|
+ logger.info("results:{}",bodyAiAlarm.getReco_info());
|
|
|
// ps upload 0-8 为兼容性集成,以防多文件上传
|
|
|
String deviceId = bodyAiAlarm.getDev_id();
|
|
|
String channelId = bodyAiAlarm.getChannelId();
|
|
|
String arithmetic = bodyAiAlarm.getType();
|
|
|
- List<AiAlarm> items = bodyAiAlarm.getReco_info().getResults();
|
|
|
+ Object recoInfo = JSON.parseObject(bodyAiAlarm.getReco_info()).get("results");
|
|
|
+ List<AiAlarm> items = new ArrayList<>();
|
|
|
String firmware_version = bodyAiAlarm.getFirmware_version();
|
|
|
String timestamp = bodyAiAlarm.getTimestamp();
|
|
|
String battery = bodyAiAlarm.getBattery();
|
|
@@ -173,7 +180,7 @@ public class AiControl {
|
|
|
if (deviceId==null||deviceId.isEmpty() || deviceId==""){
|
|
|
return WVPResult.fail(ErrorCode.ERROR400.getCode(),"没有设备id");
|
|
|
}
|
|
|
- channelId = channelId.isEmpty()?"":channelId;
|
|
|
+ channelId = (channelId==null||channelId.isEmpty())?"":channelId;
|
|
|
if(uploads.size() == 0){
|
|
|
result.setCode(ErrorCode.ERROR400.getCode());
|
|
|
result.setMsg("未接收到上传文件.待处理");
|