diff --git a/src/main/java/com/genersoft/iot/vmp/service/IStreamProxyService.java b/src/main/java/com/genersoft/iot/vmp/service/IStreamProxyService.java index 69ac7da1..7036ec8e 100755 --- a/src/main/java/com/genersoft/iot/vmp/service/IStreamProxyService.java +++ b/src/main/java/com/genersoft/iot/vmp/service/IStreamProxyService.java @@ -101,4 +101,5 @@ public interface IStreamProxyService { * 根据通用通道查询拉流代理 */ StreamProxy getStreamProxyByCommonGbChannelId(int commonGbId); + } diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/StreamPushServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/StreamPushServiceImpl.java index 1a1a99de..a59535e8 100755 --- a/src/main/java/com/genersoft/iot/vmp/service/impl/StreamPushServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/service/impl/StreamPushServiceImpl.java @@ -552,4 +552,9 @@ public class StreamPushServiceImpl implements IStreamPushService { } } } + + @Override + public StreamPush getPushByCommonChannelId(int commonGbId) { + return streamPushMapper.getOneByCommonChannelId(commonGbId); + } } diff --git a/src/main/java/com/genersoft/iot/vmp/storager/dao/CommonChannelMapper.java b/src/main/java/com/genersoft/iot/vmp/storager/dao/CommonChannelMapper.java index 7e74137a..4600eb29 100644 --- a/src/main/java/com/genersoft/iot/vmp/storager/dao/CommonChannelMapper.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/dao/CommonChannelMapper.java @@ -660,7 +660,7 @@ public interface CommonChannelMapper { "") List getAll(); - @Select("SELECT common_gb_id FROM wvp_common_channel WHERE common_gb_id = #{commonGbChannelId}") + @Select("SELECT * FROM wvp_common_channel WHERE common_gb_id = #{commonGbChannelId}") CommonGbChannel getOne(@Param("commonGbChannelId") int commonGbChannelId); @Select("") int delAllByIds(List streamPushIdList); + + @Select("select * from wvp_stream_push where common_gb_channel_id = #{commonGbId}") + StreamPush getOneByCommonChannelId(@Param("commonGbId") int commonGbId); } diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/channel/CommonChannelController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/channel/CommonChannelController.java index d1ff9f8d..0cb5976d 100755 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/channel/CommonChannelController.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/channel/CommonChannelController.java @@ -383,15 +383,19 @@ public class CommonChannelController { if (commonGbChannel == null) { throw new ControllerException(ErrorCode.ERROR100.getCode(), "通道不存在"); } - if (commonGbChannel.getType().equals(CommonGbChannelType.GB28181)) { - DeviceChannel deviceChannel = deviceChannelService.getChannelByCommonChannelId(commonGbChannel.getCommonGbId()); - resultMap.put(CommonGbChannelType.GB28181, deviceChannel); - }else if (commonGbChannel.getType().equals(CommonGbChannelType.PUSH)) { - StreamPush streamPush = streamPushService.getPushByCommonChannelId(commonGbChannel.getCommonGbId()); - resultMap.put(CommonGbChannelType.PUSH, streamPush); - }else if (commonGbChannel.getType().equals(CommonGbChannelType.PROXY)) { - StreamProxy streamProxy = streamProxyService.getProxyByCommonChnanelId(commonGbChannel.getCommonGbId()); - resultMap.put(CommonGbChannelType.PROXY, streamProxy); + switch (commonGbChannel.getType()) { + case CommonGbChannelType.GB28181: + DeviceChannel deviceChannel = deviceChannelService.getChannelByCommonChannelId(commonGbChannel.getCommonGbId()); + resultMap.put(CommonGbChannelType.GB28181, deviceChannel); + break; + case CommonGbChannelType.PUSH: + StreamPush streamPush = streamPushService.getPushByCommonChannelId(commonGbChannel.getCommonGbId()); + resultMap.put(CommonGbChannelType.PUSH, streamPush); + break; + case CommonGbChannelType.PROXY: + StreamProxy streamProxy = streamProxyService.getStreamProxyByCommonGbChannelId(commonGbChannel.getCommonGbId()); + resultMap.put(CommonGbChannelType.PROXY, streamProxy); + break; } return resultMap; }