| | |
| | | } |
| | | |
| | | @Override |
| | | public PageInfo queryChannelsByDeviceId(String deviceId, String query, Boolean hasSubChannel, Boolean online, int page, int count) { |
| | | public PageInfo queryChannelsByDeviceId(String deviceId, String query, Boolean hasSubChannel, Boolean online, Boolean catalogUnderDevice, int page, int count) { |
| | | // 获取到所有正在播放的流 |
| | | PageHelper.startPage(page, count); |
| | | List<DeviceChannel> all = deviceChannelMapper.queryChannels(deviceId, null, query, hasSubChannel, online); |
| | | List<DeviceChannel> all; |
| | | if (catalogUnderDevice != null && catalogUnderDevice) { |
| | | all = deviceChannelMapper.queryChannels(deviceId, deviceId, query, hasSubChannel, online); |
| | | }else { |
| | | all = deviceChannelMapper.queryChannels(deviceId, null, query, hasSubChannel, online); |
| | | } |
| | | return new PageInfo<>(all); |
| | | } |
| | | |
| | |
| | | public synchronized boolean outline(String deviceId) { |
| | | logger.info("更新设备离线: " + deviceId); |
| | | Device device = deviceMapper.getDeviceByDeviceId(deviceId); |
| | | if (device == null) return false; |
| | | if (device == null) { |
| | | return false; |
| | | } |
| | | device.setOnline(0); |
| | | redisCatchStorage.updateDevice(device); |
| | | return deviceMapper.update(device) > 0; |
| | |
| | | * 删除指定设备的所有移动位置 |
| | | * @param deviceId |
| | | */ |
| | | @Override |
| | | public int clearMobilePositionsByDeviceId(String deviceId) { |
| | | return deviceMobilePositionMapper.clearMobilePositionsByDeviceId(deviceId); |
| | | } |
| | |
| | | |
| | | @Override |
| | | public void updateMediaList(List<StreamPushItem> streamPushItems) { |
| | | if (streamPushItems == null || streamPushItems.size() == 0) return; |
| | | if (streamPushItems == null || streamPushItems.size() == 0) { |
| | | return; |
| | | } |
| | | logger.info("updateMediaList: " + streamPushItems.size()); |
| | | streamPushMapper.addAll(streamPushItems); |
| | | // TODO 待优化 |