TakeawaySystemServer/src/main/java/com/example/takeawaysystemserver/entity/User.java

95 lines
2.8 KiB
Java
Raw Normal View History

2024-07-07 07:09:10 +00:00
package com.example.takeawaysystemserver.entity;
import java.io.Serializable;
2024-07-12 03:31:27 +00:00
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.AllArgsConstructor;
import lombok.Builder;
2024-07-07 07:09:10 +00:00
import lombok.Data;
2024-07-12 03:31:27 +00:00
import lombok.NoArgsConstructor;
2024-07-07 07:09:10 +00:00
/**
*
* @TableName user
2024-07-07 07:09:10 +00:00
*/
@Data
2024-07-12 03:31:27 +00:00
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class User implements Serializable {
/**
* 主键ID
*/
2024-07-12 03:31:27 +00:00
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
/**
* 用户名
*/
2024-07-10 03:17:34 +00:00
private String username;
/**
* 密码
*/
2024-07-10 03:17:34 +00:00
private String password;
/**
* 手机号
*/
2024-07-10 03:17:34 +00:00
private String phone;
2024-07-10 03:17:34 +00:00
/**
* 用户状态0被删除1:正常2:被封禁
2024-07-10 03:17:34 +00:00
*/
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();
}
}