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 java.util.List; import com.fasterxml.jackson.annotation.JsonFormat; import com.zhentao.user.domain.UserLogin; import lombok.Data; /** * 朋友圈动态表 * @TableName user_moments */ @TableName(value ="user_moments") @Data public class UserMoments implements Serializable { /** * */ @TableId(type = IdType.AUTO) @JsonFormat(shape = JsonFormat.Shape.STRING) private Long momentId; /** * 发布者ID */ private Long userId; /** * 动态内容 */ private String content; /** * 内容类型(1-文本,2-图片,3-视频) */ private Integer contentType; private String url; private String filename; private Long filesize; /** * 可见性(0-公开,1-仅好友,2-私密) */ private Integer visibility; /** * 位置信息 */ private String location; /** * */ @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss") private Date createdAt; /** * */ private Date updatedAt; @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; } UserMoments other = (UserMoments) that; return (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.getContentType() == null ? other.getContentType() == null : this.getContentType().equals(other.getContentType())) && (this.getVisibility() == null ? other.getVisibility() == null : this.getVisibility().equals(other.getVisibility())) && (this.getLocation() == null ? other.getLocation() == null : this.getLocation().equals(other.getLocation())) && (this.getCreatedAt() == null ? other.getCreatedAt() == null : this.getCreatedAt().equals(other.getCreatedAt())) && (this.getUpdatedAt() == null ? other.getUpdatedAt() == null : this.getUpdatedAt().equals(other.getUpdatedAt())); } @Override public int hashCode() { final int prime = 31; int result = 1; 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 + ((getContentType() == null) ? 0 : getContentType().hashCode()); result = prime * result + ((getVisibility() == null) ? 0 : getVisibility().hashCode()); result = prime * result + ((getLocation() == null) ? 0 : getLocation().hashCode()); result = prime * result + ((getCreatedAt() == null) ? 0 : getCreatedAt().hashCode()); result = prime * result + ((getUpdatedAt() == null) ? 0 : getUpdatedAt().hashCode()); return result; } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(getClass().getSimpleName()); sb.append(" ["); sb.append("Hash = ").append(hashCode()); sb.append(", momentId=").append(momentId); sb.append(", userId=").append(userId); sb.append(", content=").append(content); sb.append(", contentType=").append(contentType); sb.append(", visibility=").append(visibility); sb.append(", location=").append(location); sb.append(", createdAt=").append(createdAt); sb.append(", updatedAt=").append(updatedAt); sb.append(", serialVersionUID=").append(serialVersionUID); sb.append("]"); return sb.toString(); } }