From 42b1936f337d5535d7fa29916ef3df969d360545 Mon Sep 17 00:00:00 2001 From: 2210088963 <2210088963@qq.com> Date: Wed, 26 Mar 2025 11:33:44 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9=E4=BA=86APP=E6=9B=B4?= =?UTF-8?q?=E5=A4=9A=E7=8E=B0=E5=9C=BA=E6=9F=A5=E8=AF=A2=E4=B8=8D=E5=88=B0?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=9A=84BUG=202.=E4=BF=AE=E6=94=B9=E4=BA=86?= =?UTF-8?q?=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1=E8=BF=9E=E6=8E=A5Redis?= =?UTF-8?q?=E6=96=B9=E5=BC=8F=203.=E4=BF=AE=E6=94=B9=E4=BA=86getReportLive?= =?UTF-8?q?Count=E6=8E=A5=E5=8F=A3=E5=AD=97=E6=AE=B5=E5=90=8D=204.getScene?= =?UTF-8?q?Detail=E6=96=B9=E6=B3=95=E5=A2=9E=E5=8A=A0=E4=BA=BA=E6=95=B0?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=205.=E4=BF=AE=E5=A4=8D=E4=BA=86=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E6=9B=B4=E5=A4=9A=E7=8E=B0=E5=9C=BA=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E7=9A=84sql=E8=AF=AD=E5=8F=A5=E9=94=99=E8=AF=AF=206.=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0LiveSceneDTO=20=E7=9A=84=E4=B8=80=E4=B8=AA=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=207.=E5=A2=9E=E5=8A=A0=E6=89=80=E6=9C=89=E6=B5=81?= =?UTF-8?q?=E7=BB=93=E6=9D=9F=E5=90=8E=E7=8E=B0=E5=9C=BA=E5=8F=98=E4=B8=BA?= =?UTF-8?q?=E5=9B=9E=E9=A1=BE=E7=8A=B6=E6=80=81=E3=80=82process=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E9=81=8D=E5=8E=86=E6=A3=80=E6=9F=A5=E6=AF=8F=E4=B8=AA?= =?UTF-8?q?=E6=B5=81=E7=9A=84=E7=8A=B6=E6=80=81=208.=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E7=8E=B0=E5=9C=BA=E7=8A=B6=E6=80=81=E5=92=8C=E4=BA=BA=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sql/add_new_db.sql | 2 +- .../controller/LiveForeignController.java | 6 +- .../foreign/entity/SceneForeignEntity.java | 24 +++- .../service/impl/LiveForeignServiceImpl.java | 4 + .../modules/live/dao/LiveSceneDao.java | 2 +- .../modules/live/dto/LiveSceneDTO.java | 1 + .../live/service/LiveSceneService.java | 2 + .../service/impl/LiveSceneServiceImpl.java | 11 +- .../impl/LiveStreamStatusServiceImpl.java | 26 ++++ .../modules/live/task/LikeSyncTask.java | 126 ++++++++++++------ 10 files changed, 155 insertions(+), 49 deletions(-) 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("