首页>代码>spring+spring mvc+mybatis整合实现用户登录注册功能(idea用maven搭建)>/ssm-02/src/main/java/neusoft/pojo/User.java
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 + '}'; } }
最近下载更多
Sul_ALL LV1
3月20日
微信网友_6802079662936064 LV3
2023年12月31日
微信网友_6738347199975424
2023年11月16日
暂无贡献等级
微信网友_6722962072784896 LV1
2023年11月5日
logitch LV1
2023年10月10日
1289755 LV3
2023年7月30日
ljkljk332 LV1
2023年6月29日
微信网友_6536139133505536 LV1
2023年6月26日
saury7 LV1
2023年6月19日
微信网友_6522850944520192 LV1
2023年6月17日
最近浏览更多
微信网友_6512020493586432 LV2
4月12日
Sul_ALL LV1
3月16日
songsmm LV1
3月11日
微信网友_6802079662936064 LV3
2023年12月31日
1QAZWSX
2023年12月28日
暂无贡献等级
wwwww816 LV3
2023年12月19日
yexinggg
2023年12月15日
暂无贡献等级
hamberduan LV1
2023年12月10日
微信网友_6753981327003648
2023年11月27日
暂无贡献等级
微信网友_6738347199975424
2023年11月16日
暂无贡献等级