Skip to content

Commit fa43335

Browse files
committed
refactor: 로그 추가
1 parent 547d336 commit fa43335

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/main/java/com/howWeather/howWeather_backend/domain/ai_model/service/RecommendationService.java

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,10 @@ private RecommendPredictDto makeResultForPredict(Closet closet, ClothingRecommen
161161
List<Integer> upperTypeList = makeUpperList(closet, recommendation.getTops());
162162
List<Integer> outerTypeList = makeOuterList(closet, recommendation.getOuters());
163163

164-
List<WeatherFeelingDto> weatherFeelingDto = makeWeatherFeeling(recommendation.getPredictionMap(), recommendation);
164+
String currentRegionName = member.getRegionName() != null ? member.getRegionName() : "서울특별시 용산구";
165+
LocalDate forecastDate = recommendation.getDate();
166+
Map<String, Integer> predictionMap = recommendation.getPredictionMap();
167+
List<WeatherFeelingDto> weatherFeelingDto = makeWeatherFeeling(predictionMap, forecastDate, currentRegionName);
165168

166169
return RecommendPredictDto.builder()
167170
.feelingList(weatherFeelingDto)
@@ -217,17 +220,19 @@ private List<Integer> makeUpperList(Closet closet, List<Integer> tops) {
217220
}
218221

219222
private List<WeatherFeelingDto> makeWeatherFeeling(Map<String, Integer> predictionMap,
220-
ClothingRecommendation recommendation) {
223+
LocalDate forecastDate, String regionName) {
224+
log.info("makeWeatherFeeling 호출됨: 조회 regionName={}, forecastDate={}", regionName, forecastDate);
225+
221226
List<WeatherFeelingDto> feelingList = new ArrayList<>();
222-
LocalDate forecastDate = recommendation.getDate();
223-
String regionName = recommendation.getRegionName();
224-
log.info("현재 모델 반환에서 사용하는 위치 : " + regionName);
225227

226228
List<Integer> targetHours = List.of(9, 12, 15, 18, 21);
227229

228230
List<WeatherForecast> forecasts = weatherForecastRepository
229231
.findByRegionNameAndForecastDateAndHourInOrderByHourAsc(regionName, forecastDate, targetHours);
230232

233+
log.info("날씨 예보 DB 조회 결과: regionName={}, date={}, count={}", regionName, forecastDate, forecasts.size());
234+
235+
231236
Map<String, Integer> safePredictionMap = Optional.ofNullable(predictionMap).orElseGet(Collections::emptyMap);
232237
final int DEFAULT_FEELING = 2;
233238

0 commit comments

Comments
 (0)