Skip to content

Commit

Permalink
Deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
seheonnn authored Jul 5, 2024
2 parents c35427f + 4c60250 commit a9e414f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ public enum WeatherErrorCode implements BaseErrorCode {
WEATHER_OPENAPI_ERROR(HttpStatus.BAD_REQUEST, "WEAT400_3", "OpenApi 관련 오류입니다."),
WEATHER_MAIN_ERROR(HttpStatus.BAD_REQUEST, "WEAT400_2", "잘못된 위도, 경도입니다."), // 레디스에 캐싱 데이터가 없는 경우
WEATHER_URI_ERROR(HttpStatus.BAD_REQUEST, "WEAT400_3", "URI 변환에 실패하였습니다."),
REGION_NOT_FOUND(HttpStatus.NOT_FOUND, "WEAT400_4", "URI 변환에 실패하였습니다."),
DAILY_NOT_FOUND(HttpStatus.NOT_FOUND, "WEAT400_5", "URI 변환에 실패하였습니다."),
EXPECTED_NOT_FOUND(HttpStatus.NOT_FOUND, "WEAT400_6", "URI 변환에 실패하였습니다."),
REGION_NOT_FOUND(HttpStatus.NOT_FOUND, "WEAT400_4", "지역명을 찾을 수 없습니다."),
DAILY_NOT_FOUND(HttpStatus.NOT_FOUND, "WEAT400_5", "하루 날씨 정보를 찾을 수 없습니다."),
EXPECTED_NOT_FOUND(HttpStatus.NOT_FOUND, "WEAT400_6", "예상 날씨 정보를 찾을 수 없습니다."),
;

private final HttpStatus httpStatus;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,12 @@ public MainWeatherResponse getMainWeather(double latitude, double longitude) {

String expectedWeatherKey = regionName + "_" + convertLocalDateTimeToString(now);

String dailyWeatherKey = regionName + "_" + convertLocalDateTimeToDailyWeatherTime(now);
LocalDateTime dailyWeatherBaseTime = convertLocalDateTimeToDailyWeatherTime(now);

String dailyWeatherKey = regionName + "_" + convertLocalDateTimeToString(dailyWeatherBaseTime);

log.info("[Main - api] dailyWeatherKey : {}", dailyWeatherKey);
log.info("[Main - api] expectedWeatherKey : {}", expectedWeatherKey);

DailyWeather dailyWeather = dailyWeatherRepository.findById(dailyWeatherKey)
.orElseThrow(() -> new WeatherExceptionHandler(WeatherErrorCode.DAILY_NOT_FOUND));
Expand Down

0 comments on commit a9e414f

Please sign in to comment.