From 30a778548cf99f8f8a17ce63dc09c577d7a5ed16 Mon Sep 17 00:00:00 2001
From: zhongrj <646384940@qq.com>
Date: Sun, 25 Jun 2023 09:59:07 +0800
Subject: [PATCH] 海康预览url查询修改

---
 skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/hk/util/GetCameraUtils.java |   56 ++++++++++++++++++++++++++++++++++++--------------------
 1 files changed, 36 insertions(+), 20 deletions(-)

diff --git a/skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/hk/util/GetCameraUtils.java b/skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/hk/util/GetCameraUtils.java
index 4a2de49..317afb8 100644
--- a/skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/hk/util/GetCameraUtils.java
+++ b/skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/hk/util/GetCameraUtils.java
@@ -26,12 +26,20 @@
 	 * @param body
 	 * @return
 	 */
-	public static String common(String url, String body) {
+	public static String common(Integer type,String url, String body) {
 		/**
 		 * STEP1:设置平台参数,根据实际情况,设置host appkey appsecret 三个参数.
 		 */
 		// artemis网关服务器ip端口
-		ArtemisConfig.host = HkConstant.HOST;
+		if (null==type){
+			ArtemisConfig.host = HkConstant.HOST;
+		}
+		if (type==1) {
+			ArtemisConfig.host = HkConstant.HOST;
+		}
+		if (type==2) {
+			ArtemisConfig.host = HkConstant.NEW_HOST;
+		}
 		// 秘钥appKey
 		ArtemisConfig.appKey = HkConstant.AppKey;
 		// 秘钥appSecret
@@ -67,11 +75,14 @@
 	/**
 	 * 获取视频预览数据
 	 *
-	 * @param url             视频预览url
+	 * @param type  类型,新/老
+	 * @param url 视频预览url
 	 * @param cameraIndexCode 监控点唯一标识
+	 * @param protocol
+	 * @param expand
 	 * @return
 	 */
-	public static String GetCameraPreviewURL(String url, String cameraIndexCode, String protocol) {
+	public static String GetCameraPreviewURL(Integer type,String url, String cameraIndexCode, String protocol,String expand) {
 		/**
 		 * 组装请求参数
 		 */
@@ -80,10 +91,12 @@
 		jsonBody.put("streamType", 0);
 		jsonBody.put("protocol", protocol);
 		jsonBody.put("transmode", 1);
-//		jsonBody.put("expand", "streamform=ps");
+		if (null!= expand && !expand.equals("")) {
+			jsonBody.put("expand", expand);
+		}
 		String body = jsonBody.toJSONString();
 		// 调用公共方法
-		return common(url,body);
+		return common(type,url,body);
 	}
 
 	/**
@@ -93,7 +106,8 @@
 	 * @param cameraCode 监控点唯一标识
 	 * @return
 	 */
-	public static String QueryCameraPreviewURL(String url,
+	public static String QueryCameraPreviewURL(Integer type,
+											   String url,
 											   String cameraCode,
 											   String resourceType,
 											   String key) {
@@ -115,7 +129,7 @@
 		jsonBody.put("expressions", list);
 		String body = jsonBody.toJSONString();
 		System.out.println(jsonBody);
-		return common(url,body);
+		return common(type,url,body);
 	}
 
 
@@ -126,7 +140,7 @@
 	 * @param cameraIndexCode 监控点唯一标识
 	 * @return
 	 */
-	public static String GetTalkURLs(String url, String cameraIndexCode) {
+	public static String GetTalkURLs(Integer type, String url, String cameraIndexCode) {
 		/**
 		 * 组装请求参数
 		 */
@@ -140,7 +154,7 @@
 		jsonBody.put("talkIndexCode", "ce744c4c67df464f92994185d825b6fa");
 		jsonBody.put("protocol", "wss");
 		String body = jsonBody.toJSONString();
-		return common(url,body);
+		return common(type,url,body);
 	}
 
 	/**
@@ -152,7 +166,8 @@
 	 * @param command 命令
 	 * @return
 	 */
-	public static String controlling(String url,
+	public static String controlling(Integer type,
+									 String url,
 									 String cameraIndexCode,
 									 Integer action,
 									 String command,
@@ -172,7 +187,7 @@
 		/**
 		 * 调用接口
 		 */
-		return common(url,body);
+		return common(type,url,body);
 	}
 
 	/**
@@ -182,7 +197,7 @@
 	 * @param cameraIndexCode 监控点唯一标识
 	 * @return
 	 */
-	public static String presetsSearches(String url,String cameraIndexCode) {
+	public static String presetsSearches(Integer type,String url,String cameraIndexCode) {
 		/**
 		 * 组装请求参数
 		 */
@@ -192,7 +207,7 @@
 		/**
 		 * 调用接口
 		 */
-		return common(url,body);
+		return common(type,url,body);
 	}
 
 
@@ -207,7 +222,8 @@
 	 * @param endY 命令
 	 * @return
 	 */
-	public static String selZoomURLs(String url,
+	public static String selZoomURLs(Integer type,
+									 String url,
 									 String cameraIndexCode,
 									 Integer startX,
 									 Integer startY,
@@ -227,7 +243,7 @@
 		/**
 		 * 调用接口
 		 */
-		return common(url,body);
+		return common(type,url,body);
 	}
 
 
@@ -237,7 +253,7 @@
 	 * @param url 监控资源url
 	 * @return
 	 */
-	public static String GetCameraResourcePage(Integer pageNo, Integer pageSize, String url) {
+	public static String GetCameraResourcePage(Integer type,Integer pageNo, Integer pageSize, String url) {
 		/**
 		 * 组装请求参数
 		 */
@@ -250,7 +266,7 @@
 		 * 调用接口并返回数据
 		 * post请求application/json类型参数;
 		 */
-		return common(url, body);
+		return common(type,url, body);
 	}
 
 	/**
@@ -259,7 +275,7 @@
 	 * @param url 监控资源url
 	 * @return
 	 */
-	public static String manualCaptureUrls(String url,String cameraIndexCode) {
+	public static String manualCaptureUrls(Integer type,String url,String cameraIndexCode) {
 		/**
 		 * 组装请求参数
 		 */
@@ -271,7 +287,7 @@
 		 * 调用接口并返回数据
 		 * post请求application/json类型参数;
 		 */
-		return common(url, body);
+		return common(type,url, body);
 	}
 
 //	public static void main(String[] args) {

--
Gitblit v1.9.3