Repository navigation
[Feat] 음악 버전 목록 조회·되돌리기 API 추가 (#26) - #40
Merged
Merged
Conversation
- root_generation_id로 같은 곡의 버전을 묶고, deleted_at으로 되돌린 버전을 soft delete
- GET /{root_generation_id}/versions, POST /{generation_id}/revert 추가
- /me/songs와 수정 요청에서 삭제된 버전 제외
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 of 9 tasks
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
개요
같은 곡의 버전을
root_generation_id로 묶고, 버전 목록 조회와 특정 버전으로 되돌리기 API를 추가합니다. 되돌린 이후 버전은deleted_at으로 soft delete 합니다.Closes #26, Closes #39
Important
기존 곡은
root_generation_id가 NULL이라 백필하지 않으면 버전 목록이 404, 되돌리기가 빈 동작이 되고, 그 곡을 수정한 수정본도 NULL root를 이어받아 버전 기능 밖으로 빠집니다.1. 먼저 수정본이 없는지 확인 (결과가
0이어야 아래 UPDATE가 맞습니다.0이 아니면 실행하지 말고 별도 백필 쿼리를 작성해야 함)2. 백필 실행 (기존 원본 곡이 자기 자신을 root로 갖게 함)
ddl-auto: update가root_generation_id·deleted_at컬럼을 만든 다음parent_generation_id는 건드리지 않습니다 (NULL = 최초 생성곡이라는 전제를 코드가 사용)변경 사항
music_generation)root_generation_id: 최초 생성곡은 자기 자신의 ID, 수정본은 부모의 root를 물려받음 (FK 없이 인덱스만)deleted_at: 되돌리기로 무효화된 시각 (soft delete)GET /api/v1/generation/songs/{root_generation_id}/versionsCOMPLETED+ 미삭제 버전을 생성 순서로 반환,version_no는 컬럼 없이 조회 순서로 계산 (번호가 비지 않음)POST /api/v1/generation/songs/{generation_id}/revertPROCESSING) 작업이 있으면 409GENERATION4001/api/v1/me/songs에서 삭제된 버전 제외SecurityConfig), Swagger 문서,infra/db/ERD.md갱신duration_seconds도Double이슈 본문과 다른 점
prompt/start_time_sec/end_time_sec없음 (prompt는 #25에서 생겼으나 이 PR 범위 밖, 구간 컬럼은 #27에서 생김)프론트 영향
/me/songs·SSEcomplete응답에root_generation_id가 없음. 최초 생성 응답의 곡 ID를 root로 기억해야 함GENERATION4001범위 외
root_generation_id노출 (필요하면 별도 이슈)prompt추가테스트
./gradlew build통과 (MockMvc + H2, 신규 14개 포함 44개)/me/songs에서 삭제 버전 제외, 삭제 버전 수정 요청 404bootRun에서 컬럼 추가·백필 SQL 실행은 확인하지 못했습니다 (테스트는 H2)🤖 Generated with Claude Code