package com.linghu.model.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 javax.validation.constraints.Email; import javax.validation.constraints.NotBlank; import javax.validation.constraints.Size; import io.swagger.annotations.ApiModelProperty; import lombok.Data; /** * * @TableName user */ @TableName(value = "user") @Data public class User implements Serializable { /** * 用户id */ @TableId(type = IdType.AUTO) private Integer user_id; /** * 用户名 */ @NotBlank(message = "用户名不能为空") private String user_name; /** * 用户邮箱 */ @NotBlank(message = "邮箱不能为空") @Email(message = "邮箱格式不正确") private String user_email; /** * 密码 */ @NotBlank(message = "密码不能为空") @Size(min = 6, message = "密码长度至少6位") private String password; /** * 手机号 */ @ApiModelProperty(hidden = true) private Integer phone; /** * 分组id */ private Integer sectionalization_id; /** * 状态 */ private String status; @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.getUser_id() == null ? other.getUser_id() == null : this.getUser_id().equals(other.getUser_id())) && (this.getUser_name() == null ? other.getUser_name() == null : this.getUser_name().equals(other.getUser_name())) && (this.getUser_email() == null ? other.getUser_email() == null : this.getUser_email().equals(other.getUser_email())) && (this.getPassword() == null ? other.getPassword() == null : this.getPassword().equals(other.getPassword())) && (this.getPhone() == null ? other.getPhone() == null : this.getPhone().equals(other.getPhone())) && (this.getSectionalization_id() == null ? other.getSectionalization_id() == null : this.getSectionalization_id().equals(other.getSectionalization_id())) && (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 + ((getUser_id() == null) ? 0 : getUser_id().hashCode()); result = prime * result + ((getUser_name() == null) ? 0 : getUser_name().hashCode()); result = prime * result + ((getUser_email() == null) ? 0 : getUser_email().hashCode()); result = prime * result + ((getPassword() == null) ? 0 : getPassword().hashCode()); result = prime * result + ((getPhone() == null) ? 0 : getPhone().hashCode()); result = prime * result + ((getSectionalization_id() == null) ? 0 : getSectionalization_id().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(", user_id=").append(user_id); sb.append(", user_name=").append(user_name); sb.append(", user_email=").append(user_email); sb.append(", password=").append(password); sb.append(", phone=").append(phone); sb.append(", sectionalization_id=").append(sectionalization_id); sb.append(", status=").append(status); sb.append(", serialVersionUID=").append(serialVersionUID); sb.append("]"); return sb.toString(); } }