648540858
2022-11-17 6b8ecd1f9d2abe1e6ac0af858487755a58a2643a
src/main/java/com/genersoft/iot/vmp/gb28181/event/record/RecordEndEventListener.java
@@ -5,11 +5,9 @@
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;
import java.util.HashMap;
import java.util.Hashtable;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
/**
 * @description: 录像查询结束事件
@@ -22,13 +20,12 @@
    private final static Logger logger = LoggerFactory.getLogger(RecordEndEventListener.class);
    private static Map<String, SseEmitter> sseEmitters = new Hashtable<>();
    public interface RecordEndEventHandler{
        void  handler(RecordInfo recordInfo);
    }
    private Map<String, RecordEndEventHandler> handlerMap = new HashMap<>();
    private Map<String, RecordEndEventHandler> handlerMap = new ConcurrentHashMap<>();
    @Override
    public void onApplicationEvent(RecordEndEvent event) {
        logger.info("录像查询完成事件触发,deviceId:{}, channelId: {}, 录像数量{}条", event.getRecordInfo().getDeviceId(),
@@ -38,7 +35,6 @@
                recordEndEventHandler.handler(event.getRecordInfo());
            }
        }
    }
    public void addEndEventHandler(String device, String channelId, RecordEndEventHandler recordEndEventHandler) {