| | |
| | | import com.genersoft.iot.vmp.common.StreamInfo; |
| | | import com.genersoft.iot.vmp.conf.MediaServerConfig; |
| | | import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel; |
| | | import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | |
| | | // devices.add((Device)redis.get((String)deviceIdList.get(i))); |
| | | device =(Device)redis.get((String)deviceIdList.get(i)); |
| | | if (redis.scan(VideoManagerConstants.KEEPLIVEKEY_PREFIX+device.getDeviceId()).size() == 0){ |
| | | outline(device.getDeviceId()); |
| | | // outline(device.getDeviceId()); |
| | | } |
| | | devices.add(device); |
| | | } |
| | |
| | | // devices.add((Device)redis.get(VideoManagerConstants.DEVICE_PREFIX+deviceIds[i])); |
| | | device = (Device)redis.get(VideoManagerConstants.DEVICE_PREFIX+deviceIds[i]); |
| | | if (redis.scan(VideoManagerConstants.KEEPLIVEKEY_PREFIX+device.getDeviceId()).size() == 0){ |
| | | outline(device.getDeviceId()); |
| | | // outline(device.getDeviceId()); |
| | | } |
| | | devices.add(device); |
| | | } |
| | |
| | | if (playLeys == null || playLeys.size() == 0) return null; |
| | | return (StreamInfo)redis.get(playLeys.get(0).toString()); |
| | | } |
| | | |
| | | @Override |
| | | public boolean updateParentPlatform(ParentPlatform parentPlatform) { |
| | | |
| | | // 存储device |
| | | return redis.set(VideoManagerConstants.PLATFORM_PREFIX + parentPlatform.getDeviceGBId(), parentPlatform); |
| | | } |
| | | |
| | | @Override |
| | | public boolean deleteParentPlatform(ParentPlatform parentPlatform) { |
| | | return redis.del(VideoManagerConstants.PLATFORM_PREFIX + parentPlatform.getDeviceGBId()); |
| | | } |
| | | |
| | | @Override |
| | | public PageResult<ParentPlatform> queryParentPlatformList(int page, int count) { |
| | | PageResult pageResult = new PageResult<Device>(); |
| | | pageResult.setPage(page); |
| | | pageResult.setCount(count); |
| | | List<ParentPlatform> resultData = new ArrayList<>(); |
| | | List<Object> parentPlatformList = redis.scan(VideoManagerConstants.PLATFORM_PREFIX + "*"); |
| | | pageResult.setTotal(parentPlatformList.size()); |
| | | int maxCount = (page + 1)* count; |
| | | for (int i = page * count; i < (pageResult.getTotal() > maxCount ? maxCount : pageResult.getTotal() ); i++) { |
| | | ParentPlatform parentPlatform =(ParentPlatform)redis.get((String)parentPlatformList.get(i)); |
| | | resultData.add(parentPlatform); |
| | | |
| | | } |
| | | pageResult.setData(resultData); |
| | | return pageResult; |
| | | } |
| | | |
| | | @Override |
| | | public ParentPlatform queryParentPlatById(String platformGbId) { |
| | | return (ParentPlatform)redis.get(VideoManagerConstants.PLATFORM_PREFIX + platformGbId); |
| | | } |
| | | } |