xiaoxie
2022-04-18 6bb8f45e270681dbcb70aed663b406e7d905e091
src/main/java/com/genersoft/iot/vmp/gb28181/event/DeviceOffLineDetector.java
@@ -1,5 +1,6 @@
package com.genersoft.iot.vmp.gb28181.event;
import com.genersoft.iot.vmp.conf.UserSetting;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@@ -7,8 +8,8 @@
import com.genersoft.iot.vmp.utils.redis.RedisUtil;
/**    
 * @Description:设备离在线状态检测器,用于检测设备状态
 * @author: songww
 * @description:设备离在线状态检测器,用于检测设备状态
 * @author: swwheihei
 * @date:   2020年5月13日 下午2:40:29     
 */
@Component
@@ -16,9 +17,12 @@
   @Autowired
    private RedisUtil redis;
   @Autowired
    private UserSetting userSetting;
   
   public boolean isOnline(String deviceId) {
      String key = VideoManagerConstants.KEEPLIVEKEY_PREFIX + deviceId;
      String key = VideoManagerConstants.KEEPLIVEKEY_PREFIX + userSetting.getServerId() + "_" + deviceId;
      return redis.hasKey(key);
   }
}