Browse Source

心跳接口修改

gao.qiang 9 months ago
parent
commit
f279c6387a

+ 5 - 0
vehicle-sdk/src/main/java/com/ozs/controller/upload/GeoHazardMonitorTokenController.java

@@ -113,6 +113,7 @@ import java.util.stream.Collectors;
 public class GeoHazardMonitorTokenController {
     public static final String PATTERN = "^([0-9]+),([0-9]+),([0-9]+),([0-9]+),([0-9]+),([0-9]+)$";
     public static final String PATTERNS = "^[0-9]*$";
+    public static final String REGEX = "^\\d{13}$";
 
     public static final String KEY = "58792429c08c43e9";
     @Resource
@@ -1730,6 +1731,10 @@ public class GeoHazardMonitorTokenController {
                 AjaxResults1 = new AjaxResults(0, "预警时间不难为空");
                 return SM4Utils.encryptData_ECB(JSONObject.toJSONString(AjaxResults1), key);
             }
+            if (!preAlarmResponse.getPreAlarmTime().toString().matches(REGEX)) {
+                AjaxResults1 = new AjaxResults(0, "预警时间参数不对,正确格式为:单位毫秒(13位)");
+                return SM4Utils.encryptData_ECB(JSONObject.toJSONString(AjaxResults1), key);
+            }
             if (ObjectUtils.isEmpty(preAlarmResponse.getPreAlarmList())) {
                 AjaxResults1 = new AjaxResults(0, "预警目标集合不难为空");
                 return SM4Utils.encryptData_ECB(JSONObject.toJSONString(AjaxResults1), key);