fix(X-Pack): 定时报告查询组件没有作用于导出的图表数据

This commit is contained in:
fit2cloud-chenyw
2025-04-01 17:35:27 +08:00
committed by fit2cloud-chenyw
parent 0a0074fee0
commit c95162617a
3 changed files with 41 additions and 9 deletions

View File

@@ -14,6 +14,7 @@ import java.util.List;
public class JsonUtil {
private static final ObjectMapper objectMapper;
static {
objectMapper = new ObjectMapper();
// 配置更大的 StreamReadConstraints 限制
@@ -47,6 +48,17 @@ public class JsonUtil {
return t;
}
public static <T> T parseObject(String json, TypeReference<T> typeReference) {
if (json == null) return null;
T t = null;
try {
t = objectMapper.readValue(json, typeReference);
} catch (JsonProcessingException e) {
LogUtil.error(e.getMessage(), e);
}
return t;
}
public static <T> List<T> parseList(String json, TypeReference<List<T>> classOfT) {
if (ObjectUtils.isEmpty(json)) return Collections.emptyList();
List<T> t = null;