|
@@ -9,8 +9,11 @@ import com.sumbytes.common.enums.ErrorEnum;
|
|
|
import com.sumbytes.common.util.ExceptionUtil;
|
|
|
import com.sumbytes.common.util.PageUtil;
|
|
|
import com.sumbytes.common.util.SessionUtil;
|
|
|
+import com.sumbytes.helloblog.auth.dao.AuthUserDao;
|
|
|
+import com.sumbytes.helloblog.auth.domain.po.AuthUser;
|
|
|
import com.sumbytes.helloblog.posts.dao.PostsCommentsDao;
|
|
|
import com.sumbytes.helloblog.posts.dao.PostsDao;
|
|
|
+import com.sumbytes.helloblog.posts.domain.po.Posts;
|
|
|
import com.sumbytes.helloblog.posts.domain.po.PostsComments;
|
|
|
import com.sumbytes.helloblog.posts.domain.vo.PostsCommentsVO;
|
|
|
import com.sumbytes.helloblog.posts.service.PostsCommentsService;
|
|
@@ -37,9 +40,11 @@ public class PostsCommentsServiceImpl extends BaseServiceImpl<PostsCommentsDao,
|
|
|
@Autowired
|
|
|
private PostsDao postsDao;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private AuthUserDao authUserDao;
|
|
|
+
|
|
|
@Override
|
|
|
public Result savePostsComments(PostsCommentsVO postsCommentsVO) {
|
|
|
-
|
|
|
UserSessionVO userSessionInfo = SessionUtil.getUserSessionInfo();
|
|
|
PostsComments postsComments = new PostsComments();
|
|
|
postsComments.setAuthorId(userSessionInfo.getId());
|
|
@@ -70,6 +75,22 @@ public class PostsCommentsServiceImpl extends BaseServiceImpl<PostsCommentsDao,
|
|
|
return Result.createWithSuccessMessage();
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Result replyComments(PostsCommentsVO postsCommentsVO) {
|
|
|
+ AuthUser authUser=authUserDao.selectAdmin();
|
|
|
+ PostsComments postsComments=postsCommentsDao.selectById(postsCommentsVO.getParentId())
|
|
|
+ .setParentId(postsCommentsVO.getParentId())
|
|
|
+ .setContent(postsCommentsVO.getContent())
|
|
|
+ .setAuthorId(authUser.getId())
|
|
|
+ .setCreateTime(LocalDateTime.now());
|
|
|
+ this.postsCommentsDao.insert(postsComments);
|
|
|
+ String treePath = postsComments.getTreePath() + postsComments.getId() + Constants.TREE_PATH;
|
|
|
+ this.postsCommentsDao.updateById(postsComments.setTreePath(treePath));
|
|
|
+ this.postsDao.incrementComments( postsCommentsVO.getPostsId());
|
|
|
+ return Result.createWithSuccessMessage();
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public Result getPostsCommentsByPostsIdList(PostsCommentsVO postsCommentsVO) {
|
|
|
|