Browse Source

feat: 设备上传回复优化
1. 优化了ai图片上传接口的错误回复内容, 更好的在设备log内查看失败原因

kindring 1 year ago
parent
commit
97f29057fd

+ 3 - 3
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/aiLib/AiControl.java

@@ -158,8 +158,8 @@ public class AiControl {
         // 解析ai识别结果
         Ai_parse ai_parse = getAiInfo(bodyAiAlarm);
         if (ai_parse == null) {
-            logger.error("[ai Parse] 无法解析 ai 信息");
-            return WVPResult.fail(ErrorCode.ERROR400.getCode(), ErrorCode.ERROR400.getMsg());
+            logger.error("[ai Parse] not ai info");
+            return WVPResult.fail(ErrorCode.ERROR400.getCode(), "UPLOAD_FAIL: No AI recognition items");
         }
 //        判断是否存在失败到的数据
         if (bodyAiAlarm.getReco_info().contains("failed")) {
@@ -199,7 +199,7 @@ public class AiControl {
         }
         if (deviceId == null || deviceId.isEmpty() || deviceId == "") {
             logger.warn("没有设备id");
-            return WVPResult.fail(ErrorCode.ERROR400.getCode(), "没有设备id");
+            return WVPResult.fail(ErrorCode.ERROR400.getCode(), "UPLOAD_FAIL: not set device Id");
         }
         channelId = (channelId==null||channelId.isEmpty())?"":channelId;
         if(uploads.size() == 0){