mirror of
https://github.com/PlayEdu/PlayEdu
synced 2025-12-25 20:35:35 +08:00
表单校验
This commit is contained in:
54
src/main/java/xyz/playedu/api/request/LoginRequest.java
Normal file
54
src/main/java/xyz/playedu/api/request/LoginRequest.java
Normal file
@@ -0,0 +1,54 @@
|
||||
package xyz.playedu.api.request;
|
||||
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class LoginRequest implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@NotNull(message = "请输入邮箱")
|
||||
public String email;
|
||||
|
||||
@NotNull(message = "请输入密码")
|
||||
public String password;
|
||||
|
||||
@NotNull(message = "请输入图形验证码")
|
||||
public String captchaValue;
|
||||
|
||||
@NotNull(message = "captchaKey参数为空")
|
||||
public String captchaKey;
|
||||
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
|
||||
public void setEmail(String email) {
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public String getCaptchaValue() {
|
||||
return captchaValue;
|
||||
}
|
||||
|
||||
public void setCaptchaValue(String captchaValue) {
|
||||
this.captchaValue = captchaValue;
|
||||
}
|
||||
|
||||
public String getCaptchaKey() {
|
||||
return captchaKey;
|
||||
}
|
||||
|
||||
public void setCaptchaKey(String captchaKey) {
|
||||
this.captchaKey = captchaKey;
|
||||
}
|
||||
}
|
||||
34
src/main/java/xyz/playedu/api/request/PaginationRequest.java
Normal file
34
src/main/java/xyz/playedu/api/request/PaginationRequest.java
Normal file
@@ -0,0 +1,34 @@
|
||||
package xyz.playedu.api.request;
|
||||
|
||||
import jakarta.validation.constraints.Max;
|
||||
import jakarta.validation.constraints.Min;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class PaginationRequest implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Min(value = 1, message = "page参数值不能少于1")
|
||||
public Integer page = 1;
|
||||
|
||||
@Min(value = 1, message = "size参数值不能少于1")
|
||||
@Max(value = 1000, message = "size参数值不能超过1000")
|
||||
public Integer size = 10;
|
||||
|
||||
public Integer getPage() {
|
||||
return page;
|
||||
}
|
||||
|
||||
public void setPage(Integer page) {
|
||||
this.page = page;
|
||||
}
|
||||
|
||||
public Integer getSize() {
|
||||
return size;
|
||||
}
|
||||
|
||||
public void setSize(Integer size) {
|
||||
this.size = size;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user