File tree Expand file tree Collapse file tree 3 files changed +11
-0
lines changed
src/main/kotlin/com/open3r/openmusic/domain/song Expand file tree Collapse file tree 3 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,11 @@ class SongController(
32
32
fun getRankingSongs (@PageableDefault pageable : Pageable ) =
33
33
BaseResponse (songService.getRankingSongs(pageable), 200 ).toEntity()
34
34
35
+ @Operation(summary = " 음악 목록 조회 (최신)" )
36
+ @GetMapping(" /latest" )
37
+ fun getLatestSongs (@PageableDefault pageable : Pageable ) =
38
+ BaseResponse (songService.getLatestSongs(pageable), 200 ).toEntity()
39
+
35
40
@Operation(summary = " 음악 조회" )
36
41
@GetMapping(" /{songId}" )
37
42
fun getSong (@PathVariable songId : Long ) = BaseResponse (songService.getSong(songId), 200 ).toEntity()
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ interface SongService {
12
12
fun getSongs (pageable : Pageable ): Page <SongResponse >
13
13
fun getRankingSongs (pageable : Pageable ): Slice <SongResponse >
14
14
fun getGenreSongs (genre : SongGenre , pageable : Pageable ): Page <SongResponse >
15
+ fun getLatestSongs (pageable : Pageable ): Slice <SongResponse >
15
16
fun getMySongs (): List <SongResponse >
16
17
fun getSong (songId : Long ): SongResponse
17
18
fun playSong (songId : Long ): SongResponse
Original file line number Diff line number Diff line change @@ -46,6 +46,11 @@ class SongServiceImpl(
46
46
return songQueryRepository.getGenreSongs(genre, pageable).map { it.toResponse() }
47
47
}
48
48
49
+ @Transactional(readOnly = true )
50
+ override fun getLatestSongs (pageable : Pageable ): Slice <SongResponse > {
51
+ return songQueryRepository.getLatestSongs(pageable).map { it.toResponse() }
52
+ }
53
+
49
54
@Transactional(readOnly = true )
50
55
override fun getMySongs (): List <SongResponse > {
51
56
val user = userSecurity.user
You can’t perform that action at this time.
0 commit comments