From 7d15f4a523b0b1e015a25aad7a6cef507244c7ec Mon Sep 17 00:00:00 2001 From: Dayeon-Hong Date: Tue, 6 Aug 2024 23:43:49 +0900 Subject: [PATCH] =?UTF-8?q?fix=20:=20=EC=82=AC=EC=9A=A9=ED=95=98=EC=A7=80?= =?UTF-8?q?=20=EC=95=8A=EB=8A=94=20=EC=96=B4=EB=85=B8=ED=85=8C=EC=9D=B4?= =?UTF-8?q?=EC=85=98=20=EC=82=AD=EC=A0=9C=20@AuthenticationPrincipal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../country/controller/CountryController.java | 14 +++++--------- .../flight/controller/FlightOfferController.java | 8 ++------ 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/backend/src/main/java/com/isp/backend/domain/country/controller/CountryController.java b/backend/src/main/java/com/isp/backend/domain/country/controller/CountryController.java index dbd4fe3a..ab75715f 100644 --- a/backend/src/main/java/com/isp/backend/domain/country/controller/CountryController.java +++ b/backend/src/main/java/com/isp/backend/domain/country/controller/CountryController.java @@ -5,19 +5,14 @@ import com.isp.backend.domain.country.dto.response.ExchangeRateResponse; import com.isp.backend.domain.country.dto.response.LocationResponse; import com.isp.backend.domain.country.dto.response.WeatherResponse; -import com.isp.backend.domain.country.entity.ExchangeRate; import com.isp.backend.domain.country.service.CountryService; import com.isp.backend.domain.country.service.ExchangeRateService; import lombok.RequiredArgsConstructor; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; -import java.io.IOException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import java.time.LocalTime; import java.util.List; -import java.util.Map; import java.util.Optional; @RestController @@ -41,7 +36,7 @@ public ResponseEntity findLocation(@RequestBody LocationReques } - /** 현재 날씨 정보 가져오기 **/ + /** 여행지 현재 날씨 정보 가져오기 **/ @PostMapping("/weather/current") public ResponseEntity getCurrentWeather(@RequestBody LocationRequest requestDTO) { String city = requestDTO.getCountry(); @@ -50,7 +45,7 @@ public ResponseEntity getCurrentWeather(@RequestBody LocationRe } - /** 한 주 날씨 정보 조회 **/ + /** 여행지 한 주 날씨 정보 조회 **/ @PostMapping("/weather/weekly") public ResponseEntity> getWeeklyWeather(@RequestBody LocationRequest requestDTO) { String city = requestDTO.getCountry(); @@ -60,7 +55,7 @@ public ResponseEntity> getWeeklyWeather(@RequestBody } - /** 환율 정보 업데이트 API **/ + /** 여행지 환율 정보 업데이트 API **/ @GetMapping("/exchange-rates/update") public String updateExchangeRate() { try { @@ -71,7 +66,8 @@ public String updateExchangeRate() { } } - /** 환율 정보 조회 API **/ + + /** 여행지 환율 정보 조회 API **/ @GetMapping("/exchange-rates") public ResponseEntity> getAllExchangeRates() { List exchangeRates = exchangeRateService.getAllExchangeRates(); diff --git a/backend/src/main/java/com/isp/backend/domain/flight/controller/FlightOfferController.java b/backend/src/main/java/com/isp/backend/domain/flight/controller/FlightOfferController.java index 59e8a34a..684adfe6 100644 --- a/backend/src/main/java/com/isp/backend/domain/flight/controller/FlightOfferController.java +++ b/backend/src/main/java/com/isp/backend/domain/flight/controller/FlightOfferController.java @@ -28,9 +28,7 @@ public class FlightOfferController { /** 항공권 검색 API **/ @PostMapping("/search") - public ResponseEntity getFlightOffers(@AuthenticationPrincipal CustomUserDetails customUserDetails, - @RequestBody FlightSearchRequest request) { - String memberUid = customUserDetails.getUsername(); + public ResponseEntity getFlightOffers(@RequestBody FlightSearchRequest request) { try { String flightOffersJson = flightOfferService.getFlightOffers(request); return ResponseEntity.ok(flightOffersJson); @@ -42,9 +40,7 @@ public ResponseEntity getFlightOffers(@AuthenticationPrincipal CustomUse /** 항공권 선택시 스카이스캐너 사이트로 연결 API **/ @PostMapping("/connect") - public ResponseEntity getFlightSearchUrl(@AuthenticationPrincipal CustomUserDetails customUserDetails, - @RequestBody SkyScannerRequest request) { - String memberUid = customUserDetails.getUsername(); + public ResponseEntity getFlightSearchUrl(@RequestBody SkyScannerRequest request) { try { String skyscannerUrl = flightOfferService.generateSkyscannerUrl(request); return ResponseEntity.ok("{\"skyscannerUrl\": \"" + skyscannerUrl + "\"}");