Преглед на файлове

新增评论未更新评论数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("新增评论失败");
     }