From 8e918be250edff20859c55e3dc5b0fe3d3b1b2bb Mon Sep 17 00:00:00 2001 From: jykim-rust Date: Tue, 2 Apr 2024 14:40:47 +0900 Subject: [PATCH 1/3] =?UTF-8?q?:sparkles:=20=EA=B0=90=EC=A0=95=EC=97=90?= =?UTF-8?q?=EC=84=9C=20excited=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/moment/scheduler/dto/response/EmotionResponseDTO.java | 1 - 1 file changed, 1 deletion(-) diff --git a/backend/moment/moment-server/scheduler/src/main/java/com/moment/scheduler/dto/response/EmotionResponseDTO.java b/backend/moment/moment-server/scheduler/src/main/java/com/moment/scheduler/dto/response/EmotionResponseDTO.java index b5ab1de369..5158ec0ea3 100644 --- a/backend/moment/moment-server/scheduler/src/main/java/com/moment/scheduler/dto/response/EmotionResponseDTO.java +++ b/backend/moment/moment-server/scheduler/src/main/java/com/moment/scheduler/dto/response/EmotionResponseDTO.java @@ -15,7 +15,6 @@ public static class GetEmotionList { private final Float happy; private final Float sad; private final Float angry; - private final Float excited; private final Float neutral; } From 2befe6dac7d37767b967d586a2fd21def43d1648 Mon Sep 17 00:00:00 2001 From: jykim-rust Date: Tue, 2 Apr 2024 14:42:18 +0900 Subject: [PATCH 2/3] =?UTF-8?q?:sparkles:=20file=5Fname=EA=B3=BC=20file=5F?= =?UTF-8?q?path=EB=A1=9C=20=EC=9D=B8=EC=9E=90=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/moment/scheduler/client/AiClient.java | 4 +++- .../scheduler/dto/request/AiModelRunRequestDTO.java | 3 ++- .../java/com/moment/scheduler/service/AiService.java | 9 ++++++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/backend/moment/moment-server/scheduler/src/main/java/com/moment/scheduler/client/AiClient.java b/backend/moment/moment-server/scheduler/src/main/java/com/moment/scheduler/client/AiClient.java index 050607fa6a..bbebe8a431 100644 --- a/backend/moment/moment-server/scheduler/src/main/java/com/moment/scheduler/client/AiClient.java +++ b/backend/moment/moment-server/scheduler/src/main/java/com/moment/scheduler/client/AiClient.java @@ -1,10 +1,12 @@ package com.moment.scheduler.client; +import com.moment.scheduler.dto.request.AiModelRunRequestDTO; import com.moment.scheduler.dto.response.AiModelRunResponseDTO; import com.moment.scheduler.dto.response.EmotionResponseDTO; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestParam; @FeignClient(name = "ai-service") @@ -15,6 +17,6 @@ public interface AiClient { * @Param String fileName */ @PostMapping("/ai/run") - AiModelRunResponseDTO.RunModel runAi(@RequestParam String file_name); + AiModelRunResponseDTO.RunModel runAi(@RequestBody AiModelRunRequestDTO.RunModel request); } diff --git a/backend/moment/moment-server/scheduler/src/main/java/com/moment/scheduler/dto/request/AiModelRunRequestDTO.java b/backend/moment/moment-server/scheduler/src/main/java/com/moment/scheduler/dto/request/AiModelRunRequestDTO.java index 10e4c184f1..7d8ef81153 100644 --- a/backend/moment/moment-server/scheduler/src/main/java/com/moment/scheduler/dto/request/AiModelRunRequestDTO.java +++ b/backend/moment/moment-server/scheduler/src/main/java/com/moment/scheduler/dto/request/AiModelRunRequestDTO.java @@ -12,6 +12,7 @@ public class AiModelRunRequestDTO { @NoArgsConstructor @AllArgsConstructor public static class RunModel { - private String fileName; + private String file_name; + private String file_path; } } diff --git a/backend/moment/moment-server/scheduler/src/main/java/com/moment/scheduler/service/AiService.java b/backend/moment/moment-server/scheduler/src/main/java/com/moment/scheduler/service/AiService.java index 04b1756139..327448d821 100644 --- a/backend/moment/moment-server/scheduler/src/main/java/com/moment/scheduler/service/AiService.java +++ b/backend/moment/moment-server/scheduler/src/main/java/com/moment/scheduler/service/AiService.java @@ -1,6 +1,7 @@ package com.moment.scheduler.service; import com.moment.scheduler.client.AiClient; +import com.moment.scheduler.dto.request.AiModelRunRequestDTO; import com.moment.scheduler.dto.response.AiModelRunResponseDTO; import com.moment.scheduler.dto.response.EmotionResponseDTO; import lombok.AllArgsConstructor; @@ -10,8 +11,14 @@ @AllArgsConstructor public class AiService { private final AiClient aiClient; + private final static String file_path = ""; public AiModelRunResponseDTO.RunModel runAi(String fileName) { - return aiClient.runAi(fileName); + return aiClient.runAi( + AiModelRunRequestDTO.RunModel.builder() + .file_name(fileName) + .file_path(file_path) + .build() + ); } } From ba090c7a799bb34944378ad0cfa0ae725da4b50f Mon Sep 17 00:00:00 2001 From: jykim-rust Date: Tue, 2 Apr 2024 15:36:32 +0900 Subject: [PATCH 3/3] =?UTF-8?q?:sparkles:=20DTO=EC=97=90=EC=84=9C=20log=20?= =?UTF-8?q?=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/moment/scheduler/controller/AiController.java | 2 +- .../moment/scheduler/dto/response/AiModelRunResponseDTO.java | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/backend/moment/moment-server/scheduler/src/main/java/com/moment/scheduler/controller/AiController.java b/backend/moment/moment-server/scheduler/src/main/java/com/moment/scheduler/controller/AiController.java index 79b45619ed..581e36d462 100644 --- a/backend/moment/moment-server/scheduler/src/main/java/com/moment/scheduler/controller/AiController.java +++ b/backend/moment/moment-server/scheduler/src/main/java/com/moment/scheduler/controller/AiController.java @@ -19,6 +19,6 @@ public class AiController { @PostMapping("/run") public AiModelRunResponseDTO.RunModel runAi(@RequestBody AiModelRunRequestDTO.RunModel request) { - return aiService.runAi(request.getFileName()); + return aiService.runAi(request.getFile_name()); } } diff --git a/backend/moment/moment-server/scheduler/src/main/java/com/moment/scheduler/dto/response/AiModelRunResponseDTO.java b/backend/moment/moment-server/scheduler/src/main/java/com/moment/scheduler/dto/response/AiModelRunResponseDTO.java index 16ade408d8..521135406e 100644 --- a/backend/moment/moment-server/scheduler/src/main/java/com/moment/scheduler/dto/response/AiModelRunResponseDTO.java +++ b/backend/moment/moment-server/scheduler/src/main/java/com/moment/scheduler/dto/response/AiModelRunResponseDTO.java @@ -13,7 +13,6 @@ public static class RunModel { private final String status; private final EmotionResponseDTO.GetEmotionList emotions; private final String text; - private final List log; private final String error; } }