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

124 lines
4.1 KiB
Java
Raw Normal View History

2024-07-13 03:44:20 +00:00
package com.example.takeawaysystemserver.entity;
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 lombok.Data;
/**
*
* @TableName address
*/
@TableName(value ="address")
@Data
public class Address implements Serializable {
/**
* 主键ID
*/
@TableId(type = IdType.AUTO)
private Integer id;
/**
* 用户ID
*/
private Integer userId;
/**
* 收货人
*/
private String consignee;
/**
* 手机号
*/
private String phone;
/**
* 省份
*/
private String province;
/**
* 市级名
*/
private String city;
/**
* 区级名
*/
private String district;
/**
* 详细地址
*/
private String detail;
/**
* 默认0否 1是
*/
private Integer isDefault;
@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;
}
Address other = (Address) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
&& (this.getConsignee() == null ? other.getConsignee() == null : this.getConsignee().equals(other.getConsignee()))
&& (this.getPhone() == null ? other.getPhone() == null : this.getPhone().equals(other.getPhone()))
&& (this.getProvince() == null ? other.getProvince() == null : this.getProvince().equals(other.getProvince()))
&& (this.getCity() == null ? other.getCity() == null : this.getCity().equals(other.getCity()))
&& (this.getDistrict() == null ? other.getDistrict() == null : this.getDistrict().equals(other.getDistrict()))
&& (this.getDetail() == null ? other.getDetail() == null : this.getDetail().equals(other.getDetail()))
&& (this.getIsDefault() == null ? other.getIsDefault() == null : this.getIsDefault().equals(other.getIsDefault()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
result = prime * result + ((getConsignee() == null) ? 0 : getConsignee().hashCode());
result = prime * result + ((getPhone() == null) ? 0 : getPhone().hashCode());
result = prime * result + ((getProvince() == null) ? 0 : getProvince().hashCode());
result = prime * result + ((getCity() == null) ? 0 : getCity().hashCode());
result = prime * result + ((getDistrict() == null) ? 0 : getDistrict().hashCode());
result = prime * result + ((getDetail() == null) ? 0 : getDetail().hashCode());
result = prime * result + ((getIsDefault() == null) ? 0 : getIsDefault().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(", userId=").append(userId);
sb.append(", consignee=").append(consignee);
sb.append(", phone=").append(phone);
sb.append(", province=").append(province);
sb.append(", city=").append(city);
sb.append(", district=").append(district);
sb.append(", detail=").append(detail);
sb.append(", isDefault=").append(isDefault);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
}