-
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.
* test: 액세스 토큰 만료시 예외케이스 추가 * fix: Flux 방식에서 단순 반복문으로 변경 - 병렬 과정에서 액세스 토큰 만료시 무한 시도 문제 해결을 위해서 단순화 * test: 테스트 수정 * test: todo 주석 추가 * feat: kisException 객체로 매핑하여 반환하도록 변경 * test: 테스트 실패 해결 * test: 초당 거래 건수 초과 에러 응답하는 예외 케이스 추가 * feat: returnCode, messageCode 필드 추가 * feat: KisException의 서브 클래스 추가 * feat: onErrorResume 및 retryWhen 연산 수정 - 액세스 토큰이 만료되는 경우에는 Mono.empty() 반환 - retryWhen 연산에서 요청건수 초과인 경우에만 재시도하도록 함 * feat: KisClient의 에러 핸들 처리 메서드(handleError) 수정 - 한국투자증권서버로부터 에러 응답을 수신 시 KisErrorResponse로 매핑한 다음에 Exception으로 변환 * feat: 한국투자증권 서버의 에러 응답 객체 구 * rename: 클래스명 변경 * refactor: toException 메서드 변경 - switch 문으로 개선 * test: Exception 생성 부분을 정적 팩토리 호출로 변경 * refactor: null 체크 조건문 삭제 * feat: 재시도 연산이 실패했을시 onErrorResume 추가 * test: 재시도 연산이 실패시 예외 테스트 추가 * test: kisClient 모킹 처리 * test: 다수 종목 갱신 테스트 추가 * refactor: Flux 방식으로 변경 * refactor: onErrorResume 연산 수정 * test: 테스트 코드 수정 * feat: 액세스 토큰 관련 예외 추가 * feat: accessToken 널 체크 추가 * feat: doOnSuccess 연산 추가 * feat: CredeintailsTypeException 조건 추가 * fix: @CheckKisAccessToken 애노테이션 제거 - 비동기로 실행중 액세스 토큰 제거 또는 만료시 aop의 blockoptional에 의해서 에러 발생하여 kisService로 이동하고자 애노테이션을 제거함 * feat: deleteAccessToken api 추가 * feat: kisService에 액세스 토큰 체크 애노테이션 추가 * test: 레디스 클리너 추가 * fix: 메서드명 변경 * refactor: fetchDividend 반환 타입 변경 * rename: 메서드명 변경 * rename: 메서드명 변경 * refactor: delayManager로 변경 * test: delayManager 추가하여 테스트 실패 해결 * test: delayManager를 @SpyBean으로 변경 * test: holidayManager 필드 제거 * feat: 액세스 토큰 재발급 관련 수정
- Loading branch information
1 parent
6fcabf7
commit d06b81a
Showing
29 changed files
with
429 additions
and
246 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
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
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
33 changes: 33 additions & 0 deletions
33
src/main/java/codesquad/fineants/domain/kis/domain/dto/response/KisErrorResponse.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,33 @@ | ||
package codesquad.fineants.domain.kis.domain.dto.response; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
import codesquad.fineants.global.errors.exception.kis.CredentialsTypeKisException; | ||
import codesquad.fineants.global.errors.exception.kis.ExpiredAccessTokenKisException; | ||
import codesquad.fineants.global.errors.exception.kis.KisException; | ||
import codesquad.fineants.global.errors.exception.kis.RequestLimitExceededKisException; | ||
import codesquad.fineants.global.errors.exception.kis.TokenIssuanceRetryLaterKisException; | ||
import lombok.AccessLevel; | ||
import lombok.NoArgsConstructor; | ||
import lombok.ToString; | ||
|
||
@NoArgsConstructor(access = AccessLevel.PRIVATE) | ||
@ToString | ||
public class KisErrorResponse { | ||
@JsonProperty("rt_cd") | ||
private String returnCode; | ||
@JsonProperty("msg_cd") | ||
private String messageCode; | ||
@JsonProperty("msg1") | ||
private String message; | ||
|
||
public KisException toException() { | ||
return switch (messageCode) { | ||
case "EGW00201" -> new RequestLimitExceededKisException(returnCode, messageCode, message); | ||
case "EGW00133" -> new TokenIssuanceRetryLaterKisException(returnCode, messageCode, message); | ||
case "EGW00123" -> new ExpiredAccessTokenKisException(returnCode, messageCode, message); | ||
case "EGW00205" -> new CredentialsTypeKisException(returnCode, messageCode, message); | ||
default -> new KisException(returnCode, messageCode, message); | ||
}; | ||
} | ||
} |
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
Oops, something went wrong.