-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathChangePasswordRequest.java
More file actions
33 lines (27 loc) · 1.04 KB
/
ChangePasswordRequest.java
File metadata and controls
33 lines (27 loc) · 1.04 KB
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 knu_chatbot.presentation.request;
import jakarta.validation.constraints.NotBlank;
import knu_chatbot.application.dto.response.ChangePasswordServiceRequest;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;
@Getter
@NoArgsConstructor
public class ChangePasswordRequest {
@NotBlank(message = "이전 비밀번호는 필수입니다.")
private String oldPassword;
@NotBlank(message = "새로운 비밀번호는 필수입니다.")
@Length(min = 8, max = 20, message = "길이는 최소 8글자, 최대 20글자 입니다.")
private String newPassword;
@Builder
public ChangePasswordRequest(String oldPassword, String newPassword) {
this.oldPassword = oldPassword;
this.newPassword = newPassword;
}
public ChangePasswordServiceRequest toServiceRequest() {
return ChangePasswordServiceRequest.builder()
.oldPassword(oldPassword)
.newPassword(newPassword)
.build();
}
}