From 4dcec9eac1d918658cdddc0204c5cd7bc024242f Mon Sep 17 00:00:00 2001 From: YongHwan Kim Date: Mon, 13 Nov 2023 17:41:14 +0900 Subject: [PATCH] =?UTF-8?q?[=08fix]=20=ED=8F=AC=ED=8A=B8=ED=8F=B4=EB=A6=AC?= =?UTF-8?q?=EC=98=A4=20=EC=88=98=EC=9D=B5=20=ED=9E=88=EC=8A=A4=ED=86=A0?= =?UTF-8?q?=EB=A6=AC=20=EC=83=9D=EC=84=B1=20=EB=A9=94=EC=86=8C=EB=93=9C?= =?UTF-8?q?=EC=97=90=20@Transactional=20=EC=B6=94=EA=B0=80=20(#12)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * #4 fix: 인가 코드 요청 URL 경로 변경 - /api/auth/:provider/url -> /api/auth/:provider/authUrl * #4 feat: 로그 추가 - 네이버 소셜 로그인 버그를 위한 로그 추가 * #4 fix: 포트폴리오 수익 히스토리 생성 메소드에 @Transactional 추가 --- .../PortfolioGainHistoryService.java | 17 +---------------- .../PortfolioNotificationService.java | 2 -- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/src/main/java/codesquad/fineants/spring/api/portfolio_gain_history/PortfolioGainHistoryService.java b/src/main/java/codesquad/fineants/spring/api/portfolio_gain_history/PortfolioGainHistoryService.java index 04187957e..6c5859f38 100644 --- a/src/main/java/codesquad/fineants/spring/api/portfolio_gain_history/PortfolioGainHistoryService.java +++ b/src/main/java/codesquad/fineants/spring/api/portfolio_gain_history/PortfolioGainHistoryService.java @@ -2,9 +2,7 @@ import java.time.LocalDateTime; import java.util.ArrayList; -import java.util.Collection; import java.util.List; -import java.util.stream.Collectors; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Service; @@ -14,9 +12,6 @@ import codesquad.fineants.domain.portfolio.PortfolioRepository; import codesquad.fineants.domain.portfolio_gain_history.PortfolioGainHistory; import codesquad.fineants.domain.portfolio_gain_history.PortfolioGainHistoryRepository; -import codesquad.fineants.domain.portfolio_holding.PortfolioHolding; -import codesquad.fineants.domain.stock.Stock; -import codesquad.fineants.spring.api.kis.KisService; import codesquad.fineants.spring.api.kis.manager.CurrentPriceManager; import codesquad.fineants.spring.api.portfolio_gain_history.response.PortfolioGainHistoryCreateResponse; import lombok.RequiredArgsConstructor; @@ -29,9 +24,9 @@ public class PortfolioGainHistoryService { private final PortfolioGainHistoryRepository repository; private final PortfolioRepository portfolioRepository; - private final KisService kisService; private final CurrentPriceManager currentPriceManager; + @Transactional @Scheduled(cron = "0 0 16 * * ?") // 매일 16시에 실행 public void scheduledPortfolioGainHistory() { PortfolioGainHistoryCreateResponse response = addPortfolioGainHistory(); @@ -53,14 +48,4 @@ public PortfolioGainHistoryCreateResponse addPortfolioGainHistory() { return PortfolioGainHistoryCreateResponse.from(portfolioGainHistories); } - - private static List readTickerSymbols(List portfolios) { - List tickerSymbols = portfolios.stream() - .map(Portfolio::getPortfolioHoldings) - .flatMap(Collection::stream) - .map(PortfolioHolding::getStock) - .map(Stock::getTickerSymbol) - .collect(Collectors.toList()); - return tickerSymbols; - } } diff --git a/src/main/java/codesquad/fineants/spring/api/portfolio_notification/PortfolioNotificationService.java b/src/main/java/codesquad/fineants/spring/api/portfolio_notification/PortfolioNotificationService.java index 2b219dbe4..cb7787fdf 100644 --- a/src/main/java/codesquad/fineants/spring/api/portfolio_notification/PortfolioNotificationService.java +++ b/src/main/java/codesquad/fineants/spring/api/portfolio_notification/PortfolioNotificationService.java @@ -13,7 +13,6 @@ import codesquad.fineants.domain.portfolio.PortfolioRepository; import codesquad.fineants.spring.api.errors.errorcode.PortfolioErrorCode; import codesquad.fineants.spring.api.errors.exception.NotFoundResourceException; -import codesquad.fineants.spring.api.kis.KisService; import codesquad.fineants.spring.api.kis.manager.CurrentPriceManager; import codesquad.fineants.spring.api.portfolio_notification.request.PortfolioNotificationModifyRequest; import codesquad.fineants.spring.api.portfolio_notification.response.PortfolioNotificationModifyResponse; @@ -28,7 +27,6 @@ public class PortfolioNotificationService { private final PortfolioRepository portfolioRepository; private final MailService mailService; - private final KisService kisService; private final RedisTemplate redisTemplate; private final CurrentPriceManager currentPriceManager;