移除共享所有直播流功能

This commit is contained in:
648540858
2022-07-19 17:46:16 +08:00
parent 7f5a18d6b5
commit 9e397ba9f6
12 changed files with 36 additions and 155 deletions

View File

@@ -156,24 +156,6 @@ public class StreamProxyServiceImpl implements IStreamProxyService {
result.append(", 关联国标平台[ " + param.getPlatformGbId() + " ]失败");
}
}
if (!StringUtils.isEmpty(param.getGbId())) {
// 查找开启了全部直播流共享的上级平台
List<ParentPlatform> parentPlatforms = parentPlatformMapper.selectAllAhareAllLiveStream();
if (parentPlatforms.size() > 0) {
for (ParentPlatform parentPlatform : parentPlatforms) {
param.setPlatformId(parentPlatform.getServerGBId());
param.setCatalogId(parentPlatform.getCatalogId());
String stream = param.getStream();
StreamProxyItem streamProxyItems = platformGbStreamMapper.selectOne(param.getApp(), stream, parentPlatform.getServerGBId());
if (streamProxyItems == null) {
platformGbStreamMapper.add(param);
eventPublisher.catalogEventPublishForStream(parentPlatform.getServerGBId(), param, CatalogEvent.ADD);
}
}
}
}
wvpResult.setMsg(result.toString());
return wvpResult;
}

View File

@@ -134,29 +134,6 @@ public class StreamPushServiceImpl implements IStreamPushService {
stream.setStatus(true);
stream.setCreateTime(DateUtil.getNow());
int add = gbStreamMapper.add(stream);
// 查找开启了全部直播流共享的上级平台
List<ParentPlatform> parentPlatforms = parentPlatformMapper.selectAllAhareAllLiveStream();
if (parentPlatforms.size() > 0) {
for (ParentPlatform parentPlatform : parentPlatforms) {
stream.setCatalogId(parentPlatform.getCatalogId());
stream.setPlatformId(parentPlatform.getServerGBId());
String streamId = stream.getStream();
StreamProxyItem streamProxyItem = platformGbStreamMapper.selectOne(stream.getApp(), streamId, parentPlatform.getServerGBId());
if (streamProxyItem == null) {
platformGbStreamMapper.add(stream);
eventPublisher.catalogEventPublishForStream(parentPlatform.getServerGBId(), stream, CatalogEvent.ADD);
}else {
if (!streamProxyItem.getGbId().equals(stream.getGbId())) {
// 此流使用另一个国标Id已经与该平台关联移除此记录
platformGbStreamMapper.delByAppAndStreamAndPlatform(stream.getApp(), streamId, parentPlatform.getServerGBId());
platformGbStreamMapper.add(stream);
eventPublisher.catalogEventPublishForStream(parentPlatform.getServerGBId(), stream, CatalogEvent.ADD);
}
}
}
}
return add > 0;
}
@@ -345,31 +322,6 @@ public class StreamPushServiceImpl implements IStreamPushService {
public void batchAdd(List<StreamPushItem> streamPushItems) {
streamPushMapper.addAll(streamPushItems);
gbStreamMapper.batchAdd(streamPushItems);
// 查找开启了全部直播流共享的上级平台
List<ParentPlatform> parentPlatforms = parentPlatformMapper.selectAllAhareAllLiveStream();
if (parentPlatforms.size() > 0) {
for (StreamPushItem stream : streamPushItems) {
for (ParentPlatform parentPlatform : parentPlatforms) {
stream.setCatalogId(parentPlatform.getCatalogId());
stream.setPlatformId(parentPlatform.getServerGBId());
String streamId = stream.getStream();
StreamProxyItem streamProxyItem = platformGbStreamMapper.selectOne(stream.getApp(), streamId, parentPlatform.getServerGBId());
if (streamProxyItem == null) {
platformGbStreamMapper.add(stream);
eventPublisher.catalogEventPublishForStream(parentPlatform.getServerGBId(), stream, CatalogEvent.ADD);
}else {
if (!streamProxyItem.getGbId().equals(stream.getGbId())) {
// 此流使用另一个国标Id已经与该平台关联移除此记录
platformGbStreamMapper.delByAppAndStreamAndPlatform(stream.getApp(), streamId, parentPlatform.getServerGBId());
platformGbStreamMapper.add(stream);
eventPublisher.catalogEventPublishForStream(parentPlatform.getServerGBId(), stream, CatalogEvent.ADD);
stream.setGbId(streamProxyItem.getGbId());
eventPublisher.catalogEventPublishForStream(parentPlatform.getServerGBId(), stream, CatalogEvent.DEL);
}
}
}
}
}
}
@Override