UserMoments.java 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. package com.zhentao.moment.domain;
  2. import com.baomidou.mybatisplus.annotation.IdType;
  3. import com.baomidou.mybatisplus.annotation.TableField;
  4. import com.baomidou.mybatisplus.annotation.TableId;
  5. import com.baomidou.mybatisplus.annotation.TableName;
  6. import java.io.Serializable;
  7. import java.util.Date;
  8. import java.util.List;
  9. import com.fasterxml.jackson.annotation.JsonFormat;
  10. import com.zhentao.user.domain.UserLogin;
  11. import lombok.Data;
  12. /**
  13. * 朋友圈动态表
  14. * @TableName user_moments
  15. */
  16. @TableName(value ="user_moments")
  17. @Data
  18. public class UserMoments implements Serializable {
  19. /**
  20. *
  21. */
  22. @TableId(type = IdType.AUTO)
  23. @JsonFormat(shape = JsonFormat.Shape.STRING)
  24. private Long momentId;
  25. /**
  26. * 发布者ID
  27. */
  28. private Long userId;
  29. /**
  30. * 动态内容
  31. */
  32. private String content;
  33. /**
  34. * 内容类型(1-文本,2-图片,3-视频)
  35. */
  36. private Integer contentType;
  37. private String url;
  38. private String filename;
  39. private Long filesize;
  40. /**
  41. * 可见性(0-公开,1-仅好友,2-私密)
  42. */
  43. private Integer visibility;
  44. /**
  45. * 位置信息
  46. */
  47. private String location;
  48. /**
  49. *
  50. */
  51. @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
  52. private Date createdAt;
  53. /**
  54. *
  55. */
  56. private Date updatedAt;
  57. @TableField(exist = false)
  58. private static final long serialVersionUID = 1L;
  59. @Override
  60. public boolean equals(Object that) {
  61. if (this == that) {
  62. return true;
  63. }
  64. if (that == null) {
  65. return false;
  66. }
  67. if (getClass() != that.getClass()) {
  68. return false;
  69. }
  70. UserMoments other = (UserMoments) that;
  71. return (this.getMomentId() == null ? other.getMomentId() == null : this.getMomentId().equals(other.getMomentId()))
  72. && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
  73. && (this.getContent() == null ? other.getContent() == null : this.getContent().equals(other.getContent()))
  74. && (this.getContentType() == null ? other.getContentType() == null : this.getContentType().equals(other.getContentType()))
  75. && (this.getVisibility() == null ? other.getVisibility() == null : this.getVisibility().equals(other.getVisibility()))
  76. && (this.getLocation() == null ? other.getLocation() == null : this.getLocation().equals(other.getLocation()))
  77. && (this.getCreatedAt() == null ? other.getCreatedAt() == null : this.getCreatedAt().equals(other.getCreatedAt()))
  78. && (this.getUpdatedAt() == null ? other.getUpdatedAt() == null : this.getUpdatedAt().equals(other.getUpdatedAt()));
  79. }
  80. @Override
  81. public int hashCode() {
  82. final int prime = 31;
  83. int result = 1;
  84. result = prime * result + ((getMomentId() == null) ? 0 : getMomentId().hashCode());
  85. result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
  86. result = prime * result + ((getContent() == null) ? 0 : getContent().hashCode());
  87. result = prime * result + ((getContentType() == null) ? 0 : getContentType().hashCode());
  88. result = prime * result + ((getVisibility() == null) ? 0 : getVisibility().hashCode());
  89. result = prime * result + ((getLocation() == null) ? 0 : getLocation().hashCode());
  90. result = prime * result + ((getCreatedAt() == null) ? 0 : getCreatedAt().hashCode());
  91. result = prime * result + ((getUpdatedAt() == null) ? 0 : getUpdatedAt().hashCode());
  92. return result;
  93. }
  94. @Override
  95. public String toString() {
  96. StringBuilder sb = new StringBuilder();
  97. sb.append(getClass().getSimpleName());
  98. sb.append(" [");
  99. sb.append("Hash = ").append(hashCode());
  100. sb.append(", momentId=").append(momentId);
  101. sb.append(", userId=").append(userId);
  102. sb.append(", content=").append(content);
  103. sb.append(", contentType=").append(contentType);
  104. sb.append(", visibility=").append(visibility);
  105. sb.append(", location=").append(location);
  106. sb.append(", createdAt=").append(createdAt);
  107. sb.append(", updatedAt=").append(updatedAt);
  108. sb.append(", serialVersionUID=").append(serialVersionUID);
  109. sb.append("]");
  110. return sb.toString();
  111. }
  112. }