Skip to content

Commit

Permalink
Chore: STT 로깅 설정
Browse files Browse the repository at this point in the history
  • Loading branch information
yugyeom-ghim committed Nov 6, 2024
1 parent 16422aa commit 3e0b2e7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/java/notai/stt/application/SttService.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package notai.stt.application;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import notai.pageRecording.domain.PageRecording;
import notai.pageRecording.domain.PageRecordingRepository;
import notai.recording.domain.Recording;
Expand All @@ -15,6 +16,7 @@

import java.util.List;

@Slf4j
@Service
@Transactional
@RequiredArgsConstructor
Expand All @@ -33,7 +35,10 @@ public void updateSttResult(UpdateSttResultCommand command) {
SttTask sttTask = sttTaskRepository.getById(command.taskId());
Stt stt = sttTask.getStt();
Recording recording = stt.getRecording();

log.info("STT result update for recording: {}", recording.getId());
List<PageRecording> pageRecordings = pageRecordingRepository.findAllByRecordingIdOrderByStartTime(recording.getId());
log.info("Page recordings: {}", pageRecordings);

SttPageMatchedDto matchedResult = stt.matchWordsWithPages(command.words(), pageRecordings);
List<Stt> pageMatchedSttResults = Stt.createFromMatchedResult(recording, matchedResult);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package notai.stt.presentation;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import notai.stt.application.SttService;
import notai.stt.presentation.request.SttCallbackRequest;
import org.springframework.http.ResponseEntity;
Expand All @@ -10,12 +11,14 @@

@RestController
@RequiredArgsConstructor
@Slf4j
public class SttCallbackController {

private final SttService sttService;

@PostMapping("/api/ai/stt/callback")
public ResponseEntity<Void> sttCallback(@RequestBody SttCallbackRequest request) {
log.info("STT callback request: {}", request);
sttService.updateSttResult(request.toCommand());
return ResponseEntity.ok().build();
}
Expand Down

0 comments on commit 3e0b2e7

Please sign in to comment.