Skip to content

Commit a1644dc

Browse files
authored
Merge pull request #36 from Nexters/hotfix/35-forecast-api-update
[#35] 기상청 중기예보 API 응답 변경 대응
2 parents 350cd02 + d6b7f78 commit a1644dc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/main/kotlin/nexters/weski/batch/ExternalWeatherService.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ class ExternalWeatherService(
180180

181181
val tmFc = baseDate.format(DateTimeFormatter.ofPattern("yyyyMMdd")) + baseTime
182182
// 기존 데이터 삭제
183-
dailyWeatherRepository.deleteByDDayGreaterThanEqual(2)
183+
dailyWeatherRepository.deleteByDDayGreaterThanEqual(4)
184184
skiResortRepository.findAll().forEach { resort ->
185185
val detailedAreaCode = resort.detailedAreaCode
186186
val broadAreaCode = resort.broadAreaCode
@@ -252,7 +252,7 @@ class ExternalWeatherService(
252252
return weatherList
253253
}
254254

255-
for (i in 3..10) {
255+
for (i in 5..10) {
256256
val forecastDate = now.plusDays(i.toLong() - 1)
257257
val dayOfWeek = forecastDate.dayOfWeek.name // 영어 요일명
258258

@@ -280,7 +280,7 @@ class ExternalWeatherService(
280280

281281
private fun getPrecipitationChance(midLandData: JsonNode, day: Int): Int {
282282
return when (day) {
283-
in 3..7 -> {
283+
in 5..7 -> {
284284
val amChance = midLandData.get("rnSt${day}Am")?.asInt() ?: 0
285285
val pmChance = midLandData.get("rnSt${day}Pm")?.asInt() ?: 0
286286
maxOf(amChance, pmChance)
@@ -296,7 +296,7 @@ class ExternalWeatherService(
296296

297297
private fun getCondition(midLandData: JsonNode, day: Int): String {
298298
return when (day) {
299-
in 3..7 -> {
299+
in 5..7 -> {
300300
val amCondition = midLandData.get("wf${day}Am")?.asText() ?: ""
301301
val pmCondition = midLandData.get("wf${day}Pm")?.asText() ?: ""
302302
selectWorseCondition(amCondition, pmCondition)

0 commit comments

Comments
 (0)