From e6dad51c545bd429264ebbc61efe643e4d79947b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B0=AC=EA=B8=B0?= Date: Fri, 3 Jan 2025 13:47:49 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20AboutSoptService=20MainService=20?= =?UTF-8?q?=EC=88=9C=ED=99=98=EC=B0=B8=EC=A1=B0=20=EC=98=A4=EB=A5=98=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=20&=20Crew=20API=20Token=20=ED=99=98?= =?UTF-8?q?=EA=B2=BD=20=EB=B3=80=EC=88=98=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/sopt/org/homepage/aboutsopt/AboutSoptService.java | 5 +++-- src/main/resources/application-dev.yml | 1 + src/main/resources/application-prod.yml | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/sopt/org/homepage/aboutsopt/AboutSoptService.java b/src/main/java/sopt/org/homepage/aboutsopt/AboutSoptService.java index 39a23e9..97fe40c 100644 --- a/src/main/java/sopt/org/homepage/aboutsopt/AboutSoptService.java +++ b/src/main/java/sopt/org/homepage/aboutsopt/AboutSoptService.java @@ -2,6 +2,7 @@ import java.util.stream.Collectors; import lombok.RequiredArgsConstructor; +import org.springframework.beans.factory.ObjectProvider; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import sopt.org.homepage.aboutsopt.dto.AboutSoptResponseDto; @@ -24,14 +25,14 @@ public class AboutSoptService { private static final int MINIMUM_PROJECT_COUNT = 10; private final AboutSoptRepository aboutSoptRepository; - private final MainService mainService; + private final ObjectProvider mainServiceProvider; private final CrewService crewService; private final PlaygroundService playgroundService; private final ProjectService projectService; public GetAboutSoptResponseDto getAboutSopt(Integer generation) { - int currentGeneration = generation != null ? generation : mainService.getLatestGeneration(); + int currentGeneration = generation != null ? generation : mainServiceProvider.getObject().getLatestGeneration(); AboutSoptEntity aboutSopt = aboutSoptRepository.findByIdAndIsPublishedTrue(Long.valueOf(currentGeneration)) diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index c5402e2..69ff56c 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -51,6 +51,7 @@ internal: token: ${PLAYGROUND_API_URL_JWT_TOKEN} crew: url: ${CREW_API_URL} + token: ${CREW_API_URL_JWT_TOKEN} jwt: access: ${ACCESS_TOKEN_SECRET} diff --git a/src/main/resources/application-prod.yml b/src/main/resources/application-prod.yml index fda8837..21bca93 100644 --- a/src/main/resources/application-prod.yml +++ b/src/main/resources/application-prod.yml @@ -50,6 +50,7 @@ internal: token: ${PLAYGROUND_API_URL_JWT_TOKEN} crew: url: ${CREW_API_URL} + token: ${CREW_API_URL_JWT_TOKEN} jwt: access: ${ACCESS_TOKEN_SECRET}