显示一级评论和用户信息

This commit is contained in:
sjm 2023-12-24 23:12:15 +08:00
parent 48954ddb04
commit c48b8e000c

View File

@ -0,0 +1,44 @@
package com.lovenav.entity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.ArrayList;
import java.util.List;
/**
* 功能描述封装博客评论的BO <br>
* 采用链表结构实现
**/
@EqualsAndHashCode(callSuper = true)
@Data
@NoArgsConstructor
public class CommentNode extends Comment {
/**
* 评论的用户信息
*/
private User user;
/**
* 下一条回复
*/
private List<CommentNode> nextNodes = new ArrayList<>();
public CommentNode ( CommentNode commentNode ) {
super();
setId(commentNode.getId());
setUrlId(commentNode.getUrlId());
setUserId(commentNode.getUserId());
setContent(commentNode.getContent());
setRootCommentId(commentNode.getRootCommentId());
setCommentStatus(commentNode.getCommentStatus());
setCommentTime(commentNode.getCommentTime());
setUpdateTime(commentNode.getUpdateTime());
setRating(commentNode.getRating());
setLikeCount(commentNode.getLikeCount());
this.user = commentNode.getUser();
}
}