forked from kakao-tech-campus-2nd-step3/Team29_BE
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor: STT 도메인 연관관계 재구성 및 STT 페이지별 상태체크 기능 구현 (#38)
* Refactor: STT 도메인 연관관계 재구성 - Stt와 Recording 간의 직접 연관관계를 제거 - SttTask를 중심으로 하는 새로운 구조로 변경 - Recording <- SttTask -> Stt - 관련 DB 스키마 변경 - stt 테이블: recording_id 제거, stt_task_id 추가 - stt_task 테이블: stt_id 제거, recording_id 추가 * Feat: Stt 페이지별 상태체크 기능 구현 * Test: STT 도메인 구조 변경에 따른 테스트 수정
- Loading branch information
1 parent
15577cf
commit eac0b88
Showing
19 changed files
with
231 additions
and
142 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 16 additions & 15 deletions
31
src/main/java/notai/stt/presentation/response/SttPageResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,31 @@ | ||
package notai.stt.presentation.response; | ||
|
||
import notai.stt.domain.Stt; | ||
|
||
import java.util.List; | ||
|
||
public record SttPageResponse( | ||
Integer pageNumber, | ||
List<SttContent> contents | ||
Integer pageNumber, | ||
List<SttContent> contents | ||
) { | ||
public static SttPageResponse of(Integer pageNumber, List<Stt> sttList) { | ||
List<SttContent> contents = sttList.stream() | ||
.map(SttContent::from) | ||
.toList(); | ||
return new SttPageResponse(pageNumber, contents); | ||
} | ||
|
||
public record SttContent( | ||
String content, | ||
Integer startTime, | ||
Integer endTime | ||
String content, | ||
Integer startTime, | ||
Integer endTime | ||
) { | ||
public static SttContent from(Stt stt) { | ||
return new SttContent( | ||
stt.getContent(), | ||
stt.getStartTime(), | ||
stt.getEndTime() | ||
stt.getContent(), | ||
stt.getStartTime(), | ||
stt.getEndTime() | ||
); | ||
} | ||
} | ||
|
||
public static SttPageResponse of(Integer pageNumber, List<Stt> sttList) { | ||
List<SttContent> contents = sttList.stream() | ||
.map(SttContent::from) | ||
.toList(); | ||
return new SttPageResponse(pageNumber, contents); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
src/main/java/notai/sttTask/application/command/SttTaskPageStatusCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package notai.sttTask.application.command; | ||
|
||
public record SttTaskPageStatusCommand( | ||
Long documentId, | ||
Integer pageNumber | ||
) { | ||
public static SttTaskPageStatusCommand of(Long documentId, Integer pageNumber) { | ||
return new SttTaskPageStatusCommand(documentId, pageNumber); | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
src/main/java/notai/sttTask/application/result/SttTaskPageStatusResult.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package notai.sttTask.application.result; | ||
|
||
import notai.llm.domain.TaskStatus; | ||
|
||
public record SttTaskPageStatusResult( | ||
Integer pageNumber, | ||
TaskStatus status | ||
) { | ||
public static SttTaskPageStatusResult of(Integer pageNumber, TaskStatus status) { | ||
return new SttTaskPageStatusResult(pageNumber, status); | ||
} | ||
} |
Oops, something went wrong.