|
@@ -115,7 +115,7 @@ public class HikSubscription {
|
|
/**
|
|
/**
|
|
* 按事件类型订阅事件
|
|
* 按事件类型订阅事件
|
|
*/
|
|
*/
|
|
- public static int eventSubscriptionByEventTypes(long type,String eventDest) {
|
|
|
|
|
|
+ public static int eventSubscriptionByEventTypes(long[] types,String eventDest) {
|
|
int res = 0;
|
|
int res = 0;
|
|
final String VechicleDataApi = ARTEMIS_PATH + "/api/eventService/v1/eventSubscriptionByEventTypes";
|
|
final String VechicleDataApi = ARTEMIS_PATH + "/api/eventService/v1/eventSubscriptionByEventTypes";
|
|
Map<String, String> path = new HashMap<String, String>(2) {
|
|
Map<String, String> path = new HashMap<String, String>(2) {
|
|
@@ -125,7 +125,6 @@ public class HikSubscription {
|
|
};
|
|
};
|
|
|
|
|
|
JSONObject jsonBody = new JSONObject();
|
|
JSONObject jsonBody = new JSONObject();
|
|
- long[] types = {type};
|
|
|
|
jsonBody.put("eventTypes", types);
|
|
jsonBody.put("eventTypes", types);
|
|
|
|
|
|
jsonBody.put("eventDest", eventDest);
|
|
jsonBody.put("eventDest", eventDest);
|
|
@@ -207,7 +206,7 @@ public class HikSubscription {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- public static String eventUnSubscriptionByEventTypes(long type){
|
|
|
|
|
|
+ public static String eventUnSubscriptionByEventTypes(long[] types){
|
|
final String VechicleDataApi = ARTEMIS_PATH + "/api/eventService/v1/eventUnSubscriptionByEventTypes";
|
|
final String VechicleDataApi = ARTEMIS_PATH + "/api/eventService/v1/eventUnSubscriptionByEventTypes";
|
|
Map<String, String> path = new HashMap<String, String>(2) {
|
|
Map<String, String> path = new HashMap<String, String>(2) {
|
|
{
|
|
{
|
|
@@ -216,7 +215,6 @@ public class HikSubscription {
|
|
};
|
|
};
|
|
|
|
|
|
JSONObject jsonBody = new JSONObject();
|
|
JSONObject jsonBody = new JSONObject();
|
|
- long[] types = {type};
|
|
|
|
jsonBody.put("eventTypes", types);
|
|
jsonBody.put("eventTypes", types);
|
|
//jsonBody.put("eventLvl", 3);
|
|
//jsonBody.put("eventLvl", 3);
|
|
String body = jsonBody.toJSONString();
|
|
String body = jsonBody.toJSONString();
|
|
@@ -289,23 +287,17 @@ public class HikSubscription {
|
|
|
|
|
|
public static void main(String[] args) {
|
|
public static void main(String[] args) {
|
|
|
|
|
|
- /*
|
|
|
|
|
|
+ //*
|
|
|
|
|
|
//订阅
|
|
//订阅
|
|
|
|
|
|
-// long[] subscription = {169001001L};
|
|
|
|
-//
|
|
|
|
-// for (long l : subscription) {
|
|
|
|
-// eventSubscriptionByEventTypes(l,"http://192.168.10.15:9090/business/app/hikc/cameraHikByEventFire/");
|
|
|
|
-// }
|
|
|
|
|
|
+ long[] subscription = {221001001L,192513L,192514L,192515L,169001001L};
|
|
|
|
+ eventSubscriptionByEventTypes(subscription,"https://192.168.10.15:9090/business/app/hikc/cameraHikByEventFire/");
|
|
|
|
|
|
//取消订阅
|
|
//取消订阅
|
|
|
|
|
|
- long[] unSubscription = {221001001L,192513L,192514L,192515L};
|
|
|
|
-
|
|
|
|
- for (long l : unSubscription) {
|
|
|
|
- eventUnSubscriptionByEventTypes(l);
|
|
|
|
- }
|
|
|
|
|
|
+// long[] unSubscription = {221001001L,192513L,192514L,192515L,169001001L};
|
|
|
|
+// eventUnSubscriptionByEventTypes(unSubscription);
|
|
|
|
|
|
//查询已经订阅的事件
|
|
//查询已经订阅的事件
|
|
eventSubscriptionView();
|
|
eventSubscriptionView();
|
|
@@ -313,7 +305,7 @@ public class HikSubscription {
|
|
//*/
|
|
//*/
|
|
|
|
|
|
//订阅警戒头事件
|
|
//订阅警戒头事件
|
|
-// eventSubscriptionByEventTypes(131588,"http://192.168.10.15:9090/business/app/hikc/cameraHikByEventRcv/");
|
|
|
|
|
|
+// eventSubscriptionByEventTypes(131588,"https://192.168.10.15:9090/business/app/hikc/cameraHikByEventRcv/");
|
|
|
|
|
|
// eventUnSubscriptionByEventTypes(131588);
|
|
// eventUnSubscriptionByEventTypes(131588);
|
|
|
|
|