From 817c7de04cb6b74164a42ed0e6050ae5b91b0ef1 Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期四, 29 五月 2025 18:14:00 +0800
Subject: [PATCH] 视频评论增加被回复人头像字段

---
 framework/src/main/java/cn/lili/modules/lmk/service/impl/VideoCommentServiceImpl.java |   18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/framework/src/main/java/cn/lili/modules/lmk/service/impl/VideoCommentServiceImpl.java b/framework/src/main/java/cn/lili/modules/lmk/service/impl/VideoCommentServiceImpl.java
index 3874f5d..f71a858 100644
--- a/framework/src/main/java/cn/lili/modules/lmk/service/impl/VideoCommentServiceImpl.java
+++ b/framework/src/main/java/cn/lili/modules/lmk/service/impl/VideoCommentServiceImpl.java
@@ -3,6 +3,7 @@
 import cn.lili.common.security.AuthUser;
 import cn.lili.common.security.context.UserContext;
 import cn.lili.common.sensitive.SensitiveWordsFilter;
+import cn.lili.modules.lmk.domain.vo.CollectTypeNumVO;
 import cn.lili.modules.lmk.enums.general.VideoCommentStatusEnum;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import cn.lili.modules.lmk.domain.entity.VideoComment;
@@ -43,7 +44,6 @@
      * @return
      */
     @Override
-    @Transactional(rollbackFor = Exception.class)
     public Result comment(VideoCommentForm form) {
         // 鐩戞祴鍐呭鏄惁鍖呭惈鏁忔劅璇�
         if (SensitiveWordsFilter.includeSentenceWord(form.getCommentContent())) {
@@ -65,12 +65,7 @@
         entity.setUserAvatar(currentUser.getFace());
 
         baseMapper.insert(entity);
-        if (StringUtils.isBlank(entity.getReplyId())) {
-            // 涓嶆槸鍥炲璇勮锛岄偅涔堝氨鏄富璇勮锛屼富璇勮鐨刴asterId璁剧疆涓鸿嚜宸辩殑id
-            entity.setMasterCommentId(entity.getId());
-        }
-        baseMapper.updateById(entity);
-        return Result.ok("娣诲姞鎴愬姛");
+        return Result.ok("娣诲姞鎴愬姛").data(this.detail(entity.getId()).get("data"));
     }
 
     /**
@@ -138,10 +133,17 @@
         if (StringUtils.isNotBlank(query.getMasterCommentId())) {
             // 鍔犺浇瀛愯瘎璁虹殑鎯呭喌
             baseMapper.replyCommentPage(page, query);
+            return Result.ok().data(page.getRecords());
         } else {
             // 鍔犺浇涓昏瘎璁虹殑鎯呭喌銆備富璇勮id = masterCommentId
             baseMapper.masterCommentPage(page, query);
         }
-        return Result.ok().data(page.getRecords());
+        return Result.ok().data(page.getRecords()).total(page.getTotal());
+    }
+
+
+    @Override
+    public List<CollectTypeNumVO> countNumGroupByVideo() {
+        return baseMapper.countNumGroupByVideo();
     }
 }

--
Gitblit v1.8.0