From 3080d1df43217a55643bde34b0a73014283d63b0 Mon Sep 17 00:00:00 2001 From: YugyeomGhim Date: Tue, 5 Nov 2024 20:14:08 +0900 Subject: [PATCH] =?UTF-8?q?Fix:=20AI=EC=84=9C=EB=B2=84=20api=20=EB=AA=85?= =?UTF-8?q?=EC=84=B8=EC=97=90=20=EB=A7=9E=EA=B2=8C=20request=20dto=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../request/SttCallbackRequest.java | 31 +++++++------------ 1 file changed, 11 insertions(+), 20 deletions(-) diff --git a/src/main/java/notai/stt/presentation/request/SttCallbackRequest.java b/src/main/java/notai/stt/presentation/request/SttCallbackRequest.java index 1e58bc7..0633ee3 100644 --- a/src/main/java/notai/stt/presentation/request/SttCallbackRequest.java +++ b/src/main/java/notai/stt/presentation/request/SttCallbackRequest.java @@ -1,38 +1,29 @@ package notai.stt.presentation.request; import notai.stt.application.command.UpdateSttResultCommand; -import notai.stt.application.command.UpdateSttResultCommand.Word; import java.util.List; import java.util.UUID; public record SttCallbackRequest( String taskId, - String state, - SttResult result + String text, + List words ) { public UpdateSttResultCommand toCommand() { - List words = result.words().stream() - .map(word -> new Word( + List commandWords = words().stream() + .map(word -> new UpdateSttResultCommand.Word( word.word(), word.start(), - word.end() - )) + word.end())) .toList(); - return new UpdateSttResultCommand(UUID.fromString(taskId), words); + return new UpdateSttResultCommand(UUID.fromString(taskId), commandWords); } - - public record SttResult( - double audioLength, - String language, - double languageProbability, - String text, - List words + + public record Word( + String word, + double start, + double end ) { - public record Word( - double start, - double end, - String word - ) {} } }