소스 검색

新增评论未更新评论数bug修复

xgb 2 주 전
부모
커밋
23d2d2cc48
1개의 변경된 파일2개의 추가작업 그리고 3개의 파일을 삭제
  1. 2 3
      fs-service/src/main/java/com/fs/course/service/impl/FsUserVideoCommentServiceImpl.java

+ 2 - 3
fs-service/src/main/java/com/fs/course/service/impl/FsUserVideoCommentServiceImpl.java

@@ -196,11 +196,10 @@ public class FsUserVideoCommentServiceImpl implements IFsUserVideoCommentService
             comment.setParentId(param.getParentId());
         }
         if (fsUserVideoCommentMapper.insertFsUserVideoComment(comment)>0){
+            // 更新对应的评论数
+            fsUserVideoMapper.addCommentCount(comment.getVideoId());
             return R.ok().put("data",comment);
         };
-        // 更新对应的评论数
-        fsUserVideoMapper.addCommentCount(comment.getVideoId());
-
         return R.error("新增评论失败");
     }