SAMS/src/main/java/com/bruce/sams/domain/ams/Comment.java

96 lines
3.1 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

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();
}
}