|
@@ -132,25 +132,25 @@ public class PlanNewCommonOutController {
|
|
|
List<Material> materialList = tuple.getT4();
|
|
List<Material> materialList = tuple.getT4();
|
|
|
if (!materialList.isEmpty()) {
|
|
if (!materialList.isEmpty()) {
|
|
|
Material material = materialList.get(RandomUtil.randomInt(0, materialList.size()));
|
|
Material material = materialList.get(RandomUtil.randomInt(0, materialList.size()));
|
|
|
- String clientIP = exchange.getRequest().getHeaders().getFirst("X-Forwarded-For");
|
|
|
|
|
- if ((clientIP == null || clientIP.isEmpty()) && Objects.nonNull(exchange.getRequest().getRemoteAddress())) {
|
|
|
|
|
- clientIP = exchange.getRequest().getRemoteAddress().getAddress().getHostAddress();
|
|
|
|
|
- }
|
|
|
|
|
String content = material.content();
|
|
String content = material.content();
|
|
|
- if (StrUtil.isNotBlank(clientIP)) {
|
|
|
|
|
- JSONObject ipInfo = ipAnalyzeServiceInterface.getIpInfo(clientIP);
|
|
|
|
|
- if (null != ipInfo) {
|
|
|
|
|
- String city = ipInfo.getStr("city");
|
|
|
|
|
- if (StrUtil.isNotBlank(city)) {
|
|
|
|
|
- content = city + content;
|
|
|
|
|
- } else {
|
|
|
|
|
- String province = ipInfo.getStr("region");
|
|
|
|
|
- if (StrUtil.isNotBlank(province)) {
|
|
|
|
|
- content = province + content;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+// String clientIP = exchange.getRequest().getHeaders().getFirst("X-Forwarded-For");
|
|
|
|
|
+// if ((clientIP == null || clientIP.isEmpty()) && Objects.nonNull(exchange.getRequest().getRemoteAddress())) {
|
|
|
|
|
+// clientIP = exchange.getRequest().getRemoteAddress().getAddress().getHostAddress();
|
|
|
|
|
+// }
|
|
|
|
|
+// if (StrUtil.isNotBlank(clientIP)) {
|
|
|
|
|
+// JSONObject ipInfo = ipAnalyzeServiceInterface.getIpInfo(clientIP);
|
|
|
|
|
+// if (null != ipInfo) {
|
|
|
|
|
+// String city = ipInfo.getStr("city");
|
|
|
|
|
+// if (StrUtil.isNotBlank(city)) {
|
|
|
|
|
+// content = city + content;
|
|
|
|
|
+// } else {
|
|
|
|
|
+// String province = ipInfo.getStr("region");
|
|
|
|
|
+// if (StrUtil.isNotBlank(province)) {
|
|
|
|
|
+// content = province + content;
|
|
|
|
|
+// }
|
|
|
|
|
+// }
|
|
|
|
|
+// }
|
|
|
|
|
+// }
|
|
|
h5ImageAndText.setName(content);
|
|
h5ImageAndText.setName(content);
|
|
|
h5ImageAndText.setRemark(material.remark());
|
|
h5ImageAndText.setRemark(material.remark());
|
|
|
}
|
|
}
|