| package com.example.g8backend.entity; |
| |
| import java.sql.Timestamp; |
| import java.util.List; |
| |
| public class Comment { |
| private Long commentId; // 评论ID |
| private Long postId; // 所属帖子ID |
| private Long userId; // 评论用户ID |
| private String content; // 评论内容 |
| private Long parentCommentId; // 父评论ID,如果是顶级评论则为NULL |
| private Timestamp createdAt; // 评论时间 |
| |
| private List<Comment> replies; |
| |
| // Getter and Setter |
| public Long getCommentId() { |
| return commentId; |
| } |
| |
| public void setCommentId(Long commentId) { |
| this.commentId = commentId; |
| } |
| |
| public Long getPostId() { |
| return postId; |
| } |
| |
| public void setPostId(Long postId) { |
| this.postId = postId; |
| } |
| |
| public Long getUserId() { |
| return userId; |
| } |
| |
| public void setUserId(Long userId) { |
| this.userId = userId; |
| } |
| |
| public String getContent() { |
| return content; |
| } |
| |
| public void setContent(String content) { |
| this.content = content; |
| } |
| |
| public Long getParentCommentId() { |
| return parentCommentId; |
| } |
| |
| public void setParentCommentId(Long parentCommentId) { |
| this.parentCommentId = parentCommentId; |
| } |
| |
| public Timestamp getCreatedAt() { |
| return createdAt; |
| } |
| |
| public void setCreatedAt(Timestamp createdAt) { |
| this.createdAt = createdAt; |
| } |
| |
| // Getter and Setter for replies |
| public List<Comment> getReplies() { |
| return replies; |
| } |
| |
| public void setReplies(List<Comment> replies) { |
| this.replies = replies; |
| } |
| } |