You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

89 lines
2.6 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

package com.yanzhen.entity;
import javax.validation.constraints.NotNull;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.hibernate.validator.constraints.Length;
import com.yanzhen.utils.Entity;
import java.util.Date;
import java.util.List;
public class User extends Entity{ // 定义一个User类继承自Entity类
private Integer id; // 用户的唯一标识符
@Length(max = 100) // 用户名的最大长度限制为100个字符
private String userName; // 用户的用户名
@Length(max = 100) // 密码的最大长度限制为100个字符
private String password; // 用户的密码
@Length(max = 100) // 姓名的最大长度限制为100个字符
private String name; // 用户的姓名
@Length(max = 100) // 电话号码的最大长度限制为100个字符
private String phone; // 用户的电话号码
private Integer type; // 用户的类型0表示管理员1表示宿管员
@Length(max = 200) // 备注信息的最大长度限制为200个字符
private String remark; // 用户的备注信息
private List<Integer> ids; // 存储多个ID的列表
public Integer getId() { // 获取用户ID的方法
return id;
}
public void setId(Integer id) { // 设置用户ID的方法
this.id = id;
}
public String getUserName() { // 获取用户名的方法
return userName;
}
public void setUserName(String userName) { // 设置用户名的方法
this.userName = userName;
}
@JsonIgnore // 在序列化时忽略此属性
public String getPassword() { // 获取用户密码的方法
return password;
}
@JsonProperty // 在序列化时包含此属性
public void setPassword(String password) { // 设置用户密码的方法
this.password = password;
}
public String getName() { // 获取用户姓名的方法
return name;
}
public void setName(String name) { // 设置用户姓名的方法
this.name = name;
}
public String getPhone() { // 获取用户电话号码的方法
return phone;
}
public void setPhone(String phone) { // 设置用户电话号码的方法
this.phone = phone;
}
public Integer getType() { // 获取用户类型的方法
return type;
}
public void setType(Integer type) { // 设置用户类型的方法
this.type = type;
}
public String getRemark() { // 获取用户备注信息的方法
return remark;
}
public void setRemark(String remark) { // 设置用户备注信息的方法
this.remark = remark;
}
public List<Integer> getIds() { // 获取ID列表的方法
return ids;
}
public void setIds(List<Integer> ids) { // 设置ID列表的方法
this.ids = ids;
}
}