95 lines
2.8 KiB
Java
95 lines
2.8 KiB
Java
package com.example.takeawaysystemserver.entity;
|
||
|
||
import java.io.Serializable;
|
||
|
||
import com.baomidou.mybatisplus.annotation.IdType;
|
||
import com.baomidou.mybatisplus.annotation.TableId;
|
||
import lombok.AllArgsConstructor;
|
||
import lombok.Builder;
|
||
import lombok.Data;
|
||
import lombok.NoArgsConstructor;
|
||
|
||
/**
|
||
*
|
||
* @TableName user
|
||
*/
|
||
@Data
|
||
@AllArgsConstructor
|
||
@NoArgsConstructor
|
||
@Builder
|
||
public class User implements Serializable {
|
||
/**
|
||
* 主键ID
|
||
*/
|
||
@TableId(value = "id", type = IdType.AUTO)
|
||
private Integer id;
|
||
|
||
/**
|
||
* 用户名
|
||
*/
|
||
private String username;
|
||
|
||
/**
|
||
* 密码
|
||
*/
|
||
private String password;
|
||
|
||
/**
|
||
* 手机号
|
||
*/
|
||
private String phone;
|
||
|
||
/**
|
||
* 用户状态,0:被删除,1:正常,2:被封禁
|
||
*/
|
||
private Integer status;
|
||
|
||
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.getUsername() == null ? other.getUsername() == null : this.getUsername().equals(other.getUsername()))
|
||
&& (this.getPassword() == null ? other.getPassword() == null : this.getPassword().equals(other.getPassword()))
|
||
&& (this.getPhone() == null ? other.getPhone() == null : this.getPhone().equals(other.getPhone()))
|
||
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()));
|
||
}
|
||
|
||
@Override
|
||
public int hashCode() {
|
||
final int prime = 31;
|
||
int result = 1;
|
||
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
|
||
result = prime * result + ((getUsername() == null) ? 0 : getUsername().hashCode());
|
||
result = prime * result + ((getPassword() == null) ? 0 : getPassword().hashCode());
|
||
result = prime * result + ((getPhone() == null) ? 0 : getPhone().hashCode());
|
||
result = prime * result + ((getStatus() == null) ? 0 : getStatus().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(", username=").append(username);
|
||
sb.append(", password=").append(password);
|
||
sb.append(", phone=").append(phone);
|
||
sb.append(", status=").append(status);
|
||
sb.append(", serialVersionUID=").append(serialVersionUID);
|
||
sb.append("]");
|
||
return sb.toString();
|
||
}
|
||
} |