1.注释更新现场中update方法的updateSceneReporterStream方法
2.分页数据中page方法的传参,现场类型sceneType默认设置为5
This commit is contained in:
parent
74f5db4988
commit
2cf0a5149b
@ -76,10 +76,10 @@ public class LiveSceneController extends AbstractController {
|
||||
@ApiImplicitParam(value = "页面大小", name = "pageSize", defaultValue = "15",paramType = "query", dataType = "int")})
|
||||
public R page(String title, Integer sceneType, String ltype,Integer liveState, Integer pageNo, Integer pageSize, Long tenantId){
|
||||
if(StringUtils.isNotBlank(ltype) && (ltype=="prod" || ltype.equals("prod"))){
|
||||
Page<SceneEntityVo> page = liveSceneService.pageProd(title, sceneType, ltype,liveState, null==pageNo?0:pageNo, null==pageSize?15:pageSize, tenantId);
|
||||
Page<SceneEntityVo> page = liveSceneService.pageProd(title, 5, ltype,liveState, null==pageNo?0:pageNo, null==pageSize?15:pageSize, tenantId);
|
||||
return R.ok().put("page", page);
|
||||
}else{
|
||||
Page page = liveSceneService.page(title, sceneType, ltype,liveState, null==pageNo?0:pageNo, null==pageSize?15:pageSize, tenantId);
|
||||
Page page = liveSceneService.page(title, 5, ltype,liveState, null==pageNo?0:pageNo, null==pageSize?15:pageSize, tenantId);
|
||||
return R.ok().put("page", page);
|
||||
}
|
||||
}
|
||||
@ -116,7 +116,6 @@ public class LiveSceneController extends AbstractController {
|
||||
@RequiresPermissions("live:livescene:save")
|
||||
@ApiOperation(value = "现场保存接口", notes = "现场保存接口", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public R save(@RequestBody SceneEntityVo liveScene){
|
||||
System.out.println(liveScene.toString());
|
||||
try {
|
||||
liveScene.setCreatorId(null!=getUserId()?getUserId().intValue():null);
|
||||
liveSceneService.save(liveScene);
|
||||
@ -138,11 +137,13 @@ public class LiveSceneController extends AbstractController {
|
||||
@RequiresPermissions("live:livescene:update")
|
||||
@ApiOperation("现场更新接口")
|
||||
@LiveTenant
|
||||
public R update(@ModelAttribute SceneEntityVo liveScene){
|
||||
public R update(@RequestBody SceneEntityVo liveScene){
|
||||
String r = null;
|
||||
try {
|
||||
r = liveSceneService.update(liveScene, getUser());
|
||||
} catch (Exception e) {
|
||||
} catch (RRException e) {
|
||||
return R.error("栏目只能单选");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return R.error("系统内部错误");
|
||||
}
|
||||
|
||||
@ -597,6 +597,14 @@ public class LiveSceneServiceImpl extends ServiceImpl<LiveSceneDao, LiveSceneEnt
|
||||
if (null == liveScene || null == liveScene.getId() || liveScene.getLiveEnd() == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
|
||||
if(liveScene.getChannelIdList().size()>1) {
|
||||
throw new RRException("栏目只能单选");
|
||||
}
|
||||
|
||||
//将现场类型设置为5,混合类型
|
||||
liveScene.setSceneType(SceneConstants.SceneType.MERGE.getKey());
|
||||
|
||||
// 20190221 TROY 更新校验,只读
|
||||
LiveSceneEntity dbScene = this.baseMapper.selectById(liveScene.getId());
|
||||
if (null == dbScene) {
|
||||
@ -631,7 +639,7 @@ public class LiveSceneServiceImpl extends ServiceImpl<LiveSceneDao, LiveSceneEnt
|
||||
dbScene.setTitleImage(entity.getTitleImage());
|
||||
}
|
||||
// END
|
||||
updateSceneReporterStream(dbScene, liveScene.getUserIdList(), liveScene.getLiveEnd());
|
||||
//updateSceneReporterStream(dbScene, liveScene.getUserIdList(), liveScene.getLiveEnd());
|
||||
//修改栏目关系
|
||||
updateSceneChannels(dbScene, liveScene.getChannelIdList());
|
||||
entity.setChannelsName((liveScene.getChannelNameList()==null || liveScene.getChannelNameList().size()==0) ? null : StringUtils.join(liveScene.getChannelNameList().toArray(), ","));
|
||||
@ -659,8 +667,7 @@ public class LiveSceneServiceImpl extends ServiceImpl<LiveSceneDao, LiveSceneEnt
|
||||
if (StringUtils.isBlank(entity.getLiveDescHref())) {
|
||||
entity.setLiveDescHref(" ");
|
||||
}
|
||||
this.baseMapper.updateById(entity);
|
||||
|
||||
this.baseMapper.updateById(entity);
|
||||
// 20190423 TONG 暂时手动更新
|
||||
this.baseMapper.updateByIdSelective(entity, new String[]{"videoUrl", "liveDesc", "sceneMark"});
|
||||
// 20190221 TROY 成品现场更新索引
|
||||
@ -684,41 +691,42 @@ public class LiveSceneServiceImpl extends ServiceImpl<LiveSceneDao, LiveSceneEnt
|
||||
// 成品现场如果修改结束时间需要更新流地址
|
||||
// 20190307 TROY 增加现场类型直播判断
|
||||
String str = "";
|
||||
if (isProduct && SceneConstants.SceneType.isAllowLive(dbScene.getSceneType())
|
||||
&& !liveScene.getLiveEnd().equals(dbScene.getLiveEnd())) {
|
||||
List<LiveSceneLiveInfoEntity> infoEntities = liveSceneLiveInfoService
|
||||
.selectList(new EntityWrapper<LiveSceneLiveInfoEntity>().eq("scene_id", entity.getId()));
|
||||
|
||||
// 更新现场源地址
|
||||
if (infoEntities != null) {
|
||||
for (LiveSceneLiveInfoEntity infoEntity : infoEntities) {
|
||||
if(infoEntity==null || infoEntity.getId()==null || infoEntity.getPushState().equals(1)){
|
||||
if(StringUtils.isNotBlank(str)){
|
||||
str += ",";
|
||||
}
|
||||
str += infoEntity.getInfoName();
|
||||
continue;
|
||||
}
|
||||
LiveStreams streams = liveClient.liveStream().generateStreamUrls(infoEntity.getAppName(),
|
||||
infoEntity.getStreamName(), entity.getLiveEnd());
|
||||
LiveSceneLiveInfoExtEntity extEntity = liveSceneLiveInfoExtService
|
||||
.selectByInfoId(infoEntity.getId());
|
||||
if (extEntity != null) {
|
||||
extEntity.setPushUrl(streams.getPushStreamUrl());
|
||||
extEntity.setPlayUrlRmtp(streams.getLiveStreamUrls()[0]);
|
||||
extEntity.setPlayUrlFlv(streams.getLiveStreamUrls()[1]);
|
||||
extEntity.setPlayUrlHls(streams.getLiveStreamUrls()[2]);
|
||||
liveSceneLiveInfoExtService.updateById(extEntity);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
if(StringUtils.isNotBlank(str)){
|
||||
str = "现场修改成功,但流名称为:"+str + "正在直播中,直播流的有效期不能进行修改";
|
||||
}else{
|
||||
str = "现场修改成功";
|
||||
}
|
||||
// if (isProduct && SceneConstants.SceneType.isAllowLive(dbScene.getSceneType())
|
||||
// && !liveScene.getLiveEnd().equals(dbScene.getLiveEnd())) {
|
||||
// List<LiveSceneLiveInfoEntity> infoEntities = liveSceneLiveInfoService
|
||||
// .selectList(new EntityWrapper<LiveSceneLiveInfoEntity>().eq("scene_id", entity.getId()));
|
||||
//
|
||||
// // 更新现场源地址
|
||||
// if (infoEntities != null) {
|
||||
// for (LiveSceneLiveInfoEntity infoEntity : infoEntities) {
|
||||
// if(infoEntity==null || infoEntity.getId()==null || infoEntity.getPushState().equals(1)){
|
||||
// if(StringUtils.isNotBlank(str)){
|
||||
// str += ",";
|
||||
// }
|
||||
// str += infoEntity.getInfoName();
|
||||
// continue;
|
||||
// }
|
||||
// LiveStreams streams = liveClient.liveStream().generateStreamUrls(infoEntity.getAppName(),
|
||||
// infoEntity.getStreamName(), entity.getLiveEnd());
|
||||
// LiveSceneLiveInfoExtEntity extEntity = liveSceneLiveInfoExtService
|
||||
// .selectByInfoId(infoEntity.getId());
|
||||
// if (extEntity != null) {
|
||||
// extEntity.setPushUrl(streams.getPushStreamUrl());
|
||||
// extEntity.setPlayUrlRmtp(streams.getLiveStreamUrls()[0]);
|
||||
// extEntity.setPlayUrlFlv(streams.getLiveStreamUrls()[1]);
|
||||
// extEntity.setPlayUrlHls(streams.getLiveStreamUrls()[2]);
|
||||
// liveSceneLiveInfoExtService.updateById(extEntity);
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// if(StringUtils.isNotBlank(str)){
|
||||
// str = "现场修改成功,但流名称为:"+str + "正在直播中,直播流的有效期不能进行修改";
|
||||
// }else{
|
||||
// str = "现场修改成功";
|
||||
// }
|
||||
str = "现场修改成功";
|
||||
return str;
|
||||
}
|
||||
|
||||
@ -2510,6 +2518,11 @@ public class LiveSceneServiceImpl extends ServiceImpl<LiveSceneDao, LiveSceneEnt
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新现场栏目
|
||||
* @param liveScene 数据库中获取的
|
||||
* @param channelsId 前端传参
|
||||
*/
|
||||
private void updateSceneChannels(LiveSceneEntity liveScene, List<Integer> channelsId) {
|
||||
List<LiveSceneChannelEntity> entityList = liveSceneChannelService.selectList(new EntityWrapper<LiveSceneChannelEntity>().eq("scene_id", liveScene.getId()));
|
||||
List<Integer> oldChannelIdList = new ArrayList<>();
|
||||
|
||||
@ -382,7 +382,7 @@ public class LuceneServiceImpl implements LuceneService {
|
||||
}
|
||||
}
|
||||
|
||||
private void dirCheck(String filePath) {
|
||||
private void dirCheck(String filePath) {
|
||||
File file = new File(filePath);
|
||||
if (!file.exists()) {
|
||||
file.mkdirs();
|
||||
|
||||
@ -306,6 +306,11 @@ public class SceneEntityVo {
|
||||
this.tenantName = entity.getTenantName();
|
||||
|
||||
this.isAutoLive = entity.getIsAutoLive();
|
||||
|
||||
this.carouselImage = entity.getCarouselImage();
|
||||
this.viewerCount = entity.getViewerCount();
|
||||
this.likeDisplay = entity.getLikeDisplay();
|
||||
this.vrLive = entity.getVrLive();
|
||||
}
|
||||
|
||||
public Integer getId() {
|
||||
|
||||
@ -114,6 +114,7 @@ foreign:
|
||||
wapurl: http://zklive.zhongkedongxin.com
|
||||
dataurl: http://zklive.zhongkedongxin.com
|
||||
# mediaurl: http://test.vod.zhongkedongxin.com
|
||||
#TitleImage标题图地址、视频地址url拼接,前缀
|
||||
mediaurl: https://v.livejinan.cn
|
||||
vodmediaurl: http://test.vod.zhongkedongxin.com
|
||||
platform:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user