From 6f960da803ae598870a8f6623325745f62c79ec6 Mon Sep 17 00:00:00 2001 From: wangliwen Date: Fri, 24 Jun 2022 09:20:34 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=82=E3=80=82=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/ResourceServiceImpl.java | 43 ------------------- .../TsingtaoXHAVideoPreviewService.java | 17 -------- 2 files changed, 60 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 5a0f6df4..82999487 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 @@ -294,49 +294,6 @@ public class ResourceServiceImpl extends CrudServiceImpl { // 金宏网 -// OkHttpClient client = new OkHttpClient(); -// 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()) { -// 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")); -// resultPage.setRecords(jsonObject_.getJSONObject("data").getJSONArray("list").stream().map(index -> (JSONObject) JSON.toJSON(index)).map(index -> { -// ResourceDTO resourceDTO1 = new ResourceDTO(); -// resourceDTO1.setId(Long.valueOf(index.getString("id"))); -// resourceDTO1.setDelFlag(index.getIntValue("delFlag")); -// resourceDTO1.setLink(index.getString("cameraIndexCode")); -// resourceDTO1.setName(index.getString("name")); -// resourceDTO1.setType("基础设施"); -// try { -// resourceDTO1.setCreateDate(sdf.parse(index.getString("createdTime"))); -// } catch (ParseException e) { -// logger.error("时间异常"); -// resourceDTO1.setCreateDate(new Date()); -// } -// return resourceDTO1; -// }).collect(Collectors.toList())); -// } else { -// resultPage.setRecords(new ArrayList<>()); -// resultPage.setTotal(0); -// } -// -// } -// } else { -// logger.error("获取失败"); -// } -// } catch (Exception exception) { -// logger.error("失败", exception); -// } -// }); -// CompletableFuture.allOf(cloud, local); } else { logger.info("西海岸基普通"); if (resourceDTO.getInfoList().isEmpty()) { diff --git a/renren-admin/src/main/java/io/renren/modules/resource/videoPreview/domain/TsingtaoXHAVideoPreviewService.java b/renren-admin/src/main/java/io/renren/modules/resource/videoPreview/domain/TsingtaoXHAVideoPreviewService.java index 20faf60f..0b97be63 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/videoPreview/domain/TsingtaoXHAVideoPreviewService.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/videoPreview/domain/TsingtaoXHAVideoPreviewService.java @@ -50,23 +50,6 @@ public class TsingtaoXHAVideoPreviewService extends AbstractVideoPreviewService } catch (Exception exception) { logger.error("西海岸预览地址获取失败", exception); } -// CompletableFuture local = -// CompletableFuture.runAsync(() -> { // 金宏网 -// OkHttpClient client = new OkHttpClient(); -// Request request = new Request.Builder().url(String.format(tsingtao_xhaProperties.getLocalhls(), key)).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.getString("data")); -// } -// } else { -// logger.error("西海岸预览地址获取失败"); -// } -// } catch (Exception exception) { -// logger.error("西海案预览地址获取失败", exception); -// } -// }); return result.stream().filter(index -> StringUtils.isNotEmpty(index)).findAny().orElse(null); } }