临时提交

This commit is contained in:
panlinlin
2024-08-10 23:27:21 +08:00
parent d8d9f76d89
commit 76a0d248ef
65 changed files with 421 additions and 601 deletions

View File

@@ -22,9 +22,9 @@ public interface IRedisCatchStorage {
*/
Long getCSEQ();
void updatePlatformCatchInfo(ParentPlatformCatch parentPlatformCatch);
void updatePlatformCatchInfo(PlatformCatch parentPlatformCatch);
ParentPlatformCatch queryPlatformCatchInfo(String platformGbId);
PlatformCatch queryPlatformCatchInfo(String platformGbId);
void delPlatformCatchInfo(String platformGbId);
@@ -208,9 +208,9 @@ public interface IRedisCatchStorage {
void sendChannelAddOrDelete(String deviceId, String channelId, boolean add);
void sendPlatformStartPlayMsg(SendRtpItem sendRtpItem, ParentPlatform platform);
void sendPlatformStartPlayMsg(SendRtpItem sendRtpItem, Platform platform);
void sendPlatformStopPlayMsg(SendRtpItem sendRtpItem, ParentPlatform platform);
void sendPlatformStopPlayMsg(SendRtpItem sendRtpItem, Platform platform);
void addPushListItem(String app, String stream, MediaInfo param);

View File

@@ -20,26 +20,26 @@ public interface IVideoManagerStorage {
* 更新上级平台
* @param parentPlatform
*/
boolean updateParentPlatform(ParentPlatform parentPlatform);
boolean updateParentPlatform(Platform parentPlatform);
/**
* 删除上级平台
* @param parentPlatform
*/
boolean deleteParentPlatform(ParentPlatform parentPlatform);
boolean deleteParentPlatform(Platform parentPlatform);
/**
* 获取所有已启用的平台
* @return
*/
List<ParentPlatform> queryEnableParentPlatformList(boolean enable);
List<Platform> queryEnableParentPlatformList(boolean enable);
/**
* 获取上级平台
* @param platformGbId
* @return
*/
ParentPlatform queryParentPlatByServerGBId(String platformGbId);
Platform queryParentPlatByServerGBId(String platformGbId);
/**
* 移除上级平台的通道信息
@@ -95,12 +95,12 @@ public interface IVideoManagerStorage {
int updateStreamGPS(List<GPSMsgInfo> gpsMsgInfo);
List<ParentPlatform> queryPlatFormListForGBWithGBId(String channelId, List<String> platforms);
List<Platform> queryPlatFormListForGBWithGBId(String channelId, List<String> platforms);
void delRelationByPlatformId(String serverGBId);
List<ChannelSourceInfo> getChannelSource(String platformId, String gbId);
List<ParentPlatform> queryEnablePlatformListWithAsMessageChannel();
List<Platform> queryEnablePlatformListWithAsMessageChannel();
}

View File

@@ -89,14 +89,14 @@ public class RedisCatchStorageImpl implements IRedisCatchStorage {
}
@Override
public void updatePlatformCatchInfo(ParentPlatformCatch parentPlatformCatch) {
public void updatePlatformCatchInfo(PlatformCatch parentPlatformCatch) {
String key = VideoManagerConstants.PLATFORM_CATCH_PREFIX + userSetting.getServerId() + "_" + parentPlatformCatch.getId();
redisTemplate.opsForValue().set(key, parentPlatformCatch);
}
@Override
public ParentPlatformCatch queryPlatformCatchInfo(String platformGbId) {
return (ParentPlatformCatch)redisTemplate.opsForValue().get(VideoManagerConstants.PLATFORM_CATCH_PREFIX + userSetting.getServerId() + "_" + platformGbId);
public PlatformCatch queryPlatformCatchInfo(String platformGbId) {
return (PlatformCatch)redisTemplate.opsForValue().get(VideoManagerConstants.PLATFORM_CATCH_PREFIX + userSetting.getServerId() + "_" + platformGbId);
}
@Override
@@ -662,7 +662,7 @@ public class RedisCatchStorageImpl implements IRedisCatchStorage {
}
@Override
public void sendPlatformStartPlayMsg(SendRtpItem sendRtpItem, ParentPlatform platform) {
public void sendPlatformStartPlayMsg(SendRtpItem sendRtpItem, Platform platform) {
if (sendRtpItem.getPlayType() == InviteStreamType.PUSH && platform != null) {
MessageForPushChannel messageForPushChannel = MessageForPushChannel.getInstance(0, sendRtpItem.getApp(), sendRtpItem.getStream(),
sendRtpItem.getChannelId(), platform.getServerGBId(), platform.getName(), userSetting.getServerId(),
@@ -675,7 +675,7 @@ public class RedisCatchStorageImpl implements IRedisCatchStorage {
}
@Override
public void sendPlatformStopPlayMsg(SendRtpItem sendRtpItem, ParentPlatform platform) {
public void sendPlatformStopPlayMsg(SendRtpItem sendRtpItem, Platform platform) {
MessageForPushChannel msg = MessageForPushChannel.getInstance(0,
sendRtpItem.getApp(), sendRtpItem.getStream(), sendRtpItem.getChannelId(),

View File

@@ -56,7 +56,7 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage {
private DeviceMobilePositionMapper deviceMobilePositionMapper;
@Autowired
private ParentPlatformMapper platformMapper;
private PlatformMapper platformMapper;
@Autowired
private IRedisCatchStorage redisCatchStorage;
@@ -91,27 +91,27 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage {
}
@Override
public boolean updateParentPlatform(ParentPlatform parentPlatform) {
public boolean updateParentPlatform(Platform parentPlatform) {
int result = 0;
if (parentPlatform.getCatalogGroup() == 0) {
parentPlatform.setCatalogGroup(1);
}
ParentPlatformCatch parentPlatformCatch = redisCatchStorage.queryPlatformCatchInfo(parentPlatform.getServerGBId()); // .getDeviceGBId());
PlatformCatch parentPlatformCatch = redisCatchStorage.queryPlatformCatchInfo(parentPlatform.getServerGBId()); // .getDeviceGBId());
if (parentPlatform.getId() == null ) {
if (parentPlatform.getCatalogId() == null) {
parentPlatform.setCatalogId(parentPlatform.getServerGBId());
}
result = platformMapper.addParentPlatform(parentPlatform);
if (parentPlatformCatch == null) {
parentPlatformCatch = new ParentPlatformCatch();
parentPlatformCatch = new PlatformCatch();
parentPlatformCatch.setParentPlatform(parentPlatform);
parentPlatformCatch.setId(parentPlatform.getServerGBId());
}
}else {
if (parentPlatformCatch == null) { // serverGBId 已变化
ParentPlatform parentPlatById = platformMapper.getParentPlatById(parentPlatform.getId());
Platform parentPlatById = platformMapper.getParentPlatById(parentPlatform.getId());
// 使用旧的查出缓存ID
parentPlatformCatch = new ParentPlatformCatch();
parentPlatformCatch = new PlatformCatch();
parentPlatformCatch.setId(parentPlatform.getServerGBId());
redisCatchStorage.delPlatformCatchInfo(parentPlatById.getServerGBId());
}
@@ -127,7 +127,7 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage {
@Transactional
@Override
public boolean deleteParentPlatform(ParentPlatform parentPlatform) {
public boolean deleteParentPlatform(Platform parentPlatform) {
int result = platformMapper.delParentPlatform(parentPlatform);
// 删除关联的通道
platformChannelMapper.cleanChannelForGB(parentPlatform.getServerGBId());
@@ -135,17 +135,17 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage {
}
@Override
public ParentPlatform queryParentPlatByServerGBId(String platformGbId) {
public Platform queryParentPlatByServerGBId(String platformGbId) {
return platformMapper.getParentPlatByServerGBId(platformGbId);
}
@Override
public List<ParentPlatform> queryEnableParentPlatformList(boolean enable) {
public List<Platform> queryEnableParentPlatformList(boolean enable) {
return platformMapper.getEnableParentPlatformList(enable);
}
@Override
public List<ParentPlatform> queryEnablePlatformListWithAsMessageChannel() {
public List<Platform> queryEnablePlatformListWithAsMessageChannel() {
return platformMapper.queryEnablePlatformListWithAsMessageChannel();
}
@@ -266,29 +266,8 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage {
return gbStreamMapper.updateStreamGPS(gpsMsgInfos);
}
private DeviceChannel getDeviceChannelByCatalog(PlatformCatalog catalog) {
ParentPlatform platform = platformMapper.getParentPlatByServerGBId(catalog.getPlatformId());
DeviceChannel deviceChannel = new DeviceChannel();
deviceChannel.setDeviceId(catalog.getId());
deviceChannel.setName(catalog.getName());
deviceChannel.setDeviceId(platform.getDeviceGBId());
deviceChannel.setManufacturer("wvp-pro");
deviceChannel.setStatus("ON");
deviceChannel.setParental(1);
deviceChannel.setRegisterWay(1);
deviceChannel.setParentId(catalog.getParentId());
deviceChannel.setBusinessGroupId(catalog.getBusinessGroupId());
deviceChannel.setModel("live");
deviceChannel.setOwner("wvp-pro");
deviceChannel.setSecrecy(0);
return deviceChannel;
}
@Override
public List<ParentPlatform> queryPlatFormListForGBWithGBId(String channelId, List<String> platforms) {
public List<Platform> queryPlatFormListForGBWithGBId(String channelId, List<String> platforms) {
return platformChannelMapper.queryPlatFormListForGBWithGBId(channelId, platforms);
}