From 027ab86e8d43c280d1f3f8eb6e5db5389cb3f362 Mon Sep 17 00:00:00 2001 From: jhbkjh Date: Thu, 30 Oct 2025 18:07:28 +0900 Subject: [PATCH] =?UTF-8?q?=ED=8C=8C=ED=8B=B0=EC=8B=9C=ED=8E=98=EC=9D=B4?= =?UTF-8?q?=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,