-
Notifications
You must be signed in to change notification settings - Fork 2
[FEAT] 백킹트랙 기반 연주 세션 시작 API 구현 #85
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
10 commits
Select commit
Hold shift + click to select a range
59af61e
feat: 연주 시작 요청/응답 DTO 추가 (#73)
on1yoneprivate 56795b5
feat: 백킹트랙 기반 연주 시작 API 구현 (#73)
on1yoneprivate 98234e9
test: 연주 시작 기능 테스트 추가 (#73)
on1yoneprivate 24d5fec
fix: MIDI 이벤트 목록의 null 요소 검증 추가 (#73)
on1yoneprivate 0b41811
test: 백킹트랙 ID null 검증 테스트의 DTO 파라미터 전달 방식 수정 (#73)
on1yoneprivate aea9c86
refactor: 하드코딩된 사용자 ID를 상수로 변경 (#73)
on1yoneprivate 4f54f46
fix: 연주 시작 시 소프트 삭제된 백킹트랙 조회 제외 (#73)
on1yoneprivate 8775720
docs: ACADEMY 접근 정책 TODO 주석 추가 (#73)
on1yoneprivate f1dc6d4
fix: 사용자 단위 MIDI 저장 요청 제한 제거 (#73)
on1yoneprivate 7ac572c
Merge branch 'develop' into feat/#73-start-playing-session
on1yoneprivate 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
12 changes: 12 additions & 0 deletions
12
src/main/java/com/mr/domain/playing/dto/req/PlayingStartRequest.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,12 @@ | ||
| package com.mr.domain.playing.dto.req; | ||
|
|
||
| import jakarta.validation.constraints.Min; | ||
| import jakarta.validation.constraints.NotNull; | ||
|
|
||
| public record PlayingStartRequest( | ||
|
|
||
| @NotNull(message = "백킹트랙 ID는 필수입니다.") | ||
| @Min(value = 1, message = "백킹트랙 ID는 1 이상이어야 합니다.") | ||
| Long backingTrackId | ||
| ) { | ||
| } |
74 changes: 74 additions & 0 deletions
74
src/main/java/com/mr/domain/playing/dto/res/PlayingStartResponse.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,74 @@ | ||
| package com.mr.domain.playing.dto.res; | ||
|
|
||
| import com.mr.domain.backingTrack.entity.BackingTrack; | ||
| import com.mr.domain.backingTrack.entity.ChordProgression; | ||
| import com.mr.domain.backingTrack.entity.enums.ScaleType; | ||
| import com.mr.domain.playing.entity.Playing; | ||
| import com.mr.domain.playing.entity.enums.PlayingStatus; | ||
|
|
||
| import java.time.LocalDateTime; | ||
| import java.util.List; | ||
|
|
||
| public record PlayingStartResponse( | ||
| Long playingId, | ||
| PlayingStatus status, | ||
| BackingTrackResponse backingTrack, | ||
| LocalDateTime startedAt | ||
| ) { | ||
|
|
||
| public static PlayingStartResponse from (Playing playing) { | ||
| return new PlayingStartResponse( | ||
| playing.getId(), | ||
| playing.getStatus(), | ||
| BackingTrackResponse.from(playing.getBackingTrack()), | ||
| playing.getStartedAt() | ||
| ); | ||
| } | ||
|
|
||
| public record BackingTrackResponse( | ||
| Long backingTrackId, | ||
| String title, | ||
| String audioFileUrl, | ||
| String genre, | ||
| String keySignature, | ||
| ScaleType scaleType, | ||
| Integer bpm, | ||
| String timeSignature, | ||
| Integer playtimeSec, | ||
| List<ChordProgressionResponse> chordProgression | ||
|
|
||
| ) { | ||
| public static BackingTrackResponse from(BackingTrack backingTrack) { | ||
| return new BackingTrackResponse( | ||
| backingTrack.getId(), | ||
| backingTrack.getTitle(), | ||
| backingTrack.getAudioFileUrl(), | ||
| backingTrack.getGenre(), | ||
| backingTrack.getKeySignature(), | ||
| backingTrack.getScaleType(), | ||
| backingTrack.getBpm(), | ||
| backingTrack.getTimeSignature(), | ||
| backingTrack.getPlaytimeSec(), | ||
| backingTrack.getChordProgressions() | ||
| .stream() | ||
| .map(ChordProgressionResponse::from) | ||
| .toList() | ||
| ); | ||
| } | ||
| } | ||
|
|
||
| public record ChordProgressionResponse( | ||
| Integer measureNo, | ||
| Integer sequenceNo, | ||
| String chordName | ||
| ) { | ||
| public static ChordProgressionResponse from(ChordProgression chordProgression) { | ||
|
|
||
| return new ChordProgressionResponse( | ||
| chordProgression.getMeasureNo(), | ||
| chordProgression.getSequenceNo(), | ||
| chordProgression.getChordName() | ||
| ); | ||
| } | ||
| } | ||
| } |
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
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
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.