feat: 일기예보 출처 추가#149
Merged
Merged
Conversation
External API에 예보시각 출력 public Function 구현 API 응답 포맷에 출처, API 제공자, 예보시각 추가 Service에서 일기예보 함수 사용 시, 예보 리스트와 함께 예보시각 추가
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 주요 변경 내용 (Description)
API Server
externals/datago.pyIKmaShortForecastAPI,IKmaMidLandForecastAPI,IKmaMidLandTemperatureAPI세 인터페이스에get_published_at() -> datetime추상 메서드 추가
KmaMidForecastBase.get_published_at()구현 → 두 중기예보 구현체(KmaMidLandForecastAPI,KmaMidLandTemperatureAPI)가상속으로 자동 만족
KmaShortForecastAPI.get_published_at()구현_convert_time_to_forecast_time()시간 계산 로직을 그대로 재사용해 중복 없음services/weather_services.pyget_forecasts()반환 타입 변경List[WeatherForecastItemSchema]Tuple[datetime, List[WeatherForecastItemSchema]]_resolve_published_at()로 분리days < 5: 중기예보를 사용하지 않으므로 단기예보 발표 시각을 그대로 사용 (max미적용)days >= 5: 단기/중기 발표 시각 중 가장 최근(max) 시각 사용weather:course:{course_id}:{days}weather:course:{course_id}:{days}:{YYYYMMDDHHMM}get_published_at()은 네트워크 호출 없는 시간 계산이라 캐시 lookup 전 호출에도 추가 비용 없음routers/v1/course.pypublished_at, forecasts로 언팩하고 응답 스키마에publishedAt전달설계 메모
_convert_time_to_forecast_time()로직을 그대로 활용해 시간 계산 로직 중복 없음Frontend
Summary
source,provider,publishedAt필드를 웹 UI에 반영Changes
src/types/responses/weather-forecast.ts:WeatherForecastResponse타입에source,provider,publishedAt필드 추가src/components/client/WeatherForecast.tsx:forecasts: Forecast[]에서 전체 응답 객체(WeatherForecastResponse | null)로 변경하여 메타데이터까지 함께 보존formatPublishedAt헬퍼 추가 — ISO 문자열을YYYY.MM.DD HH:MM형식으로 변환text-xs text-base-content/40로 가독성을 해치지 않는 보조 정보 처리)UI
🔗 관련 이슈 (Related Issues)