优化分屏监控

This commit is contained in:
648540858
2024-09-12 17:49:16 +08:00
parent 525f325d2b
commit 76ef652e7c
17 changed files with 222 additions and 554 deletions

View File

@@ -84,4 +84,10 @@ public interface StreamProxyMapper {
@SelectProvider(type = StreamProxyProvider.class, method = "select")
StreamProxy select(@Param("id") int id);
@Update("UPDATE wvp_stream_proxy " +
"SET pulling=false, " +
"stream_key = null " +
"WHERE id=#{id}")
void removeStream(@Param("id")int id);
}

View File

@@ -91,7 +91,7 @@ public class StreamProxyPlayServiceImpl implements IStreamProxyPlayService {
streamProxy.setMediaServerId(mediaServer.getId());
streamProxy.setStreamKey(null);
streamProxy.setPulling(false);
streamProxyMapper.update(streamProxy);
streamProxyMapper.removeStream(streamProxy.getId());
}
}

View File

@@ -209,7 +209,8 @@ public class StreamProxyServiceImpl implements IStreamProxyService {
if (streamProxyInDb == null) {
throw new ControllerException(ErrorCode.ERROR100.getCode(), "代理不存在");
}
if (streamProxyMapper.update(streamProxy) > 0 && !ObjectUtils.isEmpty(streamProxy.getGbDeviceId())) {
int updateResult = streamProxyMapper.update(streamProxy);
if (updateResult > 0 && !ObjectUtils.isEmpty(streamProxy.getGbDeviceId())) {
if (streamProxy.getGbId() > 0) {
gbChannelService.update(streamProxy.buildCommonGBChannel());
}else {