Skip to content

Commit

Permalink
fix: 응원자 List 조회 API 정렬 순서 역순
Browse files Browse the repository at this point in the history
  • Loading branch information
egg528 committed Feb 13, 2024
1 parent 20de1d0 commit 3d72fb4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,15 @@ class CheeringService(
return if (contentSize < pageSize) {
true
} else {
!cheererRepository.existsByLifeMapIdAndCheeringAtGreaterThanOrderByCheeringAt(lifeMapId, cheeringSquad.last().cheeringAt)
!cheererRepository.existsByLifeMapIdAndCheeringAtGreaterThanOrderByCheeringAtDesc(lifeMapId, cheeringSquad.last().cheeringAt)
}
}

private fun findCheeringSquadPage(lifeMapId: Long, cheeringAt: LocalDateTime?, pageable: Pageable): List<Cheerer> {
return if (cheeringAt == null) {
cheererRepository.findByLifeMapIdOrderByCheeringAt(lifeMapId, pageable)
} else {
cheererRepository.findByLifeMapIdAndCheeringAtGreaterThanOrderByCheeringAt(lifeMapId, cheeringAt, pageable)
cheererRepository.findByLifeMapIdAndCheeringAtGreaterThanOrderByCheeringAtDesc(lifeMapId, cheeringAt, pageable)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import java.time.LocalDateTime

interface CheererRepository : JpaRepository<Cheerer, Long> {

fun findByLifeMapIdAndCheeringAtGreaterThanOrderByCheeringAt(lifeMapId: Long, cheeringAt: LocalDateTime, pageable: Pageable): List<Cheerer>
fun findByLifeMapIdAndCheeringAtGreaterThanOrderByCheeringAtDesc(lifeMapId: Long, cheeringAt: LocalDateTime, pageable: Pageable): List<Cheerer>

fun findByLifeMapIdOrderByCheeringAt(lifeMapId: Long, pageable: Pageable): List<Cheerer>

fun existsByLifeMapIdAndCheeringAtGreaterThanOrderByCheeringAt(lifeMapId: Long, cheeringAt: LocalDateTime): Boolean
fun existsByLifeMapIdAndCheeringAtGreaterThanOrderByCheeringAtDesc(lifeMapId: Long, cheeringAt: LocalDateTime): Boolean
}

0 comments on commit 3d72fb4

Please sign in to comment.