开发tcpdump策略表CRUD
This commit is contained in:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user