开发tcpdump策略表CRUD
This commit is contained in:
@@ -1,6 +1,8 @@
|
|||||||
package com.tongran.rocketmq.handler;
|
package com.tongran.rocketmq.handler;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
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.constant.SecurityConstants;
|
||||||
import com.tongran.common.core.domain.R;
|
import com.tongran.common.core.domain.R;
|
||||||
import com.tongran.common.core.enums.MsgEnum;
|
import com.tongran.common.core.enums.MsgEnum;
|
||||||
@@ -1898,11 +1900,11 @@ public class MessageHandler {
|
|||||||
if (entity != null) {
|
if (entity != null) {
|
||||||
String jsonResponse = EntityUtils.toString(entity, "UTF-8");
|
String jsonResponse = EntityUtils.toString(entity, "UTF-8");
|
||||||
|
|
||||||
// 使用Map直接解析JSON
|
// 使用Jackson解析JSON
|
||||||
Map<String, Object> resultMap = JsonDataParser.parseJsonData(jsonResponse, Map.class);
|
ObjectMapper mapper = new ObjectMapper();
|
||||||
if (resultMap != null) {
|
Map<String, Object> resultMap = mapper.readValue(jsonResponse, new TypeReference<Map<String, Object>>() {});
|
||||||
return extractLocationInfo(resultMap);
|
|
||||||
}
|
return extractLocationInfo(resultMap);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
System.err.println("获取IP归属地信息失败,HTTP状态码: " + response.getStatusLine().getStatusCode());
|
System.err.println("获取IP归属地信息失败,HTTP状态码: " + response.getStatusLine().getStatusCode());
|
||||||
|
|||||||
Reference in New Issue
Block a user