临时提交

结构优化
648540858 2024-02-02 16:11:44 +08:00
parent 241fa9030a
commit 0f23c3bb46
5 changed files with 23 additions and 10 deletions

View File

@ -101,4 +101,5 @@ public interface IStreamProxyService {
* *
*/ */
StreamProxy getStreamProxyByCommonGbChannelId(int commonGbId); StreamProxy getStreamProxyByCommonGbChannelId(int commonGbId);
} }

View File

@ -552,4 +552,9 @@ public class StreamPushServiceImpl implements IStreamPushService {
} }
} }
} }
@Override
public StreamPush getPushByCommonChannelId(int commonGbId) {
return streamPushMapper.getOneByCommonChannelId(commonGbId);
}
} }

View File

@ -660,7 +660,7 @@ public interface CommonChannelMapper {
"</script>") "</script>")
List<CommonGbChannel> getAll(); List<CommonGbChannel> 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); CommonGbChannel getOne(@Param("commonGbChannelId") int commonGbChannelId);
@Select("<script> "+ @Select("<script> "+

View File

@ -202,4 +202,7 @@ public interface StreamPushMapper {
"</foreach>" + "</foreach>" +
"</script>") "</script>")
int delAllByIds(List<Integer> streamPushIdList); int delAllByIds(List<Integer> streamPushIdList);
@Select("select * from wvp_stream_push where common_gb_channel_id = #{commonGbId}")
StreamPush getOneByCommonChannelId(@Param("commonGbId") int commonGbId);
} }

View File

@ -383,15 +383,19 @@ public class CommonChannelController {
if (commonGbChannel == null) { if (commonGbChannel == null) {
throw new ControllerException(ErrorCode.ERROR100.getCode(), "通道不存在"); throw new ControllerException(ErrorCode.ERROR100.getCode(), "通道不存在");
} }
if (commonGbChannel.getType().equals(CommonGbChannelType.GB28181)) { switch (commonGbChannel.getType()) {
case CommonGbChannelType.GB28181:
DeviceChannel deviceChannel = deviceChannelService.getChannelByCommonChannelId(commonGbChannel.getCommonGbId()); DeviceChannel deviceChannel = deviceChannelService.getChannelByCommonChannelId(commonGbChannel.getCommonGbId());
resultMap.put(CommonGbChannelType.GB28181, deviceChannel); resultMap.put(CommonGbChannelType.GB28181, deviceChannel);
}else if (commonGbChannel.getType().equals(CommonGbChannelType.PUSH)) { break;
case CommonGbChannelType.PUSH:
StreamPush streamPush = streamPushService.getPushByCommonChannelId(commonGbChannel.getCommonGbId()); StreamPush streamPush = streamPushService.getPushByCommonChannelId(commonGbChannel.getCommonGbId());
resultMap.put(CommonGbChannelType.PUSH, streamPush); resultMap.put(CommonGbChannelType.PUSH, streamPush);
}else if (commonGbChannel.getType().equals(CommonGbChannelType.PROXY)) { break;
StreamProxy streamProxy = streamProxyService.getProxyByCommonChnanelId(commonGbChannel.getCommonGbId()); case CommonGbChannelType.PROXY:
StreamProxy streamProxy = streamProxyService.getStreamProxyByCommonGbChannelId(commonGbChannel.getCommonGbId());
resultMap.put(CommonGbChannelType.PROXY, streamProxy); resultMap.put(CommonGbChannelType.PROXY, streamProxy);
break;
} }
return resultMap; return resultMap;
} }