Skip to content

Commit

Permalink
Merge pull request #26 from Nexters/feature/25-change-resort-sorting
Browse files Browse the repository at this point in the history
[#25] 스키장 전체 조회 시 개장일 빠른 순서로 정렬 기준 변경
  • Loading branch information
jun108059 authored Nov 18, 2024
2 parents 01d51b1 + 9f3c116 commit 45da12b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ package nexters.weski.ski_resort

import org.springframework.data.jpa.repository.JpaRepository

interface SkiResortRepository : JpaRepository<SkiResort, Long>
interface SkiResortRepository : JpaRepository<SkiResort, Long> {
fun findAllByOrderByOpeningDateAsc(): List<SkiResort>
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class SkiResortService(
private val dailyWeatherRepository: DailyWeatherRepository
) {
fun getAllSkiResortsAndWeather(): List<SkiResortResponseDto> {
val skiResorts = skiResortRepository.findAll()
val skiResorts = skiResortRepository.findAllByOrderByOpeningDateAsc()
return skiResorts.map { skiResort ->
val currentWeather = currentWeatherRepository.findBySkiResortResortId(skiResort.resortId)
val weeklyWeather = dailyWeatherRepository.findAllBySkiResortResortId(skiResort.resortId)
Expand Down

0 comments on commit 45da12b

Please sign in to comment.