| | |
| | | import com.genersoft.iot.vmp.storager.dao.DeviceChannelMapper; |
| | | import com.genersoft.iot.vmp.storager.dao.dto.PlatformRegisterInfo; |
| | | import com.genersoft.iot.vmp.utils.DateUtil; |
| | | import com.genersoft.iot.vmp.utils.JsonUtil; |
| | | import com.genersoft.iot.vmp.utils.SystemInfoUtils; |
| | | import com.genersoft.iot.vmp.utils.redis.RedisUtil; |
| | | import org.slf4j.Logger; |
| | |
| | | } |
| | | for (Object player : players) { |
| | | String key = (String) player; |
| | | StreamInfo streamInfo = (StreamInfo) RedisUtil.get(key); |
| | | StreamInfo streamInfo = JsonUtil.redisJsonToObject(key, StreamInfo.class); |
| | | if (Objects.isNull(streamInfo)) { |
| | | continue; |
| | | } |
| | | streamInfos.put(streamInfo.getDeviceID() + "_" + streamInfo.getChannelId(), streamInfo); |
| | | } |
| | | return streamInfos; |
| | |
| | | @Override |
| | | public ThirdPartyGB queryMemberNoGBId(String queryKey) { |
| | | String key = VideoManagerConstants.WVP_STREAM_GB_ID_PREFIX + queryKey; |
| | | JSONObject jsonObject = (JSONObject)RedisUtil.get(key); |
| | | return jsonObject.to(ThirdPartyGB.class); |
| | | return JsonUtil.redisJsonToObject(key, ThirdPartyGB.class); |
| | | } |
| | | |
| | | @Override |
| | |
| | | @Override |
| | | public Device getDevice(String deviceId) { |
| | | String key = VideoManagerConstants.DEVICE_PREFIX + userSetting.getServerId() + "_" + deviceId; |
| | | return (Device)RedisUtil.get(key); |
| | | return JsonUtil.redisJsonToObject(key, Device.class); |
| | | } |
| | | |
| | | @Override |
| | |
| | | @Override |
| | | public GPSMsgInfo getGpsMsgInfo(String gbId) { |
| | | String key = VideoManagerConstants.WVP_STREAM_GPS_MSG_PREFIX + userSetting.getServerId() + "_" + gbId; |
| | | return (GPSMsgInfo)RedisUtil.get(key); |
| | | return JsonUtil.redisJsonToObject(key, GPSMsgInfo.class); |
| | | } |
| | | |
| | | @Override |
| | |
| | | List<Object> keys = RedisUtil.scan(scanKey); |
| | | for (Object o : keys) { |
| | | String key = (String) o; |
| | | GPSMsgInfo gpsMsgInfo = (GPSMsgInfo) RedisUtil.get(key); |
| | | if (!gpsMsgInfo.isStored()) { // 只取没有存过得 |
| | | result.add((GPSMsgInfo) RedisUtil.get(key)); |
| | | GPSMsgInfo gpsMsgInfo = JsonUtil.redisJsonToObject(key, GPSMsgInfo.class); |
| | | if (Objects.nonNull(gpsMsgInfo) && !gpsMsgInfo.isStored()) { // 只取没有存过得 |
| | | result.add(JsonUtil.redisJsonToObject(key, GPSMsgInfo.class)); |
| | | } |
| | | } |
| | | |
| | |
| | | @Override |
| | | public StreamAuthorityInfo getStreamAuthorityInfo(String app, String stream) { |
| | | String key = VideoManagerConstants.MEDIA_STREAM_AUTHORITY + userSetting.getServerId() + "_" + app+ "_" + stream ; |
| | | return (StreamAuthorityInfo) RedisUtil.get(key); |
| | | return JsonUtil.redisJsonToObject(key, StreamAuthorityInfo.class); |
| | | |
| | | } |
| | | |
| | |
| | | List<Object> keys = RedisUtil.scan(scanKey); |
| | | for (Object o : keys) { |
| | | String key = (String) o; |
| | | result.add((StreamAuthorityInfo) RedisUtil.get(key)); |
| | | result.add(JsonUtil.redisJsonToObject(key, StreamAuthorityInfo.class)); |
| | | } |
| | | return result; |
| | | } |
| | |
| | | List<Object> keys = RedisUtil.scan(scanKey); |
| | | if (keys.size() > 0) { |
| | | String key = (String) keys.get(0); |
| | | result = (OnStreamChangedHookParam)RedisUtil.get(key); |
| | | result = JsonUtil.redisJsonToObject(key, OnStreamChangedHookParam.class); |
| | | } |
| | | |
| | | return result; |
| | |
| | | |
| | | @Override |
| | | public void sendAlarmMsg(AlarmChannelMessage msg) { |
| | | String key = VideoManagerConstants.VM_MSG_SUBSCRIBE_ALARM; |
| | | String key = VideoManagerConstants.VM_MSG_SUBSCRIBE_ALARM_RECEIVE; |
| | | logger.info("[redis发送通知] 报警{}: {}", key, JSON.toJSON(msg)); |
| | | RedisUtil.convertAndSend(key, (JSONObject)JSON.toJSON(msg)); |
| | | } |