refactor(video): JT1078 模块未迁移时的软依赖降级收敛
- JT1078 相关两个 stub 接口 Ijt1078Service / Ijt1078PlayService 目前没有 @Service 实现(等待从 WVP 后续迁移),直接 @Autowired 会导致 video server 启动失败。 - GbChannelPlayServiceImpl:原本只声明了 jt1078PlayService 字段, 从未在任何方法体里引用,属于死代码,直接删掉 import + field。 - MediaServiceImpl:保留引用(checkStreamFromJt 有真实调用), 改成 @Autowired(required=false) 做软依赖;在 "1078" app 分支 入口加 null guard,接口缺失时直接返回 false 拒绝请求; 补注释说明两处处理不对称的原因,并留 TODO 指向 JT1078 迁移完成后的收尾动作(去掉 required=false / 引入 JtModuleProperties.enabled 开关统一管理)。
This commit is contained in:
@@ -10,7 +10,6 @@ import com.viewsh.module.video.gb28181.service.IGbChannelPlayService;
|
||||
import com.viewsh.module.video.gb28181.service.ISourceDownloadService;
|
||||
import com.viewsh.module.video.gb28181.service.ISourcePlayService;
|
||||
import com.viewsh.module.video.gb28181.service.ISourcePlaybackService;
|
||||
import com.viewsh.module.video.jt1078.service.Ijt1078PlayService;
|
||||
import com.viewsh.module.video.service.bean.ErrorCallback;
|
||||
import com.viewsh.module.video.service.bean.InviteErrorCode;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -34,9 +33,6 @@ public class GbChannelPlayServiceImpl implements IGbChannelPlayService {
|
||||
@Autowired
|
||||
private Map<String, ISourcePlayService> sourcePlayServiceMap;
|
||||
|
||||
@Autowired
|
||||
private Ijt1078PlayService jt1078PlayService;
|
||||
|
||||
@Autowired
|
||||
private Map<String, ISourcePlaybackService> sourcePlaybackServiceMap;
|
||||
|
||||
|
||||
@@ -62,10 +62,16 @@ public class MediaServiceImpl implements IMediaService {
|
||||
@Autowired
|
||||
private SipInviteSessionManager sessionManager;
|
||||
|
||||
@Autowired
|
||||
// JT1078 模块尚未从 WVP 原始代码迁移过来:
|
||||
// - Ijt1078Service / Ijt1078PlayService 是 stub 接口,当前没有 @Service 实现
|
||||
// - GbChannelPlayServiceImpl 已彻底删除对这两个接口的依赖(它原本的字段就没在方法体里用过)
|
||||
// - 本类是唯一仍然需要这两个接口的地方,用 required=false 做软依赖,接口缺失时走下方 null guard
|
||||
// 直接拒绝"1078" app 的请求(见 checkStreamFromJt 调用点)
|
||||
// TODO(JT1078 迁移完成后):去掉 required=false,把 null guard 改回强校验;或引入 JtModuleProperties.enabled 开关统一管理。
|
||||
@Autowired(required = false)
|
||||
private Ijt1078Service ijt1078Service;
|
||||
|
||||
@Autowired
|
||||
@Autowired(required = false)
|
||||
private Ijt1078PlayService jt1078PlayService;
|
||||
|
||||
@Autowired
|
||||
@@ -259,6 +265,10 @@ public class MediaServiceImpl implements IMediaService {
|
||||
return result;
|
||||
}
|
||||
}else if ("1078".equals(app)) {
|
||||
// JT1078 模块未迁移时直接拒绝
|
||||
if (ijt1078Service == null || jt1078PlayService == null) {
|
||||
return false;
|
||||
}
|
||||
// 判断是否是1078播放类型
|
||||
JTMediaStreamType jtMediaStreamType = ijt1078Service.checkStreamFromJt(stream);
|
||||
if (jtMediaStreamType != null) {
|
||||
|
||||
Reference in New Issue
Block a user