-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
#152 [feat] 전화번호 인증 api 유효성 검사 추가
- Loading branch information
Showing
4 changed files
with
22 additions
and
5 deletions.
There are no files selected for viewing
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
9 changes: 8 additions & 1 deletion
9
src/main/java/com/moddy/server/controller/auth/dto/request/PhoneNumberRequestDto.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,4 +1,11 @@ | ||
package com.moddy.server.controller.auth.dto.request; | ||
|
||
public record PhoneNumberRequestDto(String phoneNumber) { | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import jakarta.validation.constraints.Pattern; | ||
|
||
public record PhoneNumberRequestDto( | ||
@Schema(example = "01020000000") | ||
@Pattern(regexp = "^010[0-9]{8}$", message = "phoneNumber는 01011112222형태입니다.") | ||
String phoneNumber | ||
) { | ||
} |
12 changes: 11 additions & 1 deletion
12
src/main/java/com/moddy/server/controller/auth/dto/request/VerifyCodeRequestDto.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,4 +1,14 @@ | ||
package com.moddy.server.controller.auth.dto.request; | ||
|
||
public record VerifyCodeRequestDto(String phoneNumber, String verifyCode) { | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import jakarta.validation.constraints.Pattern; | ||
|
||
public record VerifyCodeRequestDto( | ||
@Schema(example = "01020000000") | ||
@Pattern(regexp = "^010[0-9]{8}$", message = "phoneNumber는 01011112222형태입니다.") | ||
String phoneNumber, | ||
@Schema(example = "123456") | ||
@Pattern(regexp = "[0-9]{6}$", message = "verifyCode는 123456형태입니다.") | ||
String verifyCode | ||
) { | ||
} |
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