package neusoft.pojo;

import org.hibernate.validator.constraints.Length;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.*;
import java.util.Date;

public class User {
    private Integer id;
    @NotNull(message = "用户名不能为空")
    @Length(message = "用户名长度必须{min}-{max}在之间", max = 20, min = 4)
    private String name;
    @NotNull(message = "密码不能为空")
    @Size(min = 6, message = "密码长度不能小于{min}")
    private String password;
    @Email(message = "邮箱格式不对")
    private String email;
    @Pattern(regexp = "^1([358][0-9]|4[579]|66|7[0135678]|9[89])[0-9]{8}$", message = "手机号码不正确")
    private String phone;
    @DateTimeFormat(pattern = "yyyy-MM-dd hh:mm:ss")//记得去springmvc注解consersionService
    @Past(message = "注册日期不对")
    private Date regDate;
    @DateTimeFormat(pattern = "yyyy-MM-dd hh:mm:ss")//记得去springmvc注解consersionService
    @Past(message = "最后一次登录日期不对")
    private Date lastLoginDate;

    public User(){

    }

    public User(Integer id, String name, String password, String email, String phone, Date regDate, Date lastLoginDate) {
        this.id = id;
        this.name = name;
        this.password = password;
        this.email = email;
        this.phone = phone;
        this.regDate = regDate;
        this.lastLoginDate = lastLoginDate;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public Date getRegDate() {
        return regDate;
    }

    public void setRegDate(Date regDate) {
        this.regDate = regDate;
    }

    public Date getLastLoginDate() {
        return lastLoginDate;
    }

    public void setLastLoginDate(Date lastLoginDate) {
        this.lastLoginDate = lastLoginDate;
    }

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", password='" + password + '\'' +
                ", email='" + email + '\'' +
                ", phone='" + phone + '\'' +
                ", regDate=" + regDate +
                ", lastLoginDate=" + lastLoginDate +
                '}';
    }
}
最近下载更多
xiubiaoya  LV1 6月1日
vincemokea  LV5 4月23日
22048042  LV1 4月9日
哪里的完整版  LV8 3月1日
zhoubowen  LV3 2024年12月29日
lee041022  LV1 2024年12月13日
王高阳  LV1 2024年10月9日
qiwwwww  LV2 2024年6月20日
Sul_ALL  LV1 2024年3月20日
最近浏览更多
241404 6月6日
暂无贡献等级
xiubiaoya  LV1 6月1日
vincemokea  LV5 4月23日
22048042  LV1 4月9日
哪里的完整版  LV8 3月1日
zhoubowen  LV3 2024年12月29日
lee041022  LV1 2024年12月13日
xiaoaitx  LV8 2024年11月22日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友