-
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.
Browse files
Browse the repository at this point in the history
본인인증코드 검증 API 구현
- Loading branch information
Showing
16 changed files
with
271 additions
and
13 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
25 changes: 25 additions & 0 deletions
25
src/main/java/com/ajou/hertz/common/auth/dto/request/VerifyUserAuthCodeRequest.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,25 @@ | ||
package com.ajou.hertz.common.auth.dto.request; | ||
|
||
import com.ajou.hertz.common.validator.PhoneNumber; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import jakarta.validation.constraints.NotBlank; | ||
import lombok.AccessLevel; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@AllArgsConstructor(access = AccessLevel.PRIVATE) | ||
@NoArgsConstructor(access = AccessLevel.PRIVATE) | ||
@Getter | ||
public class VerifyUserAuthCodeRequest { | ||
|
||
@Schema(description = "본인 인증 코드를 전달받은 사용자의 전화번호", example = "01012345678") | ||
@NotBlank | ||
@PhoneNumber | ||
private String phoneNumber; | ||
|
||
@Schema(description = "사용자가 전달받은 인증 코드", example = "1a2b3c4d") | ||
@NotBlank | ||
private String code; | ||
} |
14 changes: 14 additions & 0 deletions
14
src/main/java/com/ajou/hertz/common/auth/dto/response/VerifyUserAUthCodeResponse.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,14 @@ | ||
package com.ajou.hertz.common.auth.dto.response; | ||
|
||
import lombok.AccessLevel; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@AllArgsConstructor | ||
@NoArgsConstructor(access = AccessLevel.PRIVATE) | ||
@Getter | ||
public class VerifyUserAUthCodeResponse { | ||
|
||
private Boolean isSuccess; | ||
} |
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
11 changes: 11 additions & 0 deletions
11
src/main/java/com/ajou/hertz/common/auth/exception/InvalidAuthCodeException.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,11 @@ | ||
package com.ajou.hertz.common.auth.exception; | ||
|
||
import com.ajou.hertz.common.exception.BadRequestException; | ||
import com.ajou.hertz.common.exception.constant.CustomExceptionType; | ||
|
||
public class InvalidAuthCodeException extends BadRequestException { | ||
|
||
public InvalidAuthCodeException() { | ||
super(CustomExceptionType.USER_AUTH_CODE_NOT_FOUND); | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
src/main/java/com/ajou/hertz/common/auth/exception/UserAuthCodeNotFoundException.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,11 @@ | ||
package com.ajou.hertz.common.auth.exception; | ||
|
||
import com.ajou.hertz.common.exception.NotFoundException; | ||
import com.ajou.hertz.common.exception.constant.CustomExceptionType; | ||
|
||
public class UserAuthCodeNotFoundException extends NotFoundException { | ||
|
||
public UserAuthCodeNotFoundException() { | ||
super(CustomExceptionType.USER_AUTH_CODE_NOT_FOUND); | ||
} | ||
} |
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
6 changes: 3 additions & 3 deletions
6
src/main/java/com/ajou/hertz/common/auth/repository/UserAuthCodeRepository.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,12 +1,12 @@ | ||
package com.ajou.hertz.common.auth.repository; | ||
|
||
import java.util.Optional; | ||
|
||
import com.ajou.hertz.common.auth.entity.UserAuthCode; | ||
|
||
public interface UserAuthCodeRepository { | ||
|
||
UserAuthCode save(UserAuthCode userAuthCode); | ||
|
||
Optional<UserAuthCode> findByCode(String code); | ||
UserAuthCode getByCode(String code); | ||
|
||
void delete(UserAuthCode userAuthCode); | ||
} |
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
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
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: 9 additions & 0 deletions
9
src/main/java/com/ajou/hertz/common/message/service/MessageService.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,6 +1,15 @@ | ||
package com.ajou.hertz.common.message.service; | ||
|
||
import com.ajou.hertz.common.message.exception.SendMessageException; | ||
|
||
public interface MessageService { | ||
|
||
/** | ||
* 전달된 메시지 내용으로 사용자에게 문자를 발송한다. | ||
* | ||
* @param message 발송할 문자 내용 | ||
* @param targetPhoneNumber 발송하고자 하는 사용자의 전화번호 | ||
* @throws SendMessageException 메시지 발송 중 오류가 발생한 경우 | ||
*/ | ||
void sendShortMessage(String message, String targetPhoneNumber); | ||
} |
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
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
Oops, something went wrong.