UserMoments.java 4.0 KB

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