浏览代码

直播也创建录播视频

yuhongqi 4 周之前
父节点
当前提交
26b7a0a1ad

+ 8 - 9
fs-service-system/src/main/java/com/fs/live/service/impl/LiveServiceImpl.java

@@ -258,15 +258,14 @@ public class LiveServiceImpl implements ILiveService
         live.setIsAudit(0);
         live.setStatus(1);
         int save = baseMapper.insertLive(live);
-        if (live.getLiveType() == 2) {
-            // 录播 才有视频
-            LiveVideo liveVideo = new LiveVideo();
-            liveVideo.setLiveId(live.getLiveId());
-            liveVideo.setVideoUrl(live.getVideoUrl());
-            liveVideo.setVideoType(1);
-            liveVideo.setDuration(live.getDuration());
-            liveVideoService.insertLiveVideo(liveVideo);
-        }
+        // 录播 才有视频
+        LiveVideo liveVideo = new LiveVideo();
+        liveVideo.setLiveId(live.getLiveId());
+        liveVideo.setVideoUrl(live.getVideoUrl());
+        liveVideo.setVideoType(1);
+        liveVideo.setDuration(live.getDuration());
+        liveVideoService.insertLiveVideo(liveVideo);
+
         //新增直播数据表
         LiveData liveData = new LiveData();
         liveData.setLiveId(live.getLiveId());

+ 2 - 2
fs-service-system/src/main/resources/mapper/live/LiveMapper.xml

@@ -46,7 +46,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         a.flv_hls_url, a.create_time, a.create_by, a.update_by, a.update_time, a.remark,config_json, b.video_url from live
         a
         left join live_video b on a.live_id = b.live_id
-        where 1=1 and is_del = 0 and is_show = 1 and status in (2,4) and (b.live_id is null or b.video_type = 1)
+        where 1=1 and is_del = 0 and is_show = 1 and status in (2,4) and b.video_type = 1
 
         order by create_time desc
     </select>
@@ -62,7 +62,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             left join live_company_code c on a.live_id = c.live_id
             and c.company_id = #{companyId}
             and c.company_user_id = #{companyUserId}
-        where 1=1 and is_del = 0 and (b.live_id is null or b.video_type = 1)
+        where 1=1 and is_del = 0 and  b.video_type = 1
         <if test="companyId != null "> and (a.company_id = #{companyId} or a.company_id is null )</if>
         <if test="talentId != null "> and talent_id = #{talentId}</if>
         <if test="liveName != null  and liveName != ''"> and live_name like concat('%', #{liveName}, '%')</if>