Преглед изворни кода

直播代码 添加app获取直播间列表接口

yuhongqi пре 1 месец
родитељ
комит
8723917cc0

+ 11 - 0
fs-live-app/src/main/java/com/fs/app/controller/LiveController.java

@@ -112,6 +112,17 @@ public class LiveController extends AppBaseController {
 	}
 
 
+	@ApiOperation("直播间列表")
+	@GetMapping("/list")
+	@ApiResponse(code = 200, message = "", response = LiveInfoVo.class)
+	public TableDataInfo list(@RequestBody Live live) {
+		startPage();
+		return getDataTable(liveService.appList(live));
+	}
+
+
+
+
 	@Login
 	@ApiOperation("聊天记录(最新30条)")
 	@GetMapping("/msgList")

+ 1 - 0
fs-live-app/src/main/java/com/fs/framework/config/SecurityConfig.java

@@ -37,6 +37,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
         http.authorizeRequests()
                 .antMatchers("/**").permitAll()
                 .antMatchers("/app/live/startLiving").permitAll()
+                .antMatchers("/app/live/startLiving").permitAll()
                 .anyRequest().authenticated()
                 .and().csrf().disable();
     }

+ 3 - 0
fs-service/src/main/java/com/fs/live/mapper/LiveMapper.java

@@ -102,4 +102,7 @@ public interface LiveMapper extends BaseMapper<Live>
     int handleShelfOrUnAdmin(@Param("liveVo") LiveListVo listVo);
 
     int handleDeleteSelectedAdmin(@Param("liveVo") LiveListVo listVo);
+
+
+    List<Live> appList(Live live);
 }

+ 2 - 0
fs-service/src/main/java/com/fs/live/service/ILiveService.java

@@ -156,4 +156,6 @@ public interface ILiveService extends IService<Live>
     R copyLive(Live live);
 
     R currentActivities(Long liveId, String userId);
+
+    List<Live> appList(Live live);
 }

+ 6 - 1
fs-service/src/main/java/com/fs/live/service/impl/LiveServiceImpl.java

@@ -114,6 +114,11 @@ public class LiveServiceImpl extends ServiceImpl<LiveMapper, Live> implements IL
         return R.ok().put("red", liveRedConfs).put("lottery", liveLotteryConfs).put("goods", data);
     }
 
+    @Override
+    public List<Live> appList(Live live) {
+        return baseMapper.appList(live);
+    }
+
     /**
      * 查询企业直播
      * @param liveId            直播ID
@@ -699,7 +704,7 @@ public class LiveServiceImpl extends ServiceImpl<LiveMapper, Live> implements IL
                 liveId +
                 "?" +
                 "txSecret=" +
-                Md5Util.MD5("a61df75ae15271d7ef922f308e61e92e" + liveId + to16Hex(now)) +
+                Md5Util.MD5("1962d7077d610783266cd1b839537944" + liveId + to16Hex(now)) +
                 "&" +
                 "txTime=" +
                 to16Hex(now);

+ 23 - 0
fs-service/src/main/resources/mapper/live/LiveMapper.xml

@@ -97,6 +97,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <include refid="selectLiveVo"/>
         where live_id = #{liveId} and company_id = #{companyId} and company_user_id = #{companyUserId}
     </select>
+
+
+    <select id="appList" resultMap="LiveResult">
+        select a.live_id, a.company_id, a.company_user_id,talent_id, a.live_name, a.is_audit, a.live_desc, a.show_type, a.status, a.anchor_id,
+        a.live_type, a.start_time, a.finish_time, a.live_img_url, a.live_config, a.id_card_url, a.is_show, a.is_del, a.qw_qr_code, a.rtmp_url,
+        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
+        <if test="companyId != null "> and a.company_id = #{companyId}</if>
+        <if test="companyUserId != null "> and a.company_user_id = #{companyUserId}</if>
+        <if test="liveName != null  and liveName != ''"> and live_name like concat('%', #{liveName}, '%')</if>
+        <if test="showType != null "> and show_type = #{showType}</if>
+        <if test="status != null "> and status = #{status}</if>
+        <if test="liveType != null "> and live_type = #{liveType}</if>
+        <if test="startTime != null "> and start_time = #{startTime}</if>
+        <if test="finishTime != null "> and finish_time = #{finishTime}</if>
+        <if test="isShow != null "> and is_show = #{isShow}</if>
+        <if test="isAudit != null  and isAudit != ''"> and is_audit = #{isAudit}</if>
+        order by create_time desc
+    </select>
+
     <select id="selectLiveToStudent" resultType="com.fs.live.domain.Live">
         <include refid="selectLiveVo"/>
         where 1=1