-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from Nexters/feature/18-hourly-weather-update
[#18] 시간대별 날씨 업데이트 batch
- Loading branch information
Showing
9 changed files
with
253 additions
and
52 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
9 changes: 2 additions & 7 deletions
9
src/main/kotlin/nexters/weski/weather/DailyWeatherRepository.kt
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 |
---|---|---|
@@ -1,15 +1,10 @@ | ||
package nexters.weski.weather | ||
|
||
import nexters.weski.ski_resort.SkiResort | ||
import org.springframework.data.jpa.repository.JpaRepository | ||
import org.springframework.data.jpa.repository.Modifying | ||
import org.springframework.data.jpa.repository.Query | ||
|
||
interface DailyWeatherRepository : JpaRepository<DailyWeather, Long> { | ||
fun findAllBySkiResortResortId(resortId: Long): List<DailyWeather> | ||
fun deleteByDDayGreaterThanEqual(dDay: Int) | ||
fun deleteByDDay(dDay: Int) | ||
|
||
@Modifying | ||
@Query("UPDATE DailyWeather dw SET dw.dDay = dw.dDay - 1 WHERE dw.dDay > 0") | ||
fun decrementDDayValues() | ||
fun findBySkiResortAndDDay(skiResort: SkiResort, dDay: Int): DailyWeather? | ||
} |
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
8 changes: 2 additions & 6 deletions
8
src/main/kotlin/nexters/weski/weather/HourlyWeatherRepository.kt
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 |
---|---|---|
@@ -1,12 +1,8 @@ | ||
package nexters.weski.weather | ||
|
||
import nexters.weski.ski_resort.SkiResort | ||
import org.springframework.data.jpa.repository.JpaRepository | ||
import java.time.LocalDateTime | ||
|
||
interface HourlyWeatherRepository : JpaRepository<HourlyWeather, Long> { | ||
fun findAllBySkiResortResortIdAndForecastTimeBetween( | ||
resortId: Long, | ||
startTime: LocalDateTime, | ||
endTime: LocalDateTime | ||
): List<HourlyWeather> | ||
fun deleteBySkiResort(skiResort: SkiResort) | ||
} |
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
Oops, something went wrong.