mirror of
https://github.com/201206030/novel.git
synced 2025-04-27 07:30:50 +00:00
build: 集成参数校验支持
This commit is contained in:
parent
3092635141
commit
2328bc516e
6
pom.xml
6
pom.xml
@ -92,6 +92,12 @@
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- 请求参数校验相关 -->
|
||||
<dependency>
|
||||
<groupId>org.hibernate.validator</groupId>
|
||||
<artifactId>hibernate-validator</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
|
@ -0,0 +1,29 @@
|
||||
package io.github.xxyopen.novel.dto.req;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.Pattern;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 用户注册 请求DTO
|
||||
*
|
||||
* @author xiongxiaoyang
|
||||
* @date 2022/5/16
|
||||
*/
|
||||
@Data
|
||||
public class UserRegisterReqDto {
|
||||
|
||||
@NotBlank(message="手机号不能为空!")
|
||||
@Pattern(regexp="^1[3|4|5|6|7|8|9][0-9]{9}$",message="手机号格式不正确!")
|
||||
private String username;
|
||||
|
||||
@NotBlank(message="密码不能为空!")
|
||||
private String password;
|
||||
|
||||
@NotBlank(message="验证码不能为空!")
|
||||
@Pattern(regexp="^\\d{4}$",message="验证码格式不正确!")
|
||||
private String velCode;
|
||||
|
||||
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user