开发tcpdump策略表CRUD

This commit is contained in:
gaoyutao
2026-01-21 18:15:30 +08:00
parent b384aa8db5
commit fe0225012f
@@ -1,6 +1,8 @@
package com.tongran.rocketmq.handler;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.tongran.common.core.constant.SecurityConstants;
import com.tongran.common.core.domain.R;
import com.tongran.common.core.enums.MsgEnum;
@@ -1898,11 +1900,11 @@ public class MessageHandler {
if (entity != null) {
String jsonResponse = EntityUtils.toString(entity, "UTF-8");
// 使用Map直接解析JSON
Map<String, Object> resultMap = JsonDataParser.parseJsonData(jsonResponse, Map.class);
if (resultMap != null) {
return extractLocationInfo(resultMap);
}
// 使用Jackson解析JSON
ObjectMapper mapper = new ObjectMapper();
Map<String, Object> resultMap = mapper.readValue(jsonResponse, new TypeReference<Map<String, Object>>() {});
return extractLocationInfo(resultMap);
}
} else {
System.err.println("获取IP归属地信息失败,HTTP状态码: " + response.getStatusLine().getStatusCode());