-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUserRequestDTO.java
33 lines (30 loc) · 1022 Bytes
/
UserRequestDTO.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package com.ivansan.blogfinalproject.dto;
import jakarta.validation.constraints.Pattern;
import lombok.*;
@Data
@Getter
@AllArgsConstructor
@Builder
public class UserRequestDTO{
@NonNull
@Pattern(
regexp = "^[a-zA-Z0-9._]{2,20}$",
message = "username must be between 2 and 20 characters and can only contain letters, numbers, and the following characters: . _"
)
String username;
@NonNull
@Pattern(
regexp = "^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.*[@$!%*?&])[A-Za-z\\d@$!%*?&]{8,}$"
,message = "password must contain at least 1 lowercase letter,1 uppercase letter,1 digit and 1 special character"
)
String password;
@NonNull
@Pattern(
regexp = "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$",
message = "Invalid email format."
)
String email;
String image;
String provider;
String providerId;
}