From a710e517e8bf5bb6cb8dd43b3ff53c5bfdd5e9f2 Mon Sep 17 00:00:00 2001 From: Kim Jiyoon Date: Tue, 13 Aug 2024 23:48:58 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20gpt=20=EC=9D=91=EB=8B=B5=EC=97=90=20?= =?UTF-8?q?=ED=99=94=ED=8F=90=20=EB=8B=A8=EC=9C=84=EB=8F=84=20=ED=8F=AC?= =?UTF-8?q?=ED=95=A8=EB=90=98=EB=8F=84=EB=A1=9D=20dto=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../backend/domain/gpt/dto/response/GptSchedulesResponse.java | 3 ++- .../java/com/isp/backend/domain/gpt/service/GptService.java | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/backend/src/main/java/com/isp/backend/domain/gpt/dto/response/GptSchedulesResponse.java b/backend/src/main/java/com/isp/backend/domain/gpt/dto/response/GptSchedulesResponse.java index 52dadab1..0f6105b1 100644 --- a/backend/src/main/java/com/isp/backend/domain/gpt/dto/response/GptSchedulesResponse.java +++ b/backend/src/main/java/com/isp/backend/domain/gpt/dto/response/GptSchedulesResponse.java @@ -11,5 +11,6 @@ @AllArgsConstructor public class GptSchedulesResponse { private String countryImage; + private String currencyUnit; private List schedules; -} +} \ No newline at end of file diff --git a/backend/src/main/java/com/isp/backend/domain/gpt/service/GptService.java b/backend/src/main/java/com/isp/backend/domain/gpt/service/GptService.java index 21e4abde..8305168c 100644 --- a/backend/src/main/java/com/isp/backend/domain/gpt/service/GptService.java +++ b/backend/src/main/java/com/isp/backend/domain/gpt/service/GptService.java @@ -73,10 +73,12 @@ public CompletableFuture askQuestion(GptScheduleRequest qu sendRequestAsync(messages, executorService) ); + + CompletableFuture> combinedFuture = CompletableFuture.allOf(futures.toArray(new CompletableFuture[0])) .thenApply(v -> futures.stream().map(CompletableFuture::join).collect(Collectors.toList())); - return combinedFuture.thenApply(schedules -> new GptSchedulesResponse(countryImage, schedules)); + return combinedFuture.thenApply(schedules -> new GptSchedulesResponse(countryImage, country.getCurrencyName(), schedules)); } private CompletableFuture sendRequestAsync(List messages, ExecutorService executor) {