From c95c47d630db1838086e45d174c7e3f7efa6a803 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=B0=95=EC=84=B8=EC=9B=90?= Date: Thu, 30 Oct 2025 18:06:18 +0900 Subject: [PATCH 1/2] edit api --- .../src/main/java/com/kt/ai/config/SwaggerConfig.java | 6 +++++- .../java/com/kt/ai/controller/InternalJobController.java | 2 +- .../kt/ai/controller/InternalRecommendationController.java | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ai-service/src/main/java/com/kt/ai/config/SwaggerConfig.java b/ai-service/src/main/java/com/kt/ai/config/SwaggerConfig.java index 4523c0d..f0ad1fc 100644 --- a/ai-service/src/main/java/com/kt/ai/config/SwaggerConfig.java +++ b/ai-service/src/main/java/com/kt/ai/config/SwaggerConfig.java @@ -20,6 +20,10 @@ public class SwaggerConfig { @Bean public OpenAPI openAPI() { + Server vmServer = new Server(); + vmServer.setUrl("http://kt-event-marketing-api.20.214.196.128.nip.io/api/v1/ai"); + vmServer.setDescription("VM Development Server"); + Server localServer = new Server(); localServer.setUrl("http://localhost:8083"); localServer.setDescription("Local Development Server"); @@ -59,6 +63,6 @@ public class SwaggerConfig { return new OpenAPI() .info(info) - .servers(List.of(localServer, devServer, prodServer)); + .servers(List.of(vmServer, localServer, devServer, prodServer)); } } diff --git a/ai-service/src/main/java/com/kt/ai/controller/InternalJobController.java b/ai-service/src/main/java/com/kt/ai/controller/InternalJobController.java index aba5cc0..053313e 100644 --- a/ai-service/src/main/java/com/kt/ai/controller/InternalJobController.java +++ b/ai-service/src/main/java/com/kt/ai/controller/InternalJobController.java @@ -27,7 +27,7 @@ import java.util.Map; @Slf4j @Tag(name = "Internal API", description = "내부 서비스 간 통신용 API") @RestController -@RequestMapping("/api/v1/ai-service/internal/jobs") +@RequestMapping("/jobs") @RequiredArgsConstructor public class InternalJobController { diff --git a/ai-service/src/main/java/com/kt/ai/controller/InternalRecommendationController.java b/ai-service/src/main/java/com/kt/ai/controller/InternalRecommendationController.java index 883d1d8..9bc3bae 100644 --- a/ai-service/src/main/java/com/kt/ai/controller/InternalRecommendationController.java +++ b/ai-service/src/main/java/com/kt/ai/controller/InternalRecommendationController.java @@ -31,7 +31,7 @@ import java.util.Set; @Slf4j @Tag(name = "Internal API", description = "내부 서비스 간 통신용 API") @RestController -@RequestMapping("/api/v1/ai-service/internal/recommendations") +@RequestMapping("/recommendations") @RequiredArgsConstructor public class InternalRecommendationController { From 027ab86e8d43c280d1f3f8eb6e5db5389cb3f362 Mon Sep 17 00:00:00 2001 From: jhbkjh Date: Thu, 30 Oct 2025 18:07:28 +0900 Subject: [PATCH 2/2] =?UTF-8?q?=ED=8C=8C=ED=8B=B0=EC=8B=9C=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=85=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ParticipationController.java | 17 +++++++---------- .../controller/WinnerController.java | 8 ++++---- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/participation-service/src/main/java/com/kt/event/participation/presentation/controller/ParticipationController.java b/participation-service/src/main/java/com/kt/event/participation/presentation/controller/ParticipationController.java index 39f8b58..eedf7d6 100644 --- a/participation-service/src/main/java/com/kt/event/participation/presentation/controller/ParticipationController.java +++ b/participation-service/src/main/java/com/kt/event/participation/presentation/controller/ParticipationController.java @@ -25,9 +25,8 @@ import org.springframework.web.bind.annotation.*; * @since 2025-01-24 */ @Slf4j -@CrossOrigin(origins = "http://localhost:3000") +@RequestMapping @RestController -@RequestMapping("/api/v1") @RequiredArgsConstructor public class ParticipationController { @@ -35,9 +34,9 @@ public class ParticipationController { /** * 이벤트 참여 - * POST /participations/{eventId}/participate + * POST /events/{eventId}/participate */ - @PostMapping("/participations/{eventId}/participate") + @PostMapping("/events/{eventId}/participate") public ResponseEntity> participate( @PathVariable String eventId, @Valid @RequestBody ParticipationRequest request) { @@ -61,15 +60,14 @@ public class ParticipationController { /** * 참여자 목록 조회 - * GET /participations/{eventId}/participants - * GET /events/{eventId}/participants (프론트엔드 호환) + * GET /events/{eventId}/participants */ @Operation( summary = "참여자 목록 조회", description = "이벤트의 참여자 목록을 페이징하여 조회합니다. " + "정렬 가능한 필드: createdAt(기본값), participantId, name, phoneNumber, bonusEntries, isWinner, wonAt" ) - @GetMapping({"/participations/{eventId}/participants", "/events/{eventId}/participants"}) + @GetMapping({"/events/{eventId}/participants"}) public ResponseEntity>> getParticipants( @Parameter(description = "이벤트 ID", example = "evt_20250124_001") @PathVariable String eventId, @@ -90,10 +88,9 @@ public class ParticipationController { /** * 참여자 상세 조회 - * GET /participations/{eventId}/participants/{participantId} - * GET /events/{eventId}/participants/{participantId} (프론트엔드 호환) + * GET /events/{eventId}/participants/{participantId} */ - @GetMapping({"/participations/{eventId}/participants/{participantId}", "/events/{eventId}/participants/{participantId}"}) + @GetMapping({"/events/{eventId}/participants/{participantId}"}) public ResponseEntity> getParticipant( @PathVariable String eventId, @PathVariable String participantId) { diff --git a/participation-service/src/main/java/com/kt/event/participation/presentation/controller/WinnerController.java b/participation-service/src/main/java/com/kt/event/participation/presentation/controller/WinnerController.java index 4a42e61..66c317f 100644 --- a/participation-service/src/main/java/com/kt/event/participation/presentation/controller/WinnerController.java +++ b/participation-service/src/main/java/com/kt/event/participation/presentation/controller/WinnerController.java @@ -27,7 +27,7 @@ import org.springframework.web.bind.annotation.*; @Slf4j @CrossOrigin(origins = "http://localhost:3000") @RestController -@RequestMapping("/api/v1") +@RequestMapping @RequiredArgsConstructor public class WinnerController { @@ -35,9 +35,9 @@ public class WinnerController { /** * 당첨자 추첨 - * POST /participations/{eventId}/draw-winners + * POST /events/{eventId}/draw-winners */ - @PostMapping("/participations/{eventId}/draw-winners") + @PostMapping("/events/{eventId}/draw-winners") public ResponseEntity> drawWinners( @PathVariable String eventId, @Valid @RequestBody DrawWinnersRequest request) { @@ -57,7 +57,7 @@ public class WinnerController { description = "이벤트의 당첨자 목록을 페이징하여 조회합니다. " + "정렬 가능한 필드: winnerRank(기본값), wonAt, participantId, name, phoneNumber, bonusEntries" ) - @GetMapping("/participations/{eventId}/winners") + @GetMapping("/events/{eventId}/winners") public ResponseEntity>> getWinners( @Parameter(description = "이벤트 ID", example = "evt_20250124_001") @PathVariable String eventId,