Skip to content

Commit

Permalink
Merge pull request #434 from Team-Ampersand/433-feat/music-desc
Browse files Browse the repository at this point in the history
update :: find music rank desc
  • Loading branch information
esperar authored Sep 20, 2024
2 parents 4c2220f + 4884233 commit 009a0f7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ interface MusicRepository : JpaRepository<Music, Long> {

fun deleteAllByCreatedDateBefore(date: LocalDateTime)

@Query(value = "select * from music where created_date like :date% order by music.like_count", nativeQuery = true)
fun findAllByCreatedDateOrderByLikeCount(@Param("date") date: LocalDate): List<Music>
@Query(value = "select * from music where created_date like :date% order by music.like_count desc", nativeQuery = true)
fun findAllByCreatedDateOrderByLikeCountDESC(@Param("date") date: LocalDate): List<Music>

}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class FindMusicRankServiceImpl(
) : FindMusicRankService {

override fun execute(date: LocalDate): MusicRankListResDto {
val responses = musicRepository.findAllByCreatedDateOrderByLikeCount(date)
val responses = musicRepository.findAllByCreatedDateOrderByLikeCountDESC(date)
.mapIndexed { index, music ->
MusicRankResDto(
id = music.id,
Expand Down

0 comments on commit 009a0f7

Please sign in to comment.