显示一级评论和用户信息
This commit is contained in:
parent
48954ddb04
commit
c48b8e000c
44
src/main/java/com/lovenav/entity/CommentNode.java
Normal file
44
src/main/java/com/lovenav/entity/CommentNode.java
Normal 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();
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user