Groups.java 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. package com.zhentao.groups.pojo;
  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 groups
  12. */
  13. @TableName(value ="groups")
  14. @Data
  15. public class Groups implements Serializable {
  16. /**
  17. * id
  18. */
  19. @TableId(type = IdType.AUTO)
  20. private Long groupId;
  21. /**
  22. * 群名称
  23. */
  24. private String name;
  25. /**
  26. * 创建者ID
  27. */
  28. private Long creatorId;
  29. /**
  30. * 群头像
  31. */
  32. private String avatar;
  33. /**
  34. * 群公告
  35. */
  36. private String announcement;
  37. /**
  38. * 群描述
  39. */
  40. private String description;
  41. /**
  42. * 最大成员数
  43. */
  44. private Integer maxMembers;
  45. /**
  46. * 状态(0-解散,1-正常)
  47. */
  48. private Integer status;
  49. /**
  50. * 创建时间
  51. */
  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. Groups other = (Groups) that;
  71. return (this.getGroupId() == null ? other.getGroupId() == null : this.getGroupId().equals(other.getGroupId()))
  72. && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
  73. && (this.getCreatorId() == null ? other.getCreatorId() == null : this.getCreatorId().equals(other.getCreatorId()))
  74. && (this.getAvatar() == null ? other.getAvatar() == null : this.getAvatar().equals(other.getAvatar()))
  75. && (this.getAnnouncement() == null ? other.getAnnouncement() == null : this.getAnnouncement().equals(other.getAnnouncement()))
  76. && (this.getDescription() == null ? other.getDescription() == null : this.getDescription().equals(other.getDescription()))
  77. && (this.getMaxMembers() == null ? other.getMaxMembers() == null : this.getMaxMembers().equals(other.getMaxMembers()))
  78. && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
  79. && (this.getCreatedAt() == null ? other.getCreatedAt() == null : this.getCreatedAt().equals(other.getCreatedAt()))
  80. && (this.getUpdatedAt() == null ? other.getUpdatedAt() == null : this.getUpdatedAt().equals(other.getUpdatedAt()));
  81. }
  82. @Override
  83. public int hashCode() {
  84. final int prime = 31;
  85. int result = 1;
  86. result = prime * result + ((getGroupId() == null) ? 0 : getGroupId().hashCode());
  87. result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
  88. result = prime * result + ((getCreatorId() == null) ? 0 : getCreatorId().hashCode());
  89. result = prime * result + ((getAvatar() == null) ? 0 : getAvatar().hashCode());
  90. result = prime * result + ((getAnnouncement() == null) ? 0 : getAnnouncement().hashCode());
  91. result = prime * result + ((getDescription() == null) ? 0 : getDescription().hashCode());
  92. result = prime * result + ((getMaxMembers() == null) ? 0 : getMaxMembers().hashCode());
  93. result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
  94. result = prime * result + ((getCreatedAt() == null) ? 0 : getCreatedAt().hashCode());
  95. result = prime * result + ((getUpdatedAt() == null) ? 0 : getUpdatedAt().hashCode());
  96. return result;
  97. }
  98. @Override
  99. public String toString() {
  100. StringBuilder sb = new StringBuilder();
  101. sb.append(getClass().getSimpleName());
  102. sb.append(" [");
  103. sb.append("Hash = ").append(hashCode());
  104. sb.append(", groupId=").append(groupId);
  105. sb.append(", name=").append(name);
  106. sb.append(", creatorId=").append(creatorId);
  107. sb.append(", avatar=").append(avatar);
  108. sb.append(", announcement=").append(announcement);
  109. sb.append(", description=").append(description);
  110. sb.append(", maxMembers=").append(maxMembers);
  111. sb.append(", status=").append(status);
  112. sb.append(", createdAt=").append(createdAt);
  113. sb.append(", updatedAt=").append(updatedAt);
  114. sb.append(", serialVersionUID=").append(serialVersionUID);
  115. sb.append("]");
  116. return sb.toString();
  117. }
  118. }