AdminUser.java 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. package com.zhentao.entity;
  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.util.Date;
  7. import lombok.Data;
  8. /**
  9. * 管理员用户表
  10. * @TableName admin_user
  11. */
  12. @TableName(value ="admin_user")
  13. @Data
  14. public class AdminUser {
  15. /**
  16. * 主键ID
  17. */
  18. @TableId(type = IdType.AUTO)
  19. private Integer id;
  20. /**
  21. * 用户名
  22. */
  23. private String username;
  24. /**
  25. * 密码(MD5加密)
  26. */
  27. private String password;
  28. /**
  29. * 密码盐
  30. */
  31. private String salt;
  32. /**
  33. * 真实姓名
  34. */
  35. private String realName;
  36. /**
  37. * 手机号
  38. */
  39. private String phone;
  40. /**
  41. * 邮箱
  42. */
  43. private String email;
  44. /**
  45. * 状态:0-禁用 1-启用
  46. */
  47. private Integer status;
  48. /**
  49. * 创建时间
  50. */
  51. private Date createTime;
  52. /**
  53. * 更新时间
  54. */
  55. private Date updateTime;
  56. /**
  57. * 最后登录时间
  58. */
  59. private Date lastLoginTime;
  60. @Override
  61. public boolean equals(Object that) {
  62. if (this == that) {
  63. return true;
  64. }
  65. if (that == null) {
  66. return false;
  67. }
  68. if (getClass() != that.getClass()) {
  69. return false;
  70. }
  71. AdminUser other = (AdminUser) that;
  72. return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
  73. && (this.getUsername() == null ? other.getUsername() == null : this.getUsername().equals(other.getUsername()))
  74. && (this.getPassword() == null ? other.getPassword() == null : this.getPassword().equals(other.getPassword()))
  75. && (this.getSalt() == null ? other.getSalt() == null : this.getSalt().equals(other.getSalt()))
  76. && (this.getRealName() == null ? other.getRealName() == null : this.getRealName().equals(other.getRealName()))
  77. && (this.getPhone() == null ? other.getPhone() == null : this.getPhone().equals(other.getPhone()))
  78. && (this.getEmail() == null ? other.getEmail() == null : this.getEmail().equals(other.getEmail()))
  79. && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
  80. && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
  81. && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
  82. && (this.getLastLoginTime() == null ? other.getLastLoginTime() == null : this.getLastLoginTime().equals(other.getLastLoginTime()));
  83. }
  84. @Override
  85. public int hashCode() {
  86. final int prime = 31;
  87. int result = 1;
  88. result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
  89. result = prime * result + ((getUsername() == null) ? 0 : getUsername().hashCode());
  90. result = prime * result + ((getPassword() == null) ? 0 : getPassword().hashCode());
  91. result = prime * result + ((getSalt() == null) ? 0 : getSalt().hashCode());
  92. result = prime * result + ((getRealName() == null) ? 0 : getRealName().hashCode());
  93. result = prime * result + ((getPhone() == null) ? 0 : getPhone().hashCode());
  94. result = prime * result + ((getEmail() == null) ? 0 : getEmail().hashCode());
  95. result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
  96. result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
  97. result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
  98. result = prime * result + ((getLastLoginTime() == null) ? 0 : getLastLoginTime().hashCode());
  99. return result;
  100. }
  101. @Override
  102. public String toString() {
  103. StringBuilder sb = new StringBuilder();
  104. sb.append(getClass().getSimpleName());
  105. sb.append(" [");
  106. sb.append("Hash = ").append(hashCode());
  107. sb.append(", id=").append(id);
  108. sb.append(", username=").append(username);
  109. sb.append(", password=").append(password);
  110. sb.append(", salt=").append(salt);
  111. sb.append(", realName=").append(realName);
  112. sb.append(", phone=").append(phone);
  113. sb.append(", email=").append(email);
  114. sb.append(", status=").append(status);
  115. sb.append(", createTime=").append(createTime);
  116. sb.append(", updateTime=").append(updateTime);
  117. sb.append(", lastLoginTime=").append(lastLoginTime);
  118. sb.append("]");
  119. return sb.toString();
  120. }
  121. }