Skip to content

Commit

Permalink
#343 fix: kis 프로퍼티명 버그 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
yonghwankim-dev committed May 28, 2024
1 parent 157fc6a commit 2e3f549
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
import org.springframework.web.reactive.function.client.ClientResponse;
import org.springframework.web.reactive.function.client.WebClient;

import codesquad.fineants.global.errors.exception.KisException;
import codesquad.fineants.domain.kis.properties.OauthKisProperties;
import codesquad.fineants.domain.kis.domain.dto.response.KisClosingPrice;
import codesquad.fineants.domain.kis.domain.dto.response.KisDividend;
import codesquad.fineants.domain.kis.domain.dto.response.KisDividendWrapper;
import codesquad.fineants.domain.kis.properties.OauthKisProperties;
import codesquad.fineants.global.errors.exception.KisException;
import lombok.extern.slf4j.Slf4j;
import reactor.core.publisher.Mono;
import reactor.util.retry.Retry;
Expand Down Expand Up @@ -52,12 +52,12 @@ public Mono<KisAccessToken> fetchAccessToken() {
requestBodyMap.put("appsecret", oauthKisProperties.getSecretkey());
return webClient
.post()
.uri(oauthKisProperties.getTokenURI())
.uri(oauthKisProperties.getTokenUrl())
.bodyValue(requestBodyMap)
.retrieve()
.onStatus(HttpStatus::isError, this::handleError)
.bodyToMono(KisAccessToken.class)
.retryWhen(Retry.fixedDelay(Long.MAX_VALUE, Duration.ofMinutes(1)))
.retryWhen(Retry.fixedDelay(Long.MAX_VALUE, Duration.ofSeconds(5)))
.log();
}

Expand All @@ -74,7 +74,7 @@ public Mono<KisCurrentPrice> fetchCurrentPrice(String tickerSymbol, String autho
queryParamMap.add("fid_input_iscd", tickerSymbol);

return performGet(
oauthKisProperties.getCurrentPriceURI(),
oauthKisProperties.getCurrentPriceUrl(),
headerMap,
queryParamMap,
KisCurrentPrice.class
Expand All @@ -98,7 +98,7 @@ public Mono<KisClosingPrice> fetchClosingPrice(String tickerSymbol, String autho
queryParamMap.add("FID_ORG_ADJ_PRC", "0");

return performGet(
oauthKisProperties.getLastDayClosingPriceURI(),
oauthKisProperties.getClosingPriceUrl(),
headerMap,
queryParamMap,
KisClosingPrice.class
Expand All @@ -124,7 +124,7 @@ public String fetchDividend(String tickerSymbol, String authorization) {
queryParamMap.add("SHT_CD", tickerSymbol);

return performGet(
oauthKisProperties.getDividendURI(),
oauthKisProperties.getDividendUrl(),
headerMap,
queryParamMap,
String.class,
Expand All @@ -150,7 +150,7 @@ public List<KisDividend> fetchDividendAll(LocalDate from, LocalDate to, String a
queryParamMap.add("SHT_CD", Strings.EMPTY);

KisDividendWrapper result = performGet(
oauthKisProperties.getDividendURI(),
oauthKisProperties.getDividendUrl(),
headerMap,
queryParamMap,
KisDividendWrapper.class,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ public class OauthKisProperties {

private final String appkey;
private final String secretkey;
private final String tokenURI;
private final String currentPriceURI;
private final String lastDayClosingPriceURI;
private final String dividendURI;
private final String tokenUrl;
private final String currentPriceUrl;
private final String closingPriceUrl;
private final String dividendUrl;

@ConstructorBinding
public OauthKisProperties(String appkey, String secretkey, String tokenURI, String currentPriceURI,
String lastDayClosingPriceURI, String dividendURI) {
public OauthKisProperties(String appkey, String secretkey, String tokenUrl, String currentPriceUrl,
String closingPriceUrl, String dividendUrl) {
this.appkey = appkey;
this.secretkey = secretkey;
this.tokenURI = tokenURI;
this.currentPriceURI = currentPriceURI;
this.lastDayClosingPriceURI = lastDayClosingPriceURI;
this.dividendURI = dividendURI;
this.tokenUrl = tokenUrl;
this.currentPriceUrl = currentPriceUrl;
this.closingPriceUrl = closingPriceUrl;
this.dividendUrl = dividendUrl;
}
}

0 comments on commit 2e3f549

Please sign in to comment.