From 10ae1bba597e562a20f44f777ae5afdefb5da6af Mon Sep 17 00:00:00 2001 From: panlinlin <648540858@qq.com> Date: 星期三, 28 四月 2021 15:10:35 +0800 Subject: [PATCH] 增加对zlm使用docker容器的支持 --- src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookSubscribe.java | 28 +++++++++++++++++++++++++++- 1 files changed, 27 insertions(+), 1 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookSubscribe.java b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookSubscribe.java index 129f8a3..bf54f50 100644 --- a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookSubscribe.java +++ b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookSubscribe.java @@ -70,8 +70,34 @@ return event; } + public void removeSubscribe(HookType type, JSONObject hookResponse) { + Map<JSONObject, Event> eventMap = allSubscribes.get(type); + if (eventMap == null) { + return; + } + for (JSONObject key : eventMap.keySet()) { + Boolean result = null; + for (String s : key.keySet()) { + if (result == null) { + result = key.getString(s).equals(hookResponse.getString(s)); + }else { + result = result && key.getString(s).equals(hookResponse.getString(s)); + } + + } + if (result) { + eventMap.remove(key); + } + } + } + + /** + * 鑾峰彇鏌愪釜绫诲瀷鐨勬墍鏈夌殑璁㈤槄 + * @param type + * @return + */ public List<ZLMHttpHookSubscribe.Event> getSubscribes(HookType type) { - ZLMHttpHookSubscribe.Event event= null; + // ZLMHttpHookSubscribe.Event event= null; Map<JSONObject, Event> eventMap = allSubscribes.get(type); if (eventMap == null) { return null; -- Gitblit v1.8.0