package com.bruce.sams.domain.ams; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import java.util.Date; import lombok.Data; /** * 活动评论表 * @TableName ams_comment */ @TableName(value ="ams_comment") @Data public class Comment { /** * 评论ID */ @TableId(type = IdType.AUTO) private Long commentId; /** * 用户ID */ private Long userId; /** * 活动ID */ private Long actId; /** * 父评论ID(为空表示是顶级评论) */ private Long parentCommentId; /** * 评论内容 */ private String content; /** * 评论时间 */ private Date createdAt; @Override public boolean equals(Object that) { if (this == that) { return true; } if (that == null) { return false; } if (getClass() != that.getClass()) { return false; } Comment other = (Comment) that; return (this.getCommentId() == null ? other.getCommentId() == null : this.getCommentId().equals(other.getCommentId())) && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId())) && (this.getActId() == null ? other.getActId() == null : this.getActId().equals(other.getActId())) && (this.getParentCommentId() == null ? other.getParentCommentId() == null : this.getParentCommentId().equals(other.getParentCommentId())) && (this.getContent() == null ? other.getContent() == null : this.getContent().equals(other.getContent())) && (this.getCreatedAt() == null ? other.getCreatedAt() == null : this.getCreatedAt().equals(other.getCreatedAt())); } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((getCommentId() == null) ? 0 : getCommentId().hashCode()); result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode()); result = prime * result + ((getActId() == null) ? 0 : getActId().hashCode()); result = prime * result + ((getParentCommentId() == null) ? 0 : getParentCommentId().hashCode()); result = prime * result + ((getContent() == null) ? 0 : getContent().hashCode()); result = prime * result + ((getCreatedAt() == null) ? 0 : getCreatedAt().hashCode()); return result; } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(getClass().getSimpleName()); sb.append(" ["); sb.append("Hash = ").append(hashCode()); sb.append(", commentId=").append(commentId); sb.append(", userId=").append(userId); sb.append(", actId=").append(actId); sb.append(", parentCommentId=").append(parentCommentId); sb.append(", content=").append(content); sb.append(", createdAt=").append(createdAt); sb.append("]"); return sb.toString(); } }