-
Notifications
You must be signed in to change notification settings - Fork 2
[FEAT] AI 분석 요청 및 Gemini 리포트 생성 (#22, #74) #84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
518c068
feat: AI 서버 내 API 변경에 따른 Request 수정 및 테스트
ownue 2a9e051
feat: 분석 요청 생성 및 비동기 AI 분석 처리 구현 (#74)
ownue 6e316d6
fix: PENDING 상태의 AI 분석 요청 재처리 및 중복 실행 방지 (#74)
ownue 34bab96
fix: AI 분석 응답 점수 검증 강화 (#74)
ownue e85384c
fix: 중단된 AI 분석 작업 복구 처리 추가 (#74)
ownue 057666f
feat: Gemini 기반 분석 리포트 생성 및 규칙 기반 폴백 구현 (#22, #74)
ownue 7aba6bf
feat: Gemini 리포트 생성 LLM 호출 로그 저장 (#74)
ownue 846b6dd
fix: 분석 결과 사전 검증 및 재처리 안정성 개선 (#74)
ownue 2aaede2
docs: 분석 API Swagger 문서화 추가 (#74)
ownue 99f8ee5
fix: 분석 JSON 필드의 PostgreSQL 타입 매핑 수정 (#74)
ownue 082e895
fix: Gemini 리포트 생성 read timeout 조정 (#74)
ownue 4e9c755
feat: 분석 완료 통계 집계 연동 및 충돌 해결 후 머지 (#74)
ownue d18a22c
merge: 최신 develop 반영 및 통계 충돌 해결 (#74)
ownue 7025b62
fix: 테스트 과정에서 깨진 문자들 리터럴 치환 (#74)
ownue cbc667e
chore: 패키지 분리 (#74)
ownue a8a8c67
fix: Optional.of()에 null이 들어올 수 있는 경로 방어
ownue 477476b
fix: 분석 복구 작업 중복 완료 방지를 위한 펜싱 적용
ownue 98a78ce
fix: Gemini 리포트 Markdown 형식 검증 추가 (#74)
ownue 7f68ffd
fix: 분석 처리 안정성과 소유권 계약 강화 (#74)
ownue 0ede655
feat: 분석 요약과 Gemini 리포트 품질 개선 (#74)
ownue b8a0bef
feat(analysis): 분석 결과 조회 응답을 명세에 동기화 (#74)
ownue 9d1a910
fix: 분석 처리 안정성과 오류 응답을 개선 (#74)
ownue 5d89bd3
Merge branch 'develop' of https://github.com/Musereview/BE into feat/…
ownue 70eb3d9
fix: 유효하지 않은 분석 요청의 무한 재시도 방지 추가 (#74)
ownue 98fd8f4
refactor: 분석 처리 시각 Clock 기반으로 통일 (#74)
ownue 0b8d4a3
fix: 분석 결과 문자열 변환 안정성 개선 (#74)
ownue cb30309
refactor: 분석 처리 안정성 및 시간 관리 개선 (#74)
ownue 82025cf
fix: 완료된 연주의 중복 분석 요청 차단 (#74)
ownue File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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
11 changes: 11 additions & 0 deletions
11
src/main/java/com/mr/domain/analysis/dto/req/AnalysisCreateRequestDTO.java
This file contains hidden or 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,11 @@ | ||
| package com.mr.domain.analysis.dto.req; | ||
|
|
||
| import jakarta.validation.constraints.NotNull; | ||
| import jakarta.validation.constraints.Positive; | ||
|
|
||
| public record AnalysisCreateRequestDTO( | ||
| @NotNull Long playingId, | ||
| @NotNull @Positive Integer startBar, | ||
| @NotNull @Positive Integer endBar | ||
| ) { | ||
| } |
19 changes: 19 additions & 0 deletions
19
src/main/java/com/mr/domain/analysis/dto/res/AnalysisCreateResponseDTO.java
This file contains hidden or 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,19 @@ | ||
| package com.mr.domain.analysis.dto.res; | ||
|
|
||
| import com.mr.domain.analysis.entity.Analysis; | ||
| import com.mr.domain.analysis.entity.enums.AnalysisStatus; | ||
| import java.time.LocalDateTime; | ||
|
|
||
| public record AnalysisCreateResponseDTO( | ||
| Long analysisId, | ||
| Long playingId, | ||
| AnalysisStatus status, | ||
| Integer startBar, | ||
| Integer endBar, | ||
| LocalDateTime createdAt | ||
| ) { | ||
| public static AnalysisCreateResponseDTO from(Analysis analysis) { | ||
| return new AnalysisCreateResponseDTO(analysis.getId(), analysis.getPlaying().getId(), analysis.getStatus(), | ||
| analysis.getStartBar(), analysis.getEndBar(), analysis.getCreatedAt()); | ||
| } | ||
| } |
This file contains hidden or 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 hidden or 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
4 changes: 4 additions & 0 deletions
4
src/main/java/com/mr/domain/analysis/event/AnalysisRequestedEvent.java
This file contains hidden or 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,4 @@ | ||
| package com.mr.domain.analysis.event; | ||
|
|
||
| public record AnalysisRequestedEvent(Long analysisId) { | ||
| } |
36 changes: 36 additions & 0 deletions
36
src/main/java/com/mr/domain/analysis/event/listener/AnalysisRequestedEventListener.java
This file contains hidden or 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,36 @@ | ||
| package com.mr.domain.analysis.event.listener; | ||
|
|
||
| import com.mr.domain.analysis.event.AnalysisRequestedEvent; | ||
| import com.mr.domain.analysis.service.AnalysisProcessingService; | ||
| import lombok.extern.slf4j.Slf4j; | ||
| import org.springframework.beans.factory.annotation.Qualifier; | ||
| import org.springframework.core.task.TaskExecutor; | ||
| import org.springframework.stereotype.Component; | ||
| import org.springframework.transaction.event.TransactionPhase; | ||
| import org.springframework.transaction.event.TransactionalEventListener; | ||
|
|
||
| @Component | ||
| @Slf4j | ||
| public class AnalysisRequestedEventListener { | ||
|
|
||
| private final AnalysisProcessingService analysisProcessingService; | ||
| private final TaskExecutor taskExecutor; | ||
|
|
||
| public AnalysisRequestedEventListener( | ||
| AnalysisProcessingService analysisProcessingService, | ||
| @Qualifier("applicationTaskExecutor") TaskExecutor taskExecutor | ||
| ) { | ||
| this.analysisProcessingService = analysisProcessingService; | ||
| this.taskExecutor = taskExecutor; | ||
| } | ||
|
|
||
| @TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT) | ||
| public void handle(AnalysisRequestedEvent event) { | ||
| try { | ||
| taskExecutor.execute(() -> analysisProcessingService.process(event.analysisId())); | ||
| } catch (RuntimeException exception) { | ||
| log.warn("AI analysis submission failed; it will be retried by recovery. analysisId={}", | ||
| event.analysisId(), exception); | ||
| } | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.