-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* fix: id를 포함한 객체를 HashSet 에 저장하게 수정 * config: RestAssured 의존성 추가 * feat: 파트 등록 API 구현 * fix: 더미 데이터를 이용한 테스트를 위한 테스트 파라미터 변경 * feat: 노래 정보 조회 API 구현 * fix: Set 자료구조 List 로 변경 정확한 해시값을 위한 선행되야하는 영속화 과정에서 LazyLoading 이 발생시 컬렉션에 직접 넣지 않았음에도 들어가있는 상태를 가지게 되는 문제점 * test: 파트 등록 테스트 추가
- Loading branch information
1 parent
57c61ed
commit f605c32
Showing
19 changed files
with
444 additions
and
63 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
21 changes: 21 additions & 0 deletions
21
backend/src/main/java/shook/shook/part/application/dto/PartRegisterResponse.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,21 @@ | ||
package shook.shook.part.application.dto; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import shook.shook.part.domain.Part; | ||
import shook.shook.song.domain.Song; | ||
|
||
@AllArgsConstructor | ||
@Getter | ||
public class PartRegisterResponse { | ||
|
||
private final int rank; | ||
private final String partUrl; | ||
|
||
public static PartRegisterResponse of(final Song song, final Part part) { | ||
return new PartRegisterResponse( | ||
song.getRank(part), | ||
song.getPartVideoUrl(part) | ||
); | ||
} | ||
} |
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: 31 additions & 0 deletions
31
backend/src/main/java/shook/shook/part/ui/PartController.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,31 @@ | ||
package shook.shook.part.ui; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.http.HttpStatus; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.PathVariable; | ||
import org.springframework.web.bind.annotation.PostMapping; | ||
import org.springframework.web.bind.annotation.RequestBody; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
import shook.shook.part.application.PartService; | ||
import shook.shook.part.application.dto.PartRegisterRequest; | ||
import shook.shook.part.application.dto.PartRegisterResponse; | ||
|
||
@RequiredArgsConstructor | ||
@RequestMapping("/songs/{song_id}/parts") | ||
@RestController | ||
public class PartController { | ||
|
||
private final PartService partService; | ||
|
||
@PostMapping | ||
public ResponseEntity<PartRegisterResponse> registerPart( | ||
@PathVariable(name = "song_id") final Long songId, | ||
@RequestBody final PartRegisterRequest request | ||
) { | ||
final PartRegisterResponse register = partService.register(songId, request); | ||
|
||
return ResponseEntity.status(HttpStatus.CREATED).body(register); | ||
} | ||
} |
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
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
24 changes: 24 additions & 0 deletions
24
backend/src/main/java/shook/shook/song/ui/SongController.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,24 @@ | ||
package shook.shook.song.ui; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.PathVariable; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
import shook.shook.song.application.SongService; | ||
import shook.shook.song.application.dto.SongResponse; | ||
|
||
@RequiredArgsConstructor | ||
@RequestMapping("/songs/{song_id}") | ||
@RestController | ||
public class SongController { | ||
|
||
private final SongService songService; | ||
|
||
@GetMapping | ||
public ResponseEntity<SongResponse> showSongById(@PathVariable(name = "song_id") Long songId) { | ||
final SongResponse response = songService.findById(songId); | ||
return ResponseEntity.ok(response); | ||
} | ||
} |
Oops, something went wrong.