Repository navigation
[Feat] 음악 생성 API 프롬프트 추가 및 곡 길이 지정 (#25) - #37
Merged
Merged
Conversation
- 생성 요청에 선택 필드 prompt(최대 500자) 추가, music_generation.prompt 컬럼 저장 - AI 요청에 prompt, duration_seconds(설정값 generation.duration-seconds, 기본 30) 전송 - AI 완료 콜백에 duration_seconds 추가: 요청 길이와 ±0.1초 초과 차이면 FAILED, 없으면(구 AI 서버) 검증을 건너뛰고 요청한 길이 유지. 길이 비교는 최초 생성만 수행 - music_generation.duration_seconds를 Integer -> Double로 변경, 응답의 duration_seconds는 소수 - 30초 초과 허밍 거부(HUMMING4001, 400): 허밍 저장 API와 생성 요청의 멜로디 끝 시점 검증 - 결과 오디오 업로드용 presigned PUT URL 유효시간 10분 -> 30분 - Swagger, ERD 갱신 및 테스트 추가 Closes #25 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.
개요
음악 생성 시 사용자 프롬프트(선택)를 받고, 곡 길이를 백엔드 설정값으로 지정해 AI 서버에 항상 전달하며, AI가 보고한 길이를 검증합니다. 생성 길이 상한이 30초이므로 30초를 넘는 허밍은 오류로 거부합니다.
Closes #25
변경 사항
POST /api/v1/generation/songs에 선택 필드prompt(최대 500자) 추가,music_generation.prompt컬럼에 저장. 비어 있거나 공백이면null로 저장하고 AI 요청에서 생략. 수정곡은 원본의prompt를 이어받음generation.duration-seconds(기본 30) 도입, 하드코딩updateDuration(30)제거. AI 요청에duration_seconds를 항상 전송AiTaskCompletionRequest.duration_seconds(nullableDouble) 추가FAILED(정확히 0.1초 차이는 허용, 부동소수점 오차 보정 포함)duration_seconds타입:MusicGeneration.durationSecondsInteger→Double, AI가 보고한 실제 길이를 저장HUMMING4001, 400, "허밍은 최대 30초까지 가능합니다."): 허밍 저장 API(duration_seconds > 30)와 생성 요청(멜로디 마지막 음 끝 시점 > 30.1초, 0.1초 양자화 여유). 생성 요청 검증은 AI 호출 전에 수행infra/db/ERD.md갱신프론트 영향
HUMMING4001로 거부promptCOMMON400,result.prompt에 메시지)duration_secondscomplete의result.duration_seconds,/api/v1/me/songs의contents[].duration_seconds가 정수 → 소수 (예:29.95). JSON number라 JS/TS는 영향 없음HUMMING4001FAILED로 전달배포 시 주의
duration_seconds가 없어도 동작합니다. AI 서버의 30초 하드코딩이 제거되므로 AI 서버를 먼저 배포하면 길이를 안 보내는 구 백엔드의 생성이 실패합니다.ALTER TABLE music_generation MODIFY duration_seconds DOUBLE;ddl-auto: update는 기존 컬럼 타입을 바꾸지 않아, 실행하지 않으면 실제 길이 소수점이 INT로 반올림 저장됩니다.prompt컬럼은 자동으로 추가됩니다.범위 외
/modifications)의prompt길이 제한, 소유자 검증modify요청 규격테스트
./gradlew build통과 (MockMvc + H2, 신규 14개 포함 31개)prompt,duration_seconds포함·생략), 공백 promptduration_seconds누락·실패 통보·수정곡,/me/songs소수 응답bootRun에서 컬럼 추가·소수 저장 확인은 하지 못했습니다 (테스트는 H2)🤖 Generated with Claude Code