| | |
| | | */ |
| | | @Override |
| | | public synchronized boolean updateDevice(Device device) { |
| | | String now = this.format.format(new Date(System.currentTimeMillis())); |
| | | String now = this.format.format(System.currentTimeMillis()); |
| | | device.setUpdateTime(now); |
| | | Device deviceByDeviceId = deviceMapper.getDeviceByDeviceId(device.getDeviceId()); |
| | | if (deviceByDeviceId == null) { |
| | |
| | | String channelId = channel.getChannelId(); |
| | | channel.setDeviceId(deviceId); |
| | | channel.setStreamId(streamSession.getStreamId(deviceId, channel.getChannelId())); |
| | | String now = this.format.format(new Date(System.currentTimeMillis())); |
| | | String now = this.format.format(System.currentTimeMillis()); |
| | | channel.setUpdateTime(now); |
| | | DeviceChannel deviceChannel = deviceChannelMapper.queryChannel(deviceId, channelId); |
| | | if (deviceChannel == null) { |
| | |
| | | boolean result = false; |
| | | streamProxyItem.setStreamType("proxy"); |
| | | streamProxyItem.setStatus(true); |
| | | String now = this.format.format(new Date(System.currentTimeMillis())); |
| | | String now = this.format.format(System.currentTimeMillis()); |
| | | streamProxyItem.setCreateTime(now); |
| | | try { |
| | | if (gbStreamMapper.add(streamProxyItem)<0 || streamProxyMapper.add(streamProxyItem) < 0) { |
| | |
| | | |
| | | @Override |
| | | public void updateMediaServer(MediaServerItem mediaServerItem) { |
| | | String now = this.format.format(new Date(System.currentTimeMillis())); |
| | | String now = this.format.format(System.currentTimeMillis()); |
| | | mediaServerItem.setUpdateTime(now); |
| | | if (mediaServerMapper.queryOne(mediaServerItem.getId()) != null) { |
| | | mediaServerMapper.update(mediaServerItem); |
| | |
| | | public List<StreamProxyItem> getStreamProxyListForEnableInMediaServer(String id, boolean enable) { |
| | | return streamProxyMapper.selectForEnableInMediaServer(id, enable); |
| | | } |
| | | |
| | | @Override |
| | | public Device queryVideoDeviceByChannelId(String channelId) { |
| | | Device result = null; |
| | | List<DeviceChannel> channelList = deviceChannelMapper.queryChannelByChannelId(channelId); |
| | | if (channelList.size() == 1) { |
| | | result = deviceMapper.getDeviceByDeviceId(channelList.get(0).getDeviceId()); |
| | | } |
| | | return result; |
| | | } |
| | | } |