From d2f17377299d42a79548bb138abd5832d48591f6 Mon Sep 17 00:00:00 2001 From: 7ijin01 Date: Mon, 15 Sep 2025 00:18:40 +0900 Subject: [PATCH 1/9] =?UTF-8?q?feat:=20OPTIONS=20=ED=97=88=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 2 +- .../opendata/global/config/SecurityConfig.java | 17 ++++++++++++----- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 77d85e1..c2beeda 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,7 +2,7 @@ name: CI / CD on: push: - branches: [main] + branches: [fix/#83-CORS] jobs: CI: diff --git a/src/main/java/com/opendata/global/config/SecurityConfig.java b/src/main/java/com/opendata/global/config/SecurityConfig.java index f02a5ef..e7f9401 100644 --- a/src/main/java/com/opendata/global/config/SecurityConfig.java +++ b/src/main/java/com/opendata/global/config/SecurityConfig.java @@ -15,6 +15,7 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.http.HttpMethod; import org.springframework.security.authentication.AuthenticationManager; import org.springframework.security.config.annotation.authentication.configuration.AuthenticationConfiguration; import org.springframework.security.config.annotation.method.configuration.EnableMethodSecurity; @@ -90,11 +91,17 @@ public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Excepti ) ) - .authorizeHttpRequests(requests -> requests - .requestMatchers("/oauth2/**","/register/*","/login/oauth2/**", "/swagger-ui/**", // Swagger UI 관련 경로 - "/v3/api-docs/**","/api/tourspot/**", "/course/**","/","/login","/auth").permitAll() - .anyRequest().authenticated() - ) + .authorizeHttpRequests(requests -> requests + .requestMatchers(HttpMethod.OPTIONS, "/**").permitAll() + + .requestMatchers( + "/oauth2/**","/register/*","/login/oauth2/**", + "/swagger-ui/**","/v3/api-docs/**", + "/api/tourspot/**", "/course/**","/","/login","/auth" + ).permitAll() + + .anyRequest().authenticated() + ) .oauth2Login((oauth2) -> oauth2 .authorizationEndpoint(config -> config .authorizationRequestRepository(cookieAuthorizationRequestRepository) //설정 From 6ff22a6e33d0765f9b2b62eff81471cdcdba7405 Mon Sep 17 00:00:00 2001 From: 7ijin01 Date: Mon, 15 Sep 2025 00:35:06 +0900 Subject: [PATCH 2/9] =?UTF-8?q?fix:=20PathVariable=EB=A1=9C=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/mypage/controller/MypageController.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/opendata/domain/mypage/controller/MypageController.java b/src/main/java/com/opendata/domain/mypage/controller/MypageController.java index 2e605c7..f0d705a 100644 --- a/src/main/java/com/opendata/domain/mypage/controller/MypageController.java +++ b/src/main/java/com/opendata/domain/mypage/controller/MypageController.java @@ -28,10 +28,10 @@ public ResponseEntity>> findCourses( ){ return ResponseEntity.ok(ApiResponse.onSuccess(mypageService.getCourses(customUserDetails))); } - @PostMapping("/preferences") + @PostMapping("/preferences/{tourSpotId}") public ResponseEntity> updateTourSpot( @AuthenticationPrincipal CustomUserDetails customUserDetails, - @RequestParam Long tourSpotId + @PathVariable Long tourSpotId ){ mypageService.saveUserTourSpot(customUserDetails,tourSpotId); return ResponseEntity.ok(ApiResponse.onSuccessVoid()); @@ -42,10 +42,10 @@ public ResponseEntity>> findTourSpot( ){ return ResponseEntity.ok(ApiResponse.onSuccess(mypageService.getTourSpotDetail(customUserDetails))); } - @DeleteMapping("/preferences") + @DeleteMapping("/preferences/{tourSpotId}") public ResponseEntity> deleteTourSpot( @AuthenticationPrincipal CustomUserDetails customUserDetails, - @RequestParam Long tourSpotId + @PathVariable Long tourSpotId ){ mypageService.deleteTourSpot(customUserDetails,tourSpotId); return ResponseEntity.ok(ApiResponse.onSuccessVoid()); @@ -57,9 +57,9 @@ public ResponseEntity> findUser( return ResponseEntity.ok(ApiResponse.onSuccess(mypageService.getUser(customUserDetails))); } - @GetMapping("/preferences/check") + @GetMapping("/preferences/check/{tourSpotId}") public ResponseEntity> CheckTourSpot( - @RequestParam Long tourSpotId, + @PathVariable Long tourSpotId, @AuthenticationPrincipal CustomUserDetails customUserDetails ){ return ResponseEntity.ok(ApiResponse.onSuccess(mypageService.isPreferenceTourSpot(customUserDetails, tourSpotId))); From 906ee59ad8ff4680402e287b899b84adc27f512f Mon Sep 17 00:00:00 2001 From: 7ijin01 Date: Mon, 15 Sep 2025 00:44:59 +0900 Subject: [PATCH 3/9] =?UTF-8?q?fix:=20PathVariable=EB=A1=9C=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/opendata/docs/MyPageControllerDocs.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/opendata/docs/MyPageControllerDocs.java b/src/main/java/com/opendata/docs/MyPageControllerDocs.java index f51b13d..38b384a 100644 --- a/src/main/java/com/opendata/docs/MyPageControllerDocs.java +++ b/src/main/java/com/opendata/docs/MyPageControllerDocs.java @@ -13,6 +13,7 @@ import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.ResponseEntity; import org.springframework.security.core.annotation.AuthenticationPrincipal; +import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestParam; import java.util.List; @@ -105,7 +106,7 @@ ResponseEntity> updateTourSpot( @AuthenticationPrincipal CustomUserDetails customUserDetails, - @RequestParam Long tourSpotId + @PathVariable Long tourSpotId ); @Operation(summary = "사용자 선호 관광지 조회", description = "사용자가 선호하는 관광지 조회") @@ -194,7 +195,7 @@ ResponseEntity> deleteTourSpot( @AuthenticationPrincipal CustomUserDetails customUserDetails, - @RequestParam Long tourSpotId + @PathVariable Long tourSpotId ); @Operation(summary = "사용자 조회", description = "사용자 정보(이메일, 멤버쉽, 이름) 조회") @@ -284,7 +285,7 @@ ResponseEntity> findUser( ) }) ResponseEntity> CheckTourSpot( - @RequestParam Long tourSpotId, + @PathVariable Long tourSpotId, @AuthenticationPrincipal CustomUserDetails customUserDetails ); } From c38df1ac710b038c7ced173ad319b2a395c4618a Mon Sep 17 00:00:00 2001 From: 7ijin01 Date: Mon, 15 Sep 2025 00:50:39 +0900 Subject: [PATCH 4/9] =?UTF-8?q?fix:=20PathVariable=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/opendata/docs/MyPageControllerDocs.java | 6 +++--- .../domain/mypage/controller/MypageController.java | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/opendata/docs/MyPageControllerDocs.java b/src/main/java/com/opendata/docs/MyPageControllerDocs.java index 38b384a..943cf12 100644 --- a/src/main/java/com/opendata/docs/MyPageControllerDocs.java +++ b/src/main/java/com/opendata/docs/MyPageControllerDocs.java @@ -106,7 +106,7 @@ ResponseEntity> updateTourSpot( @AuthenticationPrincipal CustomUserDetails customUserDetails, - @PathVariable Long tourSpotId + @PathVariable("tourSpotId") Long tourSpotId ); @Operation(summary = "사용자 선호 관광지 조회", description = "사용자가 선호하는 관광지 조회") @@ -195,7 +195,7 @@ ResponseEntity> deleteTourSpot( @AuthenticationPrincipal CustomUserDetails customUserDetails, - @PathVariable Long tourSpotId + @PathVariable("tourSpotId") Long tourSpotId ); @Operation(summary = "사용자 조회", description = "사용자 정보(이메일, 멤버쉽, 이름) 조회") @@ -285,7 +285,7 @@ ResponseEntity> findUser( ) }) ResponseEntity> CheckTourSpot( - @PathVariable Long tourSpotId, + @PathVariable("tourSpotId") Long tourSpotId, @AuthenticationPrincipal CustomUserDetails customUserDetails ); } diff --git a/src/main/java/com/opendata/domain/mypage/controller/MypageController.java b/src/main/java/com/opendata/domain/mypage/controller/MypageController.java index f0d705a..727e682 100644 --- a/src/main/java/com/opendata/domain/mypage/controller/MypageController.java +++ b/src/main/java/com/opendata/domain/mypage/controller/MypageController.java @@ -28,10 +28,10 @@ public ResponseEntity>> findCourses( ){ return ResponseEntity.ok(ApiResponse.onSuccess(mypageService.getCourses(customUserDetails))); } - @PostMapping("/preferences/{tourSpotId}") + @PostMapping("/preferences/{tourspotId}") public ResponseEntity> updateTourSpot( @AuthenticationPrincipal CustomUserDetails customUserDetails, - @PathVariable Long tourSpotId + @PathVariable("tourSpotId") Long tourSpotId ){ mypageService.saveUserTourSpot(customUserDetails,tourSpotId); return ResponseEntity.ok(ApiResponse.onSuccessVoid()); @@ -45,7 +45,7 @@ public ResponseEntity>> findTourSpot( @DeleteMapping("/preferences/{tourSpotId}") public ResponseEntity> deleteTourSpot( @AuthenticationPrincipal CustomUserDetails customUserDetails, - @PathVariable Long tourSpotId + @PathVariable("tourSpotId") Long tourSpotId ){ mypageService.deleteTourSpot(customUserDetails,tourSpotId); return ResponseEntity.ok(ApiResponse.onSuccessVoid()); @@ -59,7 +59,7 @@ public ResponseEntity> findUser( @GetMapping("/preferences/check/{tourSpotId}") public ResponseEntity> CheckTourSpot( - @PathVariable Long tourSpotId, + @PathVariable("tourSpotId") Long tourSpotId, @AuthenticationPrincipal CustomUserDetails customUserDetails ){ return ResponseEntity.ok(ApiResponse.onSuccess(mypageService.isPreferenceTourSpot(customUserDetails, tourSpotId))); From 106ea50ba97858ba7fa57ab9e94402a2431dd39a Mon Sep 17 00:00:00 2001 From: 7ijin01 Date: Mon, 15 Sep 2025 00:56:51 +0900 Subject: [PATCH 5/9] =?UTF-8?q?fix:=20PathVariable=20=EC=86=8C=EB=AC=B8?= =?UTF-8?q?=EC=9E=90=20=ED=86=B5=EC=9D=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/opendata/docs/MyPageControllerDocs.java | 6 +++--- .../opendata/domain/mypage/controller/MypageController.java | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/opendata/docs/MyPageControllerDocs.java b/src/main/java/com/opendata/docs/MyPageControllerDocs.java index 943cf12..7ba2f21 100644 --- a/src/main/java/com/opendata/docs/MyPageControllerDocs.java +++ b/src/main/java/com/opendata/docs/MyPageControllerDocs.java @@ -106,7 +106,7 @@ ResponseEntity> updateTourSpot( @AuthenticationPrincipal CustomUserDetails customUserDetails, - @PathVariable("tourSpotId") Long tourSpotId + @PathVariable("tourspotId") Long tourSpotId ); @Operation(summary = "사용자 선호 관광지 조회", description = "사용자가 선호하는 관광지 조회") @@ -195,7 +195,7 @@ ResponseEntity> deleteTourSpot( @AuthenticationPrincipal CustomUserDetails customUserDetails, - @PathVariable("tourSpotId") Long tourSpotId + @PathVariable("tourspotId") Long tourSpotId ); @Operation(summary = "사용자 조회", description = "사용자 정보(이메일, 멤버쉽, 이름) 조회") @@ -285,7 +285,7 @@ ResponseEntity> findUser( ) }) ResponseEntity> CheckTourSpot( - @PathVariable("tourSpotId") Long tourSpotId, + @PathVariable("tourspotId") Long tourSpotId, @AuthenticationPrincipal CustomUserDetails customUserDetails ); } diff --git a/src/main/java/com/opendata/domain/mypage/controller/MypageController.java b/src/main/java/com/opendata/domain/mypage/controller/MypageController.java index 727e682..cb0bbe4 100644 --- a/src/main/java/com/opendata/domain/mypage/controller/MypageController.java +++ b/src/main/java/com/opendata/domain/mypage/controller/MypageController.java @@ -31,7 +31,7 @@ public ResponseEntity>> findCourses( @PostMapping("/preferences/{tourspotId}") public ResponseEntity> updateTourSpot( @AuthenticationPrincipal CustomUserDetails customUserDetails, - @PathVariable("tourSpotId") Long tourSpotId + @PathVariable("tourspotId") Long tourSpotId ){ mypageService.saveUserTourSpot(customUserDetails,tourSpotId); return ResponseEntity.ok(ApiResponse.onSuccessVoid()); @@ -45,7 +45,7 @@ public ResponseEntity>> findTourSpot( @DeleteMapping("/preferences/{tourSpotId}") public ResponseEntity> deleteTourSpot( @AuthenticationPrincipal CustomUserDetails customUserDetails, - @PathVariable("tourSpotId") Long tourSpotId + @PathVariable("tourspotId") Long tourSpotId ){ mypageService.deleteTourSpot(customUserDetails,tourSpotId); return ResponseEntity.ok(ApiResponse.onSuccessVoid()); @@ -59,7 +59,7 @@ public ResponseEntity> findUser( @GetMapping("/preferences/check/{tourSpotId}") public ResponseEntity> CheckTourSpot( - @PathVariable("tourSpotId") Long tourSpotId, + @PathVariable("tourspotId") Long tourSpotId, @AuthenticationPrincipal CustomUserDetails customUserDetails ){ return ResponseEntity.ok(ApiResponse.onSuccess(mypageService.isPreferenceTourSpot(customUserDetails, tourSpotId))); From 57fb42d58d07610842805e6c381058858d6685aa Mon Sep 17 00:00:00 2001 From: 7ijin01 Date: Mon, 15 Sep 2025 01:03:01 +0900 Subject: [PATCH 6/9] =?UTF-8?q?fix:=20PathVariable=20=EC=86=8C=EB=AC=B8?= =?UTF-8?q?=EC=9E=90=20=ED=86=B5=EC=9D=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../opendata/domain/mypage/controller/MypageController.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/opendata/domain/mypage/controller/MypageController.java b/src/main/java/com/opendata/domain/mypage/controller/MypageController.java index cb0bbe4..748d86b 100644 --- a/src/main/java/com/opendata/domain/mypage/controller/MypageController.java +++ b/src/main/java/com/opendata/domain/mypage/controller/MypageController.java @@ -42,7 +42,7 @@ public ResponseEntity>> findTourSpot( ){ return ResponseEntity.ok(ApiResponse.onSuccess(mypageService.getTourSpotDetail(customUserDetails))); } - @DeleteMapping("/preferences/{tourSpotId}") + @DeleteMapping("/preferences/{tourspotId}") public ResponseEntity> deleteTourSpot( @AuthenticationPrincipal CustomUserDetails customUserDetails, @PathVariable("tourspotId") Long tourSpotId @@ -57,7 +57,7 @@ public ResponseEntity> findUser( return ResponseEntity.ok(ApiResponse.onSuccess(mypageService.getUser(customUserDetails))); } - @GetMapping("/preferences/check/{tourSpotId}") + @GetMapping("/preferences/check/{tourspotId}") public ResponseEntity> CheckTourSpot( @PathVariable("tourspotId") Long tourSpotId, @AuthenticationPrincipal CustomUserDetails customUserDetails From 1c9d11b4e5559f9708b05692f76e2a8089ee94f9 Mon Sep 17 00:00:00 2001 From: 7ijin01 Date: Mon, 15 Sep 2025 12:50:26 +0900 Subject: [PATCH 7/9] =?UTF-8?q?fix:=20api=20=ED=82=A4=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/tourspot/service/TourSpotRelatedService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/opendata/domain/tourspot/service/TourSpotRelatedService.java b/src/main/java/com/opendata/domain/tourspot/service/TourSpotRelatedService.java index d403248..c0535b9 100644 --- a/src/main/java/com/opendata/domain/tourspot/service/TourSpotRelatedService.java +++ b/src/main/java/com/opendata/domain/tourspot/service/TourSpotRelatedService.java @@ -32,7 +32,7 @@ public class TourSpotRelatedService { private final AddressRepository addressRepository; private final TourSpotRelatedRepository tourSpotRelatedRepository; - @Value("${api.tour_api_congestion_key}") + @Value("${api.tour_api_tourspot_key}") private String secretKey; From 7c2f3f4baa27902724d713b50d9fb76e16f28adc Mon Sep 17 00:00:00 2001 From: 7ijin01 Date: Mon, 15 Sep 2025 12:51:53 +0900 Subject: [PATCH 8/9] =?UTF-8?q?fix:=20=EC=8A=A4=EC=BC=80=EC=A4=84=EB=A7=81?= =?UTF-8?q?=20=EC=A3=BC=EC=84=9D=20=EC=A0=9C=EA=B1=B0=20=EB=B0=8F=20?= =?UTF-8?q?=EC=8B=9C=EA=B0=84=20=EB=B3=80=EA=B2=BD(03:05=EB=B6=84)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/opendata/domain/tourspot/service/TourSpotService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/opendata/domain/tourspot/service/TourSpotService.java b/src/main/java/com/opendata/domain/tourspot/service/TourSpotService.java index 1316454..accc5a7 100644 --- a/src/main/java/com/opendata/domain/tourspot/service/TourSpotService.java +++ b/src/main/java/com/opendata/domain/tourspot/service/TourSpotService.java @@ -297,7 +297,7 @@ record Fetch(Address source, TourSpotRelatedDto dto) {} } } - //@Scheduled(cron = "0 0 3 * * *", zone = "Asia/Seoul") + @Scheduled(cron = "0 5 3 * * *", zone = "Asia/Seoul") @Transactional public Void updateMonthlyCongestion() { List
addressList = addressCache.getAll(); From 79cbd388a2675741dc6c0e1dc1d98fa34e58b07a Mon Sep 17 00:00:00 2001 From: 7ijin01 Date: Mon, 15 Sep 2025 20:54:27 +0900 Subject: [PATCH 9/9] =?UTF-8?q?fix:=20=EB=B0=B0=ED=8F=AC=20=EB=B8=8C?= =?UTF-8?q?=EB=9E=9C=EC=B9=98=20=EB=B3=B5=EA=B5=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c2beeda..77d85e1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,7 +2,7 @@ name: CI / CD on: push: - branches: [fix/#83-CORS] + branches: [main] jobs: CI: