|
@@ -3,11 +3,6 @@ package com.persagy.apm.diagnose.utils;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.persagy.apm.diagnose.feign.AlarmResult;
|
|
|
-import com.persagy.apm.diagnose.service.dto.CalculateMethodDTO;
|
|
|
-import com.persagy.apm.diagnose.service.dto.MonitorIndicatorConfigDTO;
|
|
|
-import com.persagy.apm.energyalarmstarter.alarmdata.feign.DmpResult;
|
|
|
-import com.persagy.common.utils.StringUtil;
|
|
|
-
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
|
|
@@ -25,7 +20,11 @@ public class AlarmResultUtil {
|
|
|
if (content == null || content.isEmpty()) {
|
|
|
return new ArrayList<T>();
|
|
|
}
|
|
|
- JSONArray records = (JSONArray) content.getOrDefault("records", new JSONArray());
|
|
|
+// JSONArray records = (JSONArray) content.getOrDefault("records", new JSONArray());
|
|
|
+ JSONArray records = content.getJSONArray("records");
|
|
|
+ if (records == null || records.isEmpty()) {
|
|
|
+ return new ArrayList<T>();
|
|
|
+ }
|
|
|
return records.toJavaList(clazz);
|
|
|
}
|
|
|
}
|