Pu Zhibing
9 天以前 1ee76c252f2dbba62e0ec34cccf9eaac51de9083
ruoyi-service/ruoyi-dataInterchange/src/main/java/com/ruoyi/dataInterchange/util/haikang/Artemis.java
@@ -4,10 +4,7 @@
import com.alibaba.fastjson.JSONObject;
import com.hikvision.artemis.sdk.ArtemisHttpUtil;
import com.hikvision.artemis.sdk.config.ArtemisConfig;
import com.ruoyi.dataInterchange.util.haikang.model.EventSubscriptionByEventTypesRequest;
import com.ruoyi.dataInterchange.util.haikang.model.EventSubscriptionViewRequest;
import com.ruoyi.dataInterchange.util.haikang.model.EventUnSubscriptionByEventTypesRequest;
import com.ruoyi.dataInterchange.util.haikang.model.GetTopicInfoRequest;
import com.ruoyi.dataInterchange.util.haikang.model.*;
import lombok.extern.slf4j.Slf4j;
import java.util.ArrayList;
@@ -33,7 +30,7 @@
    * appKey : 请填入appKey
    * appSecret : 请填入appSecret
    */
   private static ArtemisConfig artemisConfig = new ArtemisConfig("https://112.18.106.230:443", "27273246", "vjvZA7X4hHUc0SbONht9");
   private static ArtemisConfig artemisConfig = new ArtemisConfig("112.18.106.230:443", "27273246", "vjvZA7X4hHUc0SbONht9");
   
   //按事件类型取消订阅
   public static String eventUnSubscriptionByEventTypes(EventUnSubscriptionByEventTypesRequest eventUnSubscriptionByEventTypesRequest) throws Exception {
@@ -74,8 +71,57 @@
      return result;
   }
   
   public static void main(String[] args) {
      Artemis.run();
   //根据车牌号码获取车辆信息(含设备)
   public static String findVehicleByLicensePlate(FindVehicleByLicensePlateRequest findVehicleByLicensePlateRequest)throws Exception{
      String findVehicleByLicensePlateDataApi = ARTEMIS_PATH +"/api/rtsm/v1/resource/findVehicleByLicensePlate";
      Map<String,String> path = new HashMap<String,String>(2){
         {
            put("https://",findVehicleByLicensePlateDataApi);
         }
      };
      String body=JSON.toJSONString(findVehicleByLicensePlateRequest);
      String result =ArtemisHttpUtil.doPostStringArtemis(artemisConfig,path,body,null,null,"application/json");
      return result;
   }
   //根据车辆编号与设备编号获取监控点信息列表
   public static String findCameraPage(FindCameraPageRequest findCameraPageRequest)throws Exception{
      String findCameraPageDataApi = ARTEMIS_PATH +"/api/rtsm/v1/vehicle/findCameraPage";
      Map<String,String> path = new HashMap<String,String>(2){
         {
            put("https://",findCameraPageDataApi);
         }
      };
      String body=JSON.toJSONString(findCameraPageRequest);
      String result =ArtemisHttpUtil.doPostStringArtemis(artemisConfig,path,body,null,null,"application/json");
      return result;
   }
   //获取监控点预览取流URL
   public static String previewURLs(PreviewURLsRequest previewURLsRequest)throws Exception{
      String previewURLsDataApi = ARTEMIS_PATH +"/api/video/v1/cameras/previewURLs";
      Map<String,String> path = new HashMap<String,String>(2){
         {
            put("https://",previewURLsDataApi);
         }
      };
      String body=JSON.toJSONString(previewURLsRequest);
      String result =ArtemisHttpUtil.doPostStringArtemis(artemisConfig,path,body,null,null,"application/json");
      return result;
   }
   //分页查询车辆信息
   public static String findVehiclePage(FindVehiclePageRequest findVehiclePageRequest)throws Exception{
      String findVehiclePageDataApi = ARTEMIS_PATH +"/api/rtsm/v1/resource/findVehiclePage";
      Map<String,String> path = new HashMap<String,String>(2){
         {
            put("https://",findVehiclePageDataApi);
         }
      };
      String body=JSON.toJSONString(findVehiclePageRequest);
      String result =ArtemisHttpUtil.doPostStringArtemis(artemisConfig,path,body,null,null,"application/json");
      return result;
   }
   
   public static void run() {
@@ -92,7 +138,7 @@
         e.printStackTrace();
      }
   }
   //按事件类型获取事件订阅信息
   public static String getTopicInfo(GetTopicInfoRequest getTopicInfoRequest)throws Exception {
      String getTopicInfoDataApi = ARTEMIS_PATH +"/api/common/v1/event/getTopicInfo";
@@ -105,4 +151,18 @@
      String result =ArtemisHttpUtil.doPostStringArtemis(artemisConfig,path,body,null,null,"application/json");
      return result;
   }
   //根据报警ID获取关联图片信息
   public static String findPicturesByAlarmId(FindPicturesByAlarmIdRequest findPicturesByAlarmIdRequest) throws Exception {
      String findPicturesByAlarmIdDataApi = ARTEMIS_PATH +"/api/rtsm/v1/multimedia/findPicturesByAlarmId";
      Map<String,String> path = new HashMap<String,String>(2){
         {
            put("https://",findPicturesByAlarmIdDataApi);
         }
      };
      String body=JSON.toJSONString(findPicturesByAlarmIdRequest);
      String result =ArtemisHttpUtil.doPostStringArtemis(artemisConfig,path,body,null,null,"application/json");
      return result;
   }
}