Pārlūkot izejas kodu

mongodb访问方式变更

tags/v1.0.0^2
林万龙 pirms 3 gadiem
vecāks
revīzija
e8201b6c18
1 mainītis faili ar 10 papildinājumiem un 5 dzēšanām
  1. +10
    -5
      src/main/java/com/telpo/dipperposition/service/impl/DipperAstPosAsyncTaskServiceImpl.java

+ 10
- 5
src/main/java/com/telpo/dipperposition/service/impl/DipperAstPosAsyncTaskServiceImpl.java Parādīt failu

@@ -67,14 +67,19 @@ public class DipperAstPosAsyncTaskServiceImpl implements IDipperAstPosAsyncTaskS
dataMap.put("ip", ipAddress);
dataMap.put("key", ipPositionRequestKey);
StringBuffer buffer = okHttpUtil.getQueryString(ipPositionRequestPath, dataMap);
if (ObjectUtils.isNotEmpty(buffer)) {
String provinceBuffer = buffer.toString();
if (StringUtils.isEmpty(provinceBuffer)) {
JSONObject paramObject = new JSONObject();
String result = okHttpUtil.postJsonParams(buffer.toString(), paramObject.toJSONString());
if (ObjectUtils.isNotEmpty(result)) {
if (StringUtils.isEmpty(result)) {
log.debug("IP省份获取错误,结果为空");
return null;
} else {
log.debug("IP省份获取错误,结果为:" + provinceBuffer);
JSONObject provinceJson = JSONObject.parseObject(provinceBuffer);
if (result.equals("FAIL")) {
log.debug("IP省份获取错误,结果为FAIL");
return null;
}
log.debug("IP省份获取错误,结果为:" + result);
JSONObject provinceJson = JSONObject.parseObject(result);
String province = (String)provinceJson.get("province");
if (ObjectUtils.isEmpty(province)) {
log.debug("json is :" + buffer.toString());


Notiek ielāde…
Atcelt
Saglabāt