Skip to content

Commit

Permalink
fix : 사용하지 않는 어노테이션 삭제 @AuthenticationPrincipal
Browse files Browse the repository at this point in the history
  • Loading branch information
Dayon-Hong committed Aug 6, 2024
1 parent 7b8bbf6 commit 7d15f4a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -41,7 +36,7 @@ public ResponseEntity<LocationResponse> findLocation(@RequestBody LocationReques
}


/** 현재 날씨 정보 가져오기 **/
/** 여행지 현재 날씨 정보 가져오기 **/
@PostMapping("/weather/current")
public ResponseEntity<WeatherResponse> getCurrentWeather(@RequestBody LocationRequest requestDTO) {
String city = requestDTO.getCountry();
Expand All @@ -50,7 +45,7 @@ public ResponseEntity<WeatherResponse> getCurrentWeather(@RequestBody LocationRe
}


/** 한 주 날씨 정보 조회 **/
/** 여행지 한 주 날씨 정보 조회 **/
@PostMapping("/weather/weekly")
public ResponseEntity<List<DailyWeatherResponse>> getWeeklyWeather(@RequestBody LocationRequest requestDTO) {
String city = requestDTO.getCountry();
Expand All @@ -60,7 +55,7 @@ public ResponseEntity<List<DailyWeatherResponse>> getWeeklyWeather(@RequestBody
}


/** 환율 정보 업데이트 API **/
/** 여행지 환율 정보 업데이트 API **/
@GetMapping("/exchange-rates/update")
public String updateExchangeRate() {
try {
Expand All @@ -71,7 +66,8 @@ public String updateExchangeRate() {
}
}

/** 환율 정보 조회 API **/

/** 여행지 환율 정보 조회 API **/
@GetMapping("/exchange-rates")
public ResponseEntity<List<ExchangeRateResponse>> getAllExchangeRates() {
List<ExchangeRateResponse> exchangeRates = exchangeRateService.getAllExchangeRates();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ public class FlightOfferController {

/** 항공권 검색 API **/
@PostMapping("/search")
public ResponseEntity<String> getFlightOffers(@AuthenticationPrincipal CustomUserDetails customUserDetails,
@RequestBody FlightSearchRequest request) {
String memberUid = customUserDetails.getUsername();
public ResponseEntity<String> getFlightOffers(@RequestBody FlightSearchRequest request) {
try {
String flightOffersJson = flightOfferService.getFlightOffers(request);
return ResponseEntity.ok(flightOffersJson);
Expand All @@ -42,9 +40,7 @@ public ResponseEntity<String> getFlightOffers(@AuthenticationPrincipal CustomUse

/** 항공권 선택시 스카이스캐너 사이트로 연결 API **/
@PostMapping("/connect")
public ResponseEntity<String> getFlightSearchUrl(@AuthenticationPrincipal CustomUserDetails customUserDetails,
@RequestBody SkyScannerRequest request) {
String memberUid = customUserDetails.getUsername();
public ResponseEntity<String> getFlightSearchUrl(@RequestBody SkyScannerRequest request) {
try {
String skyscannerUrl = flightOfferService.generateSkyscannerUrl(request);
return ResponseEntity.ok("{\"skyscannerUrl\": \"" + skyscannerUrl + "\"}");
Expand Down

0 comments on commit 7d15f4a

Please sign in to comment.