From 88c021948f9e366cc452f779ebaae2443ebba570 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: Thu, 27 Jun 2024 18:41:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=B4=E6=97=B6=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../request/impl/InviteRequestProcessor.java | 6 +-- .../MediaServerStatusEventListener.java | 2 +- .../vmp/media/zlm/ZLMHttpHookListener.java | 1 + .../vmp/service/impl/MediaServiceImpl.java | 3 +- .../vmp/storager/IVideoManagerStorage.java | 2 +- .../iot/vmp/storager/dao/GbStreamMapper.java | 2 +- .../storager/dao/PlatformGbStreamMapper.java | 2 +- .../storager/impl/RedisCatchStorageImpl.java | 1 - .../impl/VideoManagerStorageImpl.java | 3 +- .../dto => streamProxy/bean}/StreamProxy.java | 2 +- .../controller}/StreamProxyController.java | 6 +-- .../dao/StreamProxyMapper.java | 4 +- .../service/IStreamProxyService.java | 6 +-- .../service/impl/StreamProxyServiceImpl.java | 40 +++++++++---------- .../gb28181/media/MediaController.java | 3 +- .../vmp/vmanager/server/ServerController.java | 1 + 16 files changed, 42 insertions(+), 42 deletions(-) rename src/main/java/com/genersoft/iot/vmp/{media/zlm/dto => streamProxy/bean}/StreamProxy.java (97%) rename src/main/java/com/genersoft/iot/vmp/{vmanager/streamProxy => streamProxy/controller}/StreamProxyController.java (97%) rename src/main/java/com/genersoft/iot/vmp/{storager => streamProxy}/dao/StreamProxyMapper.java (97%) rename src/main/java/com/genersoft/iot/vmp/{ => streamProxy}/service/IStreamProxyService.java (92%) rename src/main/java/com/genersoft/iot/vmp/{ => streamProxy}/service/impl/StreamProxyServiceImpl.java (94%) diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/InviteRequestProcessor.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/InviteRequestProcessor.java index 82b145c6..531bf2dc 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/InviteRequestProcessor.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/InviteRequestProcessor.java @@ -25,13 +25,11 @@ import com.genersoft.iot.vmp.media.event.hook.Hook; import com.genersoft.iot.vmp.media.event.hook.HookSubscribe; import com.genersoft.iot.vmp.media.event.hook.HookType; import com.genersoft.iot.vmp.media.service.IMediaServerService; -import com.genersoft.iot.vmp.media.zlm.dto.StreamProxy; +import com.genersoft.iot.vmp.streamProxy.bean.StreamProxy; import com.genersoft.iot.vmp.streamPush.bean.StreamPush; -import com.genersoft.iot.vmp.media.zlm.dto.StreamProxyItem; -import com.genersoft.iot.vmp.media.zlm.dto.StreamPushItem; import com.genersoft.iot.vmp.media.zlm.dto.hook.OnStreamChangedHookParam; import com.genersoft.iot.vmp.service.IPlayService; -import com.genersoft.iot.vmp.service.IStreamProxyService; +import com.genersoft.iot.vmp.streamProxy.service.IStreamProxyService; import com.genersoft.iot.vmp.streamPush.service.IStreamPushService; import com.genersoft.iot.vmp.media.zlm.SendRtpPortManager; import com.genersoft.iot.vmp.service.redisMsg.IRedisRpcService; diff --git a/src/main/java/com/genersoft/iot/vmp/media/event/mediaServer/MediaServerStatusEventListener.java b/src/main/java/com/genersoft/iot/vmp/media/event/mediaServer/MediaServerStatusEventListener.java index 1e1fcca1..20c3af37 100755 --- a/src/main/java/com/genersoft/iot/vmp/media/event/mediaServer/MediaServerStatusEventListener.java +++ b/src/main/java/com/genersoft/iot/vmp/media/event/mediaServer/MediaServerStatusEventListener.java @@ -1,7 +1,7 @@ package com.genersoft.iot.vmp.media.event.mediaServer; import com.genersoft.iot.vmp.service.IPlayService; -import com.genersoft.iot.vmp.service.IStreamProxyService; +import com.genersoft.iot.vmp.streamProxy.service.IStreamProxyService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; diff --git a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java index de91ed69..3ec094da 100755 --- a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java +++ b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java @@ -24,6 +24,7 @@ import com.genersoft.iot.vmp.service.*; import com.genersoft.iot.vmp.service.redisMsg.IRedisRpcService; import com.genersoft.iot.vmp.storager.IRedisCatchStorage; import com.genersoft.iot.vmp.storager.IVideoManagerStorage; +import com.genersoft.iot.vmp.streamProxy.service.IStreamProxyService; import com.genersoft.iot.vmp.streamPush.service.IStreamPushService; import com.genersoft.iot.vmp.utils.MediaServerUtils; import org.slf4j.Logger; diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/MediaServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/MediaServiceImpl.java index d3b595d2..ee5e9262 100755 --- a/src/main/java/com/genersoft/iot/vmp/service/impl/MediaServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/service/impl/MediaServiceImpl.java @@ -13,10 +13,11 @@ import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform; import com.genersoft.iot.vmp.media.bean.MediaServer; import com.genersoft.iot.vmp.media.bean.ResultForOnPublish; import com.genersoft.iot.vmp.media.zlm.dto.StreamAuthorityInfo; -import com.genersoft.iot.vmp.media.zlm.dto.StreamProxy; +import com.genersoft.iot.vmp.streamProxy.bean.StreamProxy; import com.genersoft.iot.vmp.service.*; import com.genersoft.iot.vmp.storager.IRedisCatchStorage; import com.genersoft.iot.vmp.storager.IVideoManagerStorage; +import com.genersoft.iot.vmp.streamProxy.service.IStreamProxyService; import com.genersoft.iot.vmp.utils.DateUtil; import com.genersoft.iot.vmp.utils.MediaServerUtils; import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; diff --git a/src/main/java/com/genersoft/iot/vmp/storager/IVideoManagerStorage.java b/src/main/java/com/genersoft/iot/vmp/storager/IVideoManagerStorage.java index fcb2cf9a..5b490156 100755 --- a/src/main/java/com/genersoft/iot/vmp/storager/IVideoManagerStorage.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/IVideoManagerStorage.java @@ -1,7 +1,7 @@ package com.genersoft.iot.vmp.storager; import com.genersoft.iot.vmp.gb28181.bean.*; -import com.genersoft.iot.vmp.media.zlm.dto.StreamProxy; +import com.genersoft.iot.vmp.streamProxy.bean.StreamProxy; import com.genersoft.iot.vmp.service.bean.GPSMsgInfo; import com.genersoft.iot.vmp.storager.dao.dto.ChannelSourceInfo; import com.genersoft.iot.vmp.vmanager.gb28181.platform.bean.ChannelReduce; diff --git a/src/main/java/com/genersoft/iot/vmp/storager/dao/GbStreamMapper.java b/src/main/java/com/genersoft/iot/vmp/storager/dao/GbStreamMapper.java index ab02a6d7..74f3f3ba 100755 --- a/src/main/java/com/genersoft/iot/vmp/storager/dao/GbStreamMapper.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/dao/GbStreamMapper.java @@ -2,7 +2,7 @@ package com.genersoft.iot.vmp.storager.dao; import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel; import com.genersoft.iot.vmp.gb28181.bean.GbStream; -import com.genersoft.iot.vmp.media.zlm.dto.StreamProxy; +import com.genersoft.iot.vmp.streamProxy.bean.StreamProxy; import com.genersoft.iot.vmp.streamPush.bean.StreamPush; import com.genersoft.iot.vmp.service.bean.GPSMsgInfo; import org.apache.ibatis.annotations.*; diff --git a/src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformGbStreamMapper.java b/src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformGbStreamMapper.java index 0dad1174..ddbb8621 100755 --- a/src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformGbStreamMapper.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformGbStreamMapper.java @@ -4,7 +4,7 @@ import com.genersoft.iot.vmp.gb28181.bean.GbStream; import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; import com.genersoft.iot.vmp.gb28181.bean.PlatformCatalog; import com.genersoft.iot.vmp.gb28181.bean.PlatformGbStream; -import com.genersoft.iot.vmp.media.zlm.dto.StreamProxy; +import com.genersoft.iot.vmp.streamProxy.bean.StreamProxy; import com.genersoft.iot.vmp.streamPush.bean.StreamPush; import org.apache.ibatis.annotations.*; import org.springframework.stereotype.Repository; diff --git a/src/main/java/com/genersoft/iot/vmp/storager/impl/RedisCatchStorageImpl.java b/src/main/java/com/genersoft/iot/vmp/storager/impl/RedisCatchStorageImpl.java index 5e05ca7c..dae2ab2c 100755 --- a/src/main/java/com/genersoft/iot/vmp/storager/impl/RedisCatchStorageImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/impl/RedisCatchStorageImpl.java @@ -10,7 +10,6 @@ import com.genersoft.iot.vmp.media.bean.MediaInfo; import com.genersoft.iot.vmp.media.bean.MediaServer; import com.genersoft.iot.vmp.media.event.media.MediaArrivalEvent; import com.genersoft.iot.vmp.media.zlm.dto.StreamAuthorityInfo; -import com.genersoft.iot.vmp.media.zlm.dto.StreamPushItem; import com.genersoft.iot.vmp.media.zlm.dto.hook.OnStreamChangedHookParam; import com.genersoft.iot.vmp.streamPush.bean.StreamPush; import com.genersoft.iot.vmp.service.bean.GPSMsgInfo; diff --git a/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java b/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java index 12c72dcb..c081b0d9 100755 --- a/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java @@ -6,12 +6,13 @@ import com.genersoft.iot.vmp.conf.UserSetting; import com.genersoft.iot.vmp.gb28181.bean.*; import com.genersoft.iot.vmp.gb28181.event.EventPublisher; import com.genersoft.iot.vmp.gb28181.event.subscribe.catalog.CatalogEvent; -import com.genersoft.iot.vmp.media.zlm.dto.StreamProxy; +import com.genersoft.iot.vmp.streamProxy.bean.StreamProxy; import com.genersoft.iot.vmp.service.bean.GPSMsgInfo; import com.genersoft.iot.vmp.storager.IRedisCatchStorage; import com.genersoft.iot.vmp.storager.IVideoManagerStorage; import com.genersoft.iot.vmp.storager.dao.*; import com.genersoft.iot.vmp.storager.dao.dto.ChannelSourceInfo; +import com.genersoft.iot.vmp.streamProxy.dao.StreamProxyMapper; import com.genersoft.iot.vmp.streamPush.dao.StreamPushMapper; import com.genersoft.iot.vmp.utils.DateUtil; import com.genersoft.iot.vmp.vmanager.gb28181.platform.bean.ChannelReduce; diff --git a/src/main/java/com/genersoft/iot/vmp/media/zlm/dto/StreamProxy.java b/src/main/java/com/genersoft/iot/vmp/streamProxy/bean/StreamProxy.java similarity index 97% rename from src/main/java/com/genersoft/iot/vmp/media/zlm/dto/StreamProxy.java rename to src/main/java/com/genersoft/iot/vmp/streamProxy/bean/StreamProxy.java index cb007554..13d521b4 100755 --- a/src/main/java/com/genersoft/iot/vmp/media/zlm/dto/StreamProxy.java +++ b/src/main/java/com/genersoft/iot/vmp/streamProxy/bean/StreamProxy.java @@ -1,4 +1,4 @@ -package com.genersoft.iot.vmp.media.zlm.dto; +package com.genersoft.iot.vmp.streamProxy.bean; import com.genersoft.iot.vmp.gb28181.bean.CommonGBChannel; import io.swagger.v3.oas.annotations.media.Schema; diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/streamProxy/StreamProxyController.java b/src/main/java/com/genersoft/iot/vmp/streamProxy/controller/StreamProxyController.java similarity index 97% rename from src/main/java/com/genersoft/iot/vmp/vmanager/streamProxy/StreamProxyController.java rename to src/main/java/com/genersoft/iot/vmp/streamProxy/controller/StreamProxyController.java index e66d5ecb..c7ad8f6d 100755 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/streamProxy/StreamProxyController.java +++ b/src/main/java/com/genersoft/iot/vmp/streamProxy/controller/StreamProxyController.java @@ -1,4 +1,4 @@ -package com.genersoft.iot.vmp.vmanager.streamProxy; +package com.genersoft.iot.vmp.streamProxy.controller; import com.alibaba.fastjson2.JSONObject; import com.genersoft.iot.vmp.common.StreamInfo; @@ -8,9 +8,9 @@ import com.genersoft.iot.vmp.conf.security.JwtUtils; import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage; import com.genersoft.iot.vmp.media.bean.MediaServer; -import com.genersoft.iot.vmp.media.zlm.dto.StreamProxy; +import com.genersoft.iot.vmp.streamProxy.bean.StreamProxy; import com.genersoft.iot.vmp.media.service.IMediaServerService; -import com.genersoft.iot.vmp.service.IStreamProxyService; +import com.genersoft.iot.vmp.streamProxy.service.IStreamProxyService; import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; import com.genersoft.iot.vmp.vmanager.bean.StreamContent; import com.genersoft.iot.vmp.vmanager.bean.WVPResult; diff --git a/src/main/java/com/genersoft/iot/vmp/storager/dao/StreamProxyMapper.java b/src/main/java/com/genersoft/iot/vmp/streamProxy/dao/StreamProxyMapper.java similarity index 97% rename from src/main/java/com/genersoft/iot/vmp/storager/dao/StreamProxyMapper.java rename to src/main/java/com/genersoft/iot/vmp/streamProxy/dao/StreamProxyMapper.java index 4c0864f6..9044e7c9 100755 --- a/src/main/java/com/genersoft/iot/vmp/storager/dao/StreamProxyMapper.java +++ b/src/main/java/com/genersoft/iot/vmp/streamProxy/dao/StreamProxyMapper.java @@ -1,6 +1,6 @@ -package com.genersoft.iot.vmp.storager.dao; +package com.genersoft.iot.vmp.streamProxy.dao; -import com.genersoft.iot.vmp.media.zlm.dto.StreamProxy; +import com.genersoft.iot.vmp.streamProxy.bean.StreamProxy; import com.genersoft.iot.vmp.vmanager.bean.ResourceBaseInfo; import org.apache.ibatis.annotations.*; import org.springframework.stereotype.Repository; diff --git a/src/main/java/com/genersoft/iot/vmp/service/IStreamProxyService.java b/src/main/java/com/genersoft/iot/vmp/streamProxy/service/IStreamProxyService.java similarity index 92% rename from src/main/java/com/genersoft/iot/vmp/service/IStreamProxyService.java rename to src/main/java/com/genersoft/iot/vmp/streamProxy/service/IStreamProxyService.java index 8cfbd3a9..751c01b9 100755 --- a/src/main/java/com/genersoft/iot/vmp/service/IStreamProxyService.java +++ b/src/main/java/com/genersoft/iot/vmp/streamProxy/service/IStreamProxyService.java @@ -1,9 +1,9 @@ -package com.genersoft.iot.vmp.service; +package com.genersoft.iot.vmp.streamProxy.service; import com.genersoft.iot.vmp.common.GeneralCallback; import com.genersoft.iot.vmp.common.StreamInfo; import com.genersoft.iot.vmp.media.bean.MediaServer; -import com.genersoft.iot.vmp.media.zlm.dto.StreamProxy; +import com.genersoft.iot.vmp.streamProxy.bean.StreamProxy; import com.genersoft.iot.vmp.vmanager.bean.ResourceBaseInfo; import com.genersoft.iot.vmp.vmanager.bean.WVPResult; import com.github.pagehelper.PageInfo; @@ -63,7 +63,7 @@ public interface IStreamProxyService { * @param app * @param stream */ - int updateStatus(boolean status, String app, String stream); + int updateStatusByAppAndStream(String app, String stream, boolean status); diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/StreamProxyServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/streamProxy/service/impl/StreamProxyServiceImpl.java similarity index 94% rename from src/main/java/com/genersoft/iot/vmp/service/impl/StreamProxyServiceImpl.java rename to src/main/java/com/genersoft/iot/vmp/streamProxy/service/impl/StreamProxyServiceImpl.java index f125ac17..57f2749b 100755 --- a/src/main/java/com/genersoft/iot/vmp/service/impl/StreamProxyServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/streamProxy/service/impl/StreamProxyServiceImpl.java @@ -1,4 +1,4 @@ -package com.genersoft.iot.vmp.service.impl; +package com.genersoft.iot.vmp.streamProxy.service.impl; import com.alibaba.fastjson2.JSONObject; import com.baomidou.dynamic.datasource.annotation.DS; @@ -17,18 +17,19 @@ import com.genersoft.iot.vmp.media.event.media.MediaArrivalEvent; import com.genersoft.iot.vmp.media.event.media.MediaDepartureEvent; import com.genersoft.iot.vmp.media.event.media.MediaNotFoundEvent; import com.genersoft.iot.vmp.media.service.IMediaServerService; -import com.genersoft.iot.vmp.media.zlm.dto.StreamProxy; +import com.genersoft.iot.vmp.streamProxy.bean.StreamProxy; import com.genersoft.iot.vmp.service.IGbStreamService; -import com.genersoft.iot.vmp.service.IStreamProxyService; +import com.genersoft.iot.vmp.streamProxy.service.IStreamProxyService; import com.genersoft.iot.vmp.storager.IRedisCatchStorage; import com.genersoft.iot.vmp.storager.IVideoManagerStorage; import com.genersoft.iot.vmp.storager.dao.GbStreamMapper; import com.genersoft.iot.vmp.storager.dao.PlatformGbStreamMapper; -import com.genersoft.iot.vmp.storager.dao.StreamProxyMapper; +import com.genersoft.iot.vmp.streamProxy.dao.StreamProxyMapper; import com.genersoft.iot.vmp.utils.DateUtil; import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; import com.genersoft.iot.vmp.vmanager.bean.ResourceBaseInfo; import com.genersoft.iot.vmp.vmanager.bean.WVPResult; +import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -59,9 +60,6 @@ public class StreamProxyServiceImpl implements IStreamProxyService { private final static Logger logger = LoggerFactory.getLogger(StreamProxyServiceImpl.class); - @Autowired - private IVideoManagerStorage videoManagerStorager; - @Autowired private StreamProxyMapper streamProxyMapper; @@ -105,7 +103,7 @@ public class StreamProxyServiceImpl implements IStreamProxyService { @org.springframework.context.event.EventListener public void onApplicationEvent(MediaArrivalEvent event) { if ("rtsp".equals(event.getSchema())) { - updateStatus(true, event.getApp(), event.getStream()); + updateStatusByAppAndStream(event.getApp(), event.getStream(), true); } } @@ -116,7 +114,7 @@ public class StreamProxyServiceImpl implements IStreamProxyService { @EventListener public void onApplicationEvent(MediaDepartureEvent event) { if ("rtsp".equals(event.getSchema())) { - updateStatus(false, event.getApp(), event.getStream()); + updateStatusByAppAndStream(event.getApp(), event.getStream(), false); } } @@ -185,7 +183,7 @@ public class StreamProxyServiceImpl implements IStreamProxyService { param.setMediaServerId(mediaServer.getId()); boolean saveResult; // 更新 - if (videoManagerStorager.queryStreamProxy(param.getApp(), param.getStream()) != null) { + if (streamProxyMapper.selectOne(param.getApp(), param.getStream()) != null) { saveResult = updateStreamProxy(param); }else { // 新增 saveResult = addStreamProxy(param); @@ -395,19 +393,21 @@ public class StreamProxyServiceImpl implements IStreamProxyService { @Override public PageInfo getAll(Integer page, Integer count) { - return videoManagerStorager.queryStreamProxyList(page, count); + PageHelper.startPage(page, count); + List all = streamProxyMapper.selectAll(); + return new PageInfo<>(all); } @Override public void del(String app, String stream) { - StreamProxy streamProxyItem = videoManagerStorager.queryStreamProxy(app, stream); + StreamProxy streamProxyItem = streamProxyMapper.selectOne(app, stream); if (streamProxyItem != null) { gbStreamService.sendCatalogMsg(streamProxyItem, CatalogEvent.DEL); // 如果关联了国标那么移除关联 platformGbStreamMapper.delByAppAndStream(app, stream); gbStreamMapper.del(app, stream); - videoManagerStorager.deleteStreamProxy(app, stream); + streamProxyMapper.del(app, stream); redisCatchStorage.removeStream(streamProxyItem.getMediaServerId(), "PULL", app, stream); redisCatchStorage.removeStream(streamProxyItem.getMediaServerId(), "PUSH", app, stream); Boolean result = removeStreamProxyFromZlm(streamProxyItem); @@ -422,7 +422,7 @@ public class StreamProxyServiceImpl implements IStreamProxyService { @Override public boolean start(String app, String stream) { boolean result = false; - StreamProxy streamProxy = videoManagerStorager.queryStreamProxy(app, stream); + StreamProxy streamProxy = streamProxyMapper.selectOne(app, stream); if (streamProxy != null && !streamProxy.isEnable() ) { WVPResult wvpResult = addStreamProxyToZlm(streamProxy); if (wvpResult == null) { @@ -445,7 +445,7 @@ public class StreamProxyServiceImpl implements IStreamProxyService { @Override public boolean stop(String app, String stream) { boolean result = false; - StreamProxy streamProxyDto = videoManagerStorager.queryStreamProxy(app, stream); + StreamProxy streamProxyDto = streamProxyMapper.selectOne(app, stream); if (streamProxyDto != null && streamProxyDto.isEnable()) { Boolean removed = removeStreamProxyFromZlm(streamProxyDto); if (removed != null && removed) { @@ -464,7 +464,7 @@ public class StreamProxyServiceImpl implements IStreamProxyService { @Override public StreamProxy getStreamProxyByAppAndStream(String app, String streamId) { - return videoManagerStorager.getStreamProxyByAppAndStream(app, streamId); + return streamProxyMapper.selectOne(app, streamId); } @Override @@ -488,9 +488,9 @@ public class StreamProxyServiceImpl implements IStreamProxyService { if (wvpResult == null) { // 设置为离线 logger.info("恢复流代理失败" + streamProxyDto.getApp() + "/" + streamProxyDto.getStream()); - updateStatus(false, streamProxyDto.getApp(), streamProxyDto.getStream()); + updateStatusByAppAndStream(streamProxyDto.getApp(), streamProxyDto.getStream(), false); }else { - updateStatus(true, streamProxyDto.getApp(), streamProxyDto.getStream()); + updateStatusByAppAndStream(streamProxyDto.getApp(), streamProxyDto.getStream(), true); } } } @@ -530,7 +530,7 @@ public class StreamProxyServiceImpl implements IStreamProxyService { } @Override - public int updateStatus(boolean status, String app, String stream) { + public int updateStatusByAppAndStream(String app, String stream, boolean status) { // 状态变化时推送到国标上级 StreamProxy streamProxyItem = streamProxyMapper.selectOne(app, stream); if (streamProxyItem == null) { @@ -591,7 +591,7 @@ public class StreamProxyServiceImpl implements IStreamProxyService { Map serverItemMap = all.stream().collect(Collectors.toMap(MediaServer::getId, Function.identity(), (m1, m2) -> m1)); - List list = videoManagerStorager.getStreamProxyListForEnable(true); + List list = streamProxyMapper.selectForEnable(true); if (CollectionUtils.isEmpty(list)){ return; diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/media/MediaController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/media/MediaController.java index 26e96857..308c3086 100755 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/media/MediaController.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/media/MediaController.java @@ -7,8 +7,7 @@ import com.genersoft.iot.vmp.conf.security.SecurityUtils; import com.genersoft.iot.vmp.conf.security.dto.LoginUser; import com.genersoft.iot.vmp.media.service.IMediaServerService; import com.genersoft.iot.vmp.media.zlm.dto.StreamAuthorityInfo; -import com.genersoft.iot.vmp.service.IMediaService; -import com.genersoft.iot.vmp.service.IStreamProxyService; +import com.genersoft.iot.vmp.streamProxy.service.IStreamProxyService; import com.genersoft.iot.vmp.storager.IRedisCatchStorage; import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; import com.genersoft.iot.vmp.vmanager.bean.StreamContent; diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/server/ServerController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/server/ServerController.java index e46b2fd6..5532a5e2 100755 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/server/ServerController.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/server/ServerController.java @@ -14,6 +14,7 @@ import com.genersoft.iot.vmp.media.bean.MediaServer; import com.genersoft.iot.vmp.service.*; import com.genersoft.iot.vmp.service.bean.MediaServerLoad; import com.genersoft.iot.vmp.storager.IRedisCatchStorage; +import com.genersoft.iot.vmp.streamProxy.service.IStreamProxyService; import com.genersoft.iot.vmp.streamPush.service.IStreamPushService; import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; import com.genersoft.iot.vmp.vmanager.bean.ResourceBaseInfo;