From 758612722635be26fda33a9cfc41775c64a26a1c Mon Sep 17 00:00:00 2001 From: dinggang <2498628697@qq.com> Date: Thu, 28 Jul 2022 20:03:59 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A5=BF=E6=B5=B7=E5=B2=B8=E5=9F=BA=E7=A1=80?= =?UTF-8?q?=E8=AE=BE=E6=96=BD=E9=9C=80=E6=B1=82=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/ResourceServiceImpl.java | 15 +++++++++------ .../main/resources/domain/tsingtao-xha.properties | 4 ++-- 2 files changed, 11 insertions(+), 8 deletions(-) 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 857d3226..54e09203 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 @@ -544,14 +544,14 @@ public class ResourceServiceImpl extends CrudServiceImpl result_ = new CopyOnWriteArrayList<>(); CompletableFuture cloud = CompletableFuture.runAsync(() -> { // 云脑专网 - String url = String.format(tsingtao_xhaProperties.getCloudcam(), "", 1, 10); + String url = tsingtao_xhaProperties.getCloudcam(); 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()); - if (jsonObject.containsKey("data")) { - result_.add(jsonObject.getJSONObject("data").getLongValue("total")); + if (jsonObject.containsKey("errorNo") && jsonObject.getLongValue("errorNo") == 200) { + result_.add(jsonObject.getLongValue("body")); } } else { logger.error("青岛西海岸获取失败"); @@ -562,14 +562,17 @@ public class ResourceServiceImpl extends CrudServiceImpl { // 金宏网 - String url = String.format(tsingtao_xhaProperties.getLocalcam(), "", 1, 10); + String url = tsingtao_xhaProperties.getLocalcam(); 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()); - if (jsonObject.containsKey("data")) { - result_.add(jsonObject.getJSONObject("data").getLongValue("total")); + //if (jsonObject.containsKey("data")) { + // result_.add(jsonObject.getJSONObject("data").getLongValue("total")); + //} + if (jsonObject.containsKey("errorNo") && jsonObject.getLongValue("errorNo") == 200) { + result_.add(jsonObject.getLongValue("body")); } } else { logger.error("青岛西海岸获取失败"); diff --git a/renren-admin/src/main/resources/domain/tsingtao-xha.properties b/renren-admin/src/main/resources/domain/tsingtao-xha.properties index 92eb821d..5ddad40a 100644 --- a/renren-admin/src/main/resources/domain/tsingtao-xha.properties +++ b/renren-admin/src/main/resources/domain/tsingtao-xha.properties @@ -1,7 +1,7 @@ tsingtao-xha.cloudhls=http://10.10.30.9:8001/hx-weather-warning/camera/getCameraLiveStreamByCode?cameraCode=%s&protocol=hls tsingtao-xha.localhls=http://10.134.135.9:8001/hx-weather-warning/camera/getCameraLiveStreamByCode?cameraCode=%s&protocol=hls -tsingtao-xha.cloudcam=http://10.10.30.9:8001/hx-weather-warning/camera/getCameraListByName?name=%s&pageNo=%d&pageSize=%d -tsingtao-xha.localcam=http://10.134.135.9:8001/hx-weather-warning/camera/getCameraListByName?name=%s&pageNo=%d&pageSize=%d +tsingtao-xha.cloudcam=http://10.10.30.9:8001/data_service/getCamera/getCameraCount +tsingtao-xha.localcam=http://10.134.135.9:8001/data_service/getCamera/getCameraCount tsingtao-xha.resourcecount=http://10.10.30.24:30090/api/share-portal/platform/catalogue/query?catalogueId=&departmentId=&serviceName=&type=&orderField=requestNum&orderType=desc&pageNum=1&pageSize=10&serviceType=data&rq=1655106309671.43 tsingtao-xha.resourceapplyinfo=http://10.10.30.24:30058/share-portal/platform/index/abilityMarket/count tsingtao-xha.sjzy=http://10.10.30.24:30090/api/share-portal/platform/catalogue/query?catalogueId=&departmentId=&serviceName=%s&type=&orderField=%s&orderType=%s&pageNum=%s&pageSize=%s&serviceType=data&rq=1655106309671.43 \ No newline at end of file