diff --git a/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java index 41db710e..707177bb 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java @@ -257,12 +257,14 @@ public class ResourceServiceImpl extends CrudServiceImpl { // 云脑专网 OkHttpClient client = new OkHttpClient(); - String url = String.format(tsingtao_xhaProperties.getCloudcam(), resourceDTO.getName(), pageNum, pageSize); + String url = String.format(tsingtao_xhaProperties.getCloudcam(), org.apache.commons.lang3.StringUtils.isNotEmpty(resourceDTO.getName()) ? resourceDTO.getName() : "", pageNum, pageSize); logger.info(url); Request request = new Request.Builder().url(url).build(); try (Response response = client.newCall(request).execute()) { if (response.isSuccessful()) { - JSONObject jsonObject_ = JSON.parseObject(response.body().string()); + String body = response.body().string(); + JSONObject jsonObject_ = JSON.parseObject(body); + logger.info("西海岸接口返回:{}" + body, url); if (jsonObject_.containsKey("data")) { if (jsonObject_.getJSONObject("data").containsKey("list")) { resultPage.setTotal(jsonObject_.getJSONObject("data").getLongValue("total")); @@ -296,12 +298,14 @@ public class ResourceServiceImpl extends CrudServiceImpl { // 金宏网 OkHttpClient client = new OkHttpClient(); - String url = String.format(tsingtao_xhaProperties.getLocalcam(), resourceDTO.getName(), pageNum, pageSize); + String url = String.format(tsingtao_xhaProperties.getLocalcam(), org.apache.commons.lang3.StringUtils.isNotEmpty(resourceDTO.getName()) ? resourceDTO.getName() : "", pageNum, pageSize); logger.info(url); Request request = new Request.Builder().url(url).build(); try (Response response = client.newCall(request).execute()) { if (response.isSuccessful()) { - JSONObject jsonObject_ = JSON.parseObject(response.body().string()); + String body = response.body().string(); + JSONObject jsonObject_ = JSON.parseObject(body); + logger.info("西海岸接口返回:{}" + body, url); if (jsonObject_.containsKey("data")) { if (jsonObject_.getJSONObject("data").containsKey("list")) { resultPage.setTotal(jsonObject_.getJSONObject("data").getLongValue("total"));