修复推流推流状态提示

This commit is contained in:
648540858
2022-07-25 11:17:46 +08:00
parent 91dc4566a2
commit c77c1a956c
13 changed files with 67 additions and 179 deletions

View File

@@ -4,6 +4,7 @@ import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelReader;
import com.alibaba.excel.read.metadata.ReadSheet;
import com.genersoft.iot.vmp.common.StreamInfo;
import com.genersoft.iot.vmp.conf.UserSetting;
import com.genersoft.iot.vmp.conf.security.SecurityUtils;
import com.genersoft.iot.vmp.conf.security.dto.LoginUser;
import com.genersoft.iot.vmp.gb28181.bean.GbStream;
@@ -63,6 +64,9 @@ public class StreamPushController {
@Autowired
private IMediaService mediaService;
@Autowired
private UserSetting userSetting;
@ApiOperation("推流列表查询")
@ApiImplicitParams({
@ApiImplicitParam(name="page", value = "当前页", required = true, dataTypeClass = Integer.class),
@@ -269,18 +273,23 @@ public class StreamPushController {
if (userInfo!= null) {
authority = true;
}
StreamInfo streamInfo = mediaService.getStreamInfoByAppAndStreamWithCheck(app, stream, mediaServerId, authority);
WVPResult<StreamInfo> result = new WVPResult<>();
StreamPushItem push = streamPushService.getPush(app, stream);
if (!userSetting.getServerId().equals(push.getServerId()) ) {
result.setCode(-1);
result.setMsg("来自其他平台的推流信息");
return result;
}
StreamInfo streamInfo = mediaService.getStreamInfoByAppAndStreamWithCheck(app, stream, mediaServerId, authority);
if (streamInfo != null){
result.setCode(0);
result.setMsg("scccess");
result.setData(streamInfo);
}else {
result.setCode(-1);
result.setMsg("fail");
result.setMsg("获取播放地址失败");
}
return result;
}