| | |
| | | * @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 |
| | |
| | | * @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) { |
| | | /** |
| | | * 组装请求参数 |
| | | */ |
| | |
| | | // jsonBody.put("expand", "streamform=ps"); |
| | | String body = jsonBody.toJSONString(); |
| | | // 调用公共方法 |
| | | return common(url,body); |
| | | return common(type,url,body); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @param cameraCode 监控点唯一标识 |
| | | * @return |
| | | */ |
| | | public static String QueryCameraPreviewURL(String url, |
| | | public static String QueryCameraPreviewURL(Integer type, |
| | | String url, |
| | | String cameraCode, |
| | | String resourceType, |
| | | String key) { |
| | |
| | | jsonBody.put("expressions", list); |
| | | String body = jsonBody.toJSONString(); |
| | | System.out.println(jsonBody); |
| | | return common(url,body); |
| | | return common(type,url,body); |
| | | } |
| | | |
| | | |
| | |
| | | * @param cameraIndexCode 监控点唯一标识 |
| | | * @return |
| | | */ |
| | | public static String GetTalkURLs(String url, String cameraIndexCode) { |
| | | public static String GetTalkURLs(Integer type, String url, String cameraIndexCode) { |
| | | /** |
| | | * 组装请求参数 |
| | | */ |
| | |
| | | jsonBody.put("talkIndexCode", "ce744c4c67df464f92994185d825b6fa"); |
| | | jsonBody.put("protocol", "wss"); |
| | | String body = jsonBody.toJSONString(); |
| | | return common(url,body); |
| | | return common(type,url,body); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @param command 命令 |
| | | * @return |
| | | */ |
| | | public static String controlling(String url, |
| | | public static String controlling(Integer type, |
| | | String url, |
| | | String cameraIndexCode, |
| | | Integer action, |
| | | String command, |
| | |
| | | /** |
| | | * 调用接口 |
| | | */ |
| | | return common(url,body); |
| | | return common(type,url,body); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @param cameraIndexCode 监控点唯一标识 |
| | | * @return |
| | | */ |
| | | public static String presetsSearches(String url,String cameraIndexCode) { |
| | | public static String presetsSearches(Integer type,String url,String cameraIndexCode) { |
| | | /** |
| | | * 组装请求参数 |
| | | */ |
| | |
| | | /** |
| | | * 调用接口 |
| | | */ |
| | | return common(url,body); |
| | | return common(type,url,body); |
| | | } |
| | | |
| | | |
| | |
| | | * @param endY 命令 |
| | | * @return |
| | | */ |
| | | public static String selZoomURLs(String url, |
| | | public static String selZoomURLs(Integer type, |
| | | String url, |
| | | String cameraIndexCode, |
| | | Integer startX, |
| | | Integer startY, |
| | |
| | | /** |
| | | * 调用接口 |
| | | */ |
| | | return common(url,body); |
| | | return common(type,url,body); |
| | | } |
| | | |
| | | |
| | |
| | | * @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) { |
| | | /** |
| | | * 组装请求参数 |
| | | */ |
| | |
| | | * 调用接口并返回数据 |
| | | * post请求application/json类型参数; |
| | | */ |
| | | return common(url, body); |
| | | return common(type,url, body); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @param url 监控资源url |
| | | * @return |
| | | */ |
| | | public static String manualCaptureUrls(String url,String cameraIndexCode) { |
| | | public static String manualCaptureUrls(Integer type,String url,String cameraIndexCode) { |
| | | /** |
| | | * 组装请求参数 |
| | | */ |
| | |
| | | * 调用接口并返回数据 |
| | | * post请求application/json类型参数; |
| | | */ |
| | | return common(url, body); |
| | | return common(type,url, body); |
| | | } |
| | | |
| | | // public static void main(String[] args) { |