123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- package com.zhentao.moment.domain;
- 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.io.Serializable;
- import java.util.Date;
- import com.fasterxml.jackson.annotation.JsonFormat;
- import lombok.Data;
- /**
- * 朋友圈评论表
- * @TableName moment_comments
- */
- @TableName(value ="moment_comments")
- @Data
- public class MomentComments implements Serializable {
- /**
- *
- */
- @TableId(type = IdType.AUTO)
- private Long commentId;
- /**
- * 动态ID
- */
- @JsonFormat(shape = JsonFormat.Shape.STRING)
- private Long momentId;
- /**
- * 评论用户ID
- */
- private Long userId;
- /**
- * 评论内容
- */
- private String content;
- /**
- * 回复的评论ID
- */
- private Long replyTo;
- /**
- * 回复的用户ID
- */
- private Long replyToUser;
- /**
- *
- */
- @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
- private Date createdAt;
- @TableField(exist = false)
- private static final long serialVersionUID = 1L;
- @Override
- public boolean equals(Object that) {
- if (this == that) {
- return true;
- }
- if (that == null) {
- return false;
- }
- if (getClass() != that.getClass()) {
- return false;
- }
- MomentComments other = (MomentComments) that;
- return (this.getCommentId() == null ? other.getCommentId() == null : this.getCommentId().equals(other.getCommentId()))
- && (this.getMomentId() == null ? other.getMomentId() == null : this.getMomentId().equals(other.getMomentId()))
- && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
- && (this.getContent() == null ? other.getContent() == null : this.getContent().equals(other.getContent()))
- && (this.getReplyTo() == null ? other.getReplyTo() == null : this.getReplyTo().equals(other.getReplyTo()))
- && (this.getReplyToUser() == null ? other.getReplyToUser() == null : this.getReplyToUser().equals(other.getReplyToUser()))
- && (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 + ((getMomentId() == null) ? 0 : getMomentId().hashCode());
- result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
- result = prime * result + ((getContent() == null) ? 0 : getContent().hashCode());
- result = prime * result + ((getReplyTo() == null) ? 0 : getReplyTo().hashCode());
- result = prime * result + ((getReplyToUser() == null) ? 0 : getReplyToUser().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(", momentId=").append(momentId);
- sb.append(", userId=").append(userId);
- sb.append(", content=").append(content);
- sb.append(", replyTo=").append(replyTo);
- sb.append(", replyToUser=").append(replyToUser);
- sb.append(", createdAt=").append(createdAt);
- sb.append(", serialVersionUID=").append(serialVersionUID);
- sb.append("]");
- return sb.toString();
- }
- }
|