zhongrj
2023-06-12 4cea15786ac20e01944fa796b87e5e77f722768e
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
@@ -71,7 +79,7 @@
    * @param cameraIndexCode 监控点唯一标识
    * @return
    */
   public static String GetCameraPreviewURL(String url, String cameraIndexCode, String protocol) {
   public static String GetCameraPreviewURL(Integer type,String url, String cameraIndexCode, String protocol) {
      /**
       * 组装请求参数
       */
@@ -83,7 +91,7 @@
//      jsonBody.put("expand", "streamform=ps");
      String body = jsonBody.toJSONString();
      // 调用公共方法
      return common(url,body);
      return common(type,url,body);
   }
   /**
@@ -93,7 +101,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 +124,7 @@
      jsonBody.put("expressions", list);
      String body = jsonBody.toJSONString();
      System.out.println(jsonBody);
      return common(url,body);
      return common(type,url,body);
   }
@@ -126,7 +135,7 @@
    * @param cameraIndexCode 监控点唯一标识
    * @return
    */
   public static String GetTalkURLs(String url, String cameraIndexCode) {
   public static String GetTalkURLs(Integer type, String url, String cameraIndexCode) {
      /**
       * 组装请求参数
       */
@@ -140,7 +149,7 @@
      jsonBody.put("talkIndexCode", "ce744c4c67df464f92994185d825b6fa");
      jsonBody.put("protocol", "wss");
      String body = jsonBody.toJSONString();
      return common(url,body);
      return common(type,url,body);
   }
   /**
@@ -152,7 +161,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 +182,7 @@
      /**
       * 调用接口
       */
      return common(url,body);
      return common(type,url,body);
   }
   /**
@@ -182,7 +192,7 @@
    * @param cameraIndexCode 监控点唯一标识
    * @return
    */
   public static String presetsSearches(String url,String cameraIndexCode) {
   public static String presetsSearches(Integer type,String url,String cameraIndexCode) {
      /**
       * 组装请求参数
       */
@@ -192,7 +202,7 @@
      /**
       * 调用接口
       */
      return common(url,body);
      return common(type,url,body);
   }
@@ -207,7 +217,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 +238,7 @@
      /**
       * 调用接口
       */
      return common(url,body);
      return common(type,url,body);
   }
@@ -237,7 +248,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 +261,7 @@
       * 调用接口并返回数据
       * post请求application/json类型参数;
       */
      return common(url, body);
      return common(type,url, body);
   }
   /**
@@ -259,7 +270,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 +282,7 @@
       * 调用接口并返回数据
       * post请求application/json类型参数;
       */
      return common(url, body);
      return common(type,url, body);
   }
//   public static void main(String[] args) {