|
@@ -0,0 +1,157 @@
|
|
|
+package com.futu.course.user.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 lombok.Data;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 用户表
|
|
|
+ * @TableName user
|
|
|
+ */
|
|
|
+@TableName(value ="user")
|
|
|
+@Data
|
|
|
+public class User implements Serializable {
|
|
|
+ /**
|
|
|
+ * 用户ID(使用Snowflake算法生成)
|
|
|
+ */
|
|
|
+ @TableId
|
|
|
+ private Long id;
|
|
|
+
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ */
|
|
|
+ private String openId;
|
|
|
+
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ */
|
|
|
+ private String unionId;
|
|
|
+
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ */
|
|
|
+ private String sessionKey;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 登录账号
|
|
|
+ */
|
|
|
+ private String username;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 加密后的密码
|
|
|
+ */
|
|
|
+ private String password;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 盐
|
|
|
+ */
|
|
|
+ private String salt;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 昵称
|
|
|
+ */
|
|
|
+ private String nickname;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 头像URL
|
|
|
+ */
|
|
|
+ private String avatar;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 手机号
|
|
|
+ */
|
|
|
+ private String mobile;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 会员等级(0-普通用户)
|
|
|
+ */
|
|
|
+ private Integer memberLevel;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 状态(0-禁用 1-正常)
|
|
|
+ */
|
|
|
+ private Integer status;
|
|
|
+
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ */
|
|
|
+ private Date createTime;
|
|
|
+
|
|
|
+ @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;
|
|
|
+ }
|
|
|
+ User other = (User) that;
|
|
|
+ return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
|
|
|
+ && (this.getOpenId() == null ? other.getOpenId() == null : this.getOpenId().equals(other.getOpenId()))
|
|
|
+ && (this.getUnionId() == null ? other.getUnionId() == null : this.getUnionId().equals(other.getUnionId()))
|
|
|
+ && (this.getSessionKey() == null ? other.getSessionKey() == null : this.getSessionKey().equals(other.getSessionKey()))
|
|
|
+ && (this.getUsername() == null ? other.getUsername() == null : this.getUsername().equals(other.getUsername()))
|
|
|
+ && (this.getPassword() == null ? other.getPassword() == null : this.getPassword().equals(other.getPassword()))
|
|
|
+ && (this.getSalt() == null ? other.getSalt() == null : this.getSalt().equals(other.getSalt()))
|
|
|
+ && (this.getNickname() == null ? other.getNickname() == null : this.getNickname().equals(other.getNickname()))
|
|
|
+ && (this.getAvatar() == null ? other.getAvatar() == null : this.getAvatar().equals(other.getAvatar()))
|
|
|
+ && (this.getMobile() == null ? other.getMobile() == null : this.getMobile().equals(other.getMobile()))
|
|
|
+ && (this.getMemberLevel() == null ? other.getMemberLevel() == null : this.getMemberLevel().equals(other.getMemberLevel()))
|
|
|
+ && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
|
|
|
+ && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()));
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public int hashCode() {
|
|
|
+ final int prime = 31;
|
|
|
+ int result = 1;
|
|
|
+ result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
|
|
|
+ result = prime * result + ((getOpenId() == null) ? 0 : getOpenId().hashCode());
|
|
|
+ result = prime * result + ((getUnionId() == null) ? 0 : getUnionId().hashCode());
|
|
|
+ result = prime * result + ((getSessionKey() == null) ? 0 : getSessionKey().hashCode());
|
|
|
+ result = prime * result + ((getUsername() == null) ? 0 : getUsername().hashCode());
|
|
|
+ result = prime * result + ((getPassword() == null) ? 0 : getPassword().hashCode());
|
|
|
+ result = prime * result + ((getSalt() == null) ? 0 : getSalt().hashCode());
|
|
|
+ result = prime * result + ((getNickname() == null) ? 0 : getNickname().hashCode());
|
|
|
+ result = prime * result + ((getAvatar() == null) ? 0 : getAvatar().hashCode());
|
|
|
+ result = prime * result + ((getMobile() == null) ? 0 : getMobile().hashCode());
|
|
|
+ result = prime * result + ((getMemberLevel() == null) ? 0 : getMemberLevel().hashCode());
|
|
|
+ result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
|
|
|
+ result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public String toString() {
|
|
|
+ StringBuilder sb = new StringBuilder();
|
|
|
+ sb.append(getClass().getSimpleName());
|
|
|
+ sb.append(" [");
|
|
|
+ sb.append("Hash = ").append(hashCode());
|
|
|
+ sb.append(", id=").append(id);
|
|
|
+ sb.append(", openId=").append(openId);
|
|
|
+ sb.append(", unionId=").append(unionId);
|
|
|
+ sb.append(", sessionKey=").append(sessionKey);
|
|
|
+ sb.append(", username=").append(username);
|
|
|
+ sb.append(", password=").append(password);
|
|
|
+ sb.append(", salt=").append(salt);
|
|
|
+ sb.append(", nickname=").append(nickname);
|
|
|
+ sb.append(", avatar=").append(avatar);
|
|
|
+ sb.append(", mobile=").append(mobile);
|
|
|
+ sb.append(", memberLevel=").append(memberLevel);
|
|
|
+ sb.append(", status=").append(status);
|
|
|
+ sb.append(", createTime=").append(createTime);
|
|
|
+ sb.append(", serialVersionUID=").append(serialVersionUID);
|
|
|
+ sb.append("]");
|
|
|
+ return sb.toString();
|
|
|
+ }
|
|
|
+}
|