This repository has been archived by the owner on Mar 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
37 additions
and
9 deletions.
There are no files selected for viewing
5 changes: 2 additions & 3 deletions
5
...ava/fc/be/app/common/authentication/controller/dto/request/ModifyLostPasswordRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,17 @@ | ||
package fc.be.app.common.authentication.controller.dto.request; | ||
|
||
import fc.be.app.domain.member.controller.validation.Password; | ||
import jakarta.validation.constraints.Email; | ||
import jakarta.validation.constraints.NotBlank; | ||
import jakarta.validation.constraints.NotNull; | ||
import jakarta.validation.constraints.Pattern; | ||
|
||
public record ModifyLostPasswordRequest( | ||
@NotBlank | ||
String token, | ||
@NotNull | ||
String email, | ||
@Pattern(regexp = "^(?=.*[a-zA-Z])(?=.*[!@#$%^&*()])(?=.*[0-9]).{8,16}$") | ||
@NotBlank | ||
@Password | ||
String newPassword | ||
) { | ||
} |
5 changes: 2 additions & 3 deletions
5
...in/java/fc/be/app/common/authentication/controller/dto/request/ModifyPasswordRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,12 @@ | ||
package fc.be.app.common.authentication.controller.dto.request; | ||
|
||
import fc.be.app.domain.member.controller.validation.Password; | ||
import jakarta.validation.constraints.NotBlank; | ||
import jakarta.validation.constraints.Pattern; | ||
|
||
public record ModifyPasswordRequest( | ||
@NotBlank | ||
String token, | ||
@Pattern(regexp = "^(?=.*[a-zA-Z])(?=.*[!@#$%^&*()])(?=.*[0-9]).{8,16}$") | ||
@NotBlank | ||
@Password | ||
String newPassword | ||
) { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
app/src/main/java/fc/be/app/domain/member/controller/dto/request/DeleteMemberRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
package fc.be.app.domain.member.controller.dto.request; | ||
|
||
import jakarta.validation.constraints.Pattern; | ||
import fc.be.app.domain.member.controller.validation.Password; | ||
|
||
public record DeleteMemberRequest( | ||
@Pattern(regexp = "^(?=.*[a-zA-Z])(?=.*[!@#$%^&*()])(?=.*[0-9]).{8,16}$") | ||
@Password | ||
String password | ||
) { | ||
} |
29 changes: 29 additions & 0 deletions
29
app/src/main/java/fc/be/app/domain/member/controller/validation/Password.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package fc.be.app.domain.member.controller.validation; | ||
|
||
import jakarta.validation.Constraint; | ||
import jakarta.validation.Payload; | ||
import jakarta.validation.ReportAsSingleViolation; | ||
import jakarta.validation.constraints.NotNull; | ||
import jakarta.validation.constraints.Pattern; | ||
|
||
import java.lang.annotation.Documented; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.Target; | ||
|
||
import static java.lang.annotation.ElementType.*; | ||
import static java.lang.annotation.RetentionPolicy.RUNTIME; | ||
|
||
@NotNull | ||
@Pattern(regexp = "^(?=.*[a-zA-Z])(?=.*[!@#$%^&*()])(?=.*\\d).{8,16}$") | ||
@Documented | ||
@Constraint(validatedBy = {}) | ||
@Target({METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER, TYPE_USE}) | ||
@Retention(RUNTIME) | ||
@ReportAsSingleViolation | ||
public @interface Password { | ||
String message() default "유효하지 않은 비밀번호 폼입니다"; | ||
|
||
Class<?>[] groups() default {}; | ||
|
||
Class<? extends Payload>[] payload() default {}; | ||
} |