diff --git a/sql/add_new_db.sql b/sql/add_new_db.sql index 4794cd9..bcdcdaa 100644 --- a/sql/add_new_db.sql +++ b/sql/add_new_db.sql @@ -8,7 +8,7 @@ DROP COLUMN component_count, DROP COLUMN title_setting; ALTER TABLE aijinan.live_channel - ADD COLUMN component_type VARCHAR(20) DEFAULT '组件A' COMMENT '组件类型', +ADD COLUMN component_type VARCHAR(20) DEFAULT '组件A' COMMENT '组件类型', ADD COLUMN component_layout VARCHAR(10) DEFAULT '2*N' COMMENT '组件排布', ADD COLUMN component_count INT DEFAULT 6 COMMENT '组件数量', ADD COLUMN title_setting VARCHAR(50) DEFAULT '政务前沿、直播快讯' COMMENT '标题设置'; diff --git a/src/main/java/com/platform/modules/foreign/controller/LiveForeignController.java b/src/main/java/com/platform/modules/foreign/controller/LiveForeignController.java index 908cbb0..cda75a2 100644 --- a/src/main/java/com/platform/modules/foreign/controller/LiveForeignController.java +++ b/src/main/java/com/platform/modules/foreign/controller/LiveForeignController.java @@ -376,12 +376,12 @@ public class LiveForeignController { * @return 现场点赞数 */ @GetMapping("/getReportLiveCount") - public R getReportLiveCount(@RequestParam Integer sceneId) { - LiveReportEntity report = liveReportService.selectById(sceneId); + public R getReportLiveCount(@RequestParam Integer reportId) { + LiveReportEntity report = liveReportService.selectById(reportId); if(report==null){ return R.error("该报道不存在"); } - Long liveCount = liveForeignService.getReportLiveCount(sceneId); + Long liveCount = liveForeignService.getReportLiveCount(reportId); return R.ok().put("liveCount", liveCount); } diff --git a/src/main/java/com/platform/modules/foreign/entity/SceneForeignEntity.java b/src/main/java/com/platform/modules/foreign/entity/SceneForeignEntity.java index 475c325..3fa05a1 100644 --- a/src/main/java/com/platform/modules/foreign/entity/SceneForeignEntity.java +++ b/src/main/java/com/platform/modules/foreign/entity/SceneForeignEntity.java @@ -35,7 +35,27 @@ public class SceneForeignEntity { // 评论总数 private String comments; - public SceneForeignEntity() { + private String liveState; + + private String viewsShow; + + public String getLiveState() { + return liveState; + } + + public void setLiveState(String liveState) { + this.liveState = liveState; + } + + public String getViewsShow() { + return viewsShow; + } + + public void setViewsShow(String viewsShow) { + this.viewsShow = viewsShow; + } + + public SceneForeignEntity() { } @@ -65,6 +85,8 @@ public class SceneForeignEntity { this.caster = entity.getCasterId().toString(); else this.caster = ""; + this.liveState = String.valueOf(entity.getLiveState()); + this.viewsShow = String.valueOf(entity.getViewsShow()); } public String getId() { diff --git a/src/main/java/com/platform/modules/foreign/service/impl/LiveForeignServiceImpl.java b/src/main/java/com/platform/modules/foreign/service/impl/LiveForeignServiceImpl.java index fabf333..0524f60 100644 --- a/src/main/java/com/platform/modules/foreign/service/impl/LiveForeignServiceImpl.java +++ b/src/main/java/com/platform/modules/foreign/service/impl/LiveForeignServiceImpl.java @@ -272,6 +272,8 @@ public class LiveForeignServiceImpl implements com.platform.modules.foreign.serv entity.setTitleImage(compressImage(entity.getTitleImage())); } } + LiveSceneCountEntity countEntity = liveSceneCountService.selectById(id); + entity.setViewsShow(String.valueOf(countEntity.getViewsShow())); return entity; } } @@ -301,6 +303,8 @@ public class LiveForeignServiceImpl implements com.platform.modules.foreign.serv list.setCoverUrl(compressImage(list.getCoverUrl())); }); } + LiveSceneCountEntity countEntity = liveSceneCountService.selectById(id); + entity.setViewsShow(String.valueOf(countEntity.getViewsShow())); return entity; } diff --git a/src/main/java/com/platform/modules/live/dao/LiveSceneDao.java b/src/main/java/com/platform/modules/live/dao/LiveSceneDao.java index e65532a..8a95e0c 100644 --- a/src/main/java/com/platform/modules/live/dao/LiveSceneDao.java +++ b/src/main/java/com/platform/modules/live/dao/LiveSceneDao.java @@ -65,7 +65,7 @@ public interface LiveSceneDao extends BaseMapper { @Select("select ls.id,ls.title,ls.title_image,ls.live_state from live_scene ls left join live_scene_count lsc on ls.id = lsc.scene_id where ls.scene_state = 2 and hot_spot = 1 order by lsc.views_show desc;") List getHotList(); - @Select("select id,title,title_image,live_state from live_scene where scene_state = 2 by live_start desc limit 20;") + @Select("select id,title,title_image,live_state from live_scene where scene_state = 2 order by live_start desc limit 20;") List getMoreScenes(); @Update("