From ee0d66201381c7bb579c6e0a416d07707ecdea53 Mon Sep 17 00:00:00 2001 From: Hanna Date: Fri, 12 Jan 2024 09:58:58 +0900 Subject: [PATCH] =?UTF-8?q?docs:=20=EC=98=88=EB=A7=A4=20swagger=20?= =?UTF-8?q?=EC=96=B4=EB=85=B8=ED=85=8C=EC=9D=B4=EC=85=98=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/booking/controller/BookingController.java | 8 ++++++++ .../bookingqueue/controller/BookingQueueController.java | 8 ++++++++ .../domain/payment/controller/PaymentController.java | 6 ++++++ .../apibooking/domain/seat/controller/SeatController.java | 6 ++++++ 4 files changed, 28 insertions(+) diff --git a/api/api-booking/src/main/java/com/pgms/apibooking/domain/booking/controller/BookingController.java b/api/api-booking/src/main/java/com/pgms/apibooking/domain/booking/controller/BookingController.java index a628c691..cf569cf8 100644 --- a/api/api-booking/src/main/java/com/pgms/apibooking/domain/booking/controller/BookingController.java +++ b/api/api-booking/src/main/java/com/pgms/apibooking/domain/booking/controller/BookingController.java @@ -25,6 +25,8 @@ import com.pgms.coredomain.response.ApiResponse; import com.pgms.coresecurity.security.resolver.CurrentAccount; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.servlet.http.HttpServletRequest; import jakarta.validation.Valid; import lombok.RequiredArgsConstructor; @@ -32,10 +34,12 @@ @RestController @RequestMapping("/api/v1/bookings") @RequiredArgsConstructor +@Tag(name = "예매") public class BookingController { private final BookingService bookingService; + @Operation(summary = "예매 생성") @PostMapping("/create") public ResponseEntity> createBooking( @CurrentAccount Long memberId, @@ -52,6 +56,7 @@ public ResponseEntity> createBooking( return ResponseEntity.created(location).body(response); } + @Operation(summary = "예매 취소") @PostMapping("/{id}/cancel") public ResponseEntity cancelBooking( @CurrentAccount Long memberId, @@ -61,12 +66,14 @@ public ResponseEntity cancelBooking( return ResponseEntity.noContent().build(); } + @Operation(summary = "예매 이탈") @PostMapping("/{id}/exit") public ResponseEntity exitBooking(@PathVariable String id) { bookingService.exitBooking(id); return ResponseEntity.noContent().build(); } + @Operation(summary = "내 예매 목록 조회") @GetMapping public ResponseEntity>> getBookings( @CurrentAccount Long memberId, @@ -78,6 +85,7 @@ public ResponseEntity>> getBooking return ResponseEntity.ok().body(response); } + @Operation(summary = "내 예매 상세 조회") @GetMapping("/{id}") public ResponseEntity> getBooking( @CurrentAccount Long memberId, diff --git a/api/api-booking/src/main/java/com/pgms/apibooking/domain/bookingqueue/controller/BookingQueueController.java b/api/api-booking/src/main/java/com/pgms/apibooking/domain/bookingqueue/controller/BookingQueueController.java index d788d98e..7fb7ffbf 100644 --- a/api/api-booking/src/main/java/com/pgms/apibooking/domain/bookingqueue/controller/BookingQueueController.java +++ b/api/api-booking/src/main/java/com/pgms/apibooking/domain/bookingqueue/controller/BookingQueueController.java @@ -18,28 +18,34 @@ import com.pgms.apibooking.domain.bookingqueue.service.BookingQueueService; import com.pgms.coredomain.response.ApiResponse; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; import lombok.RequiredArgsConstructor; @RestController @RequestMapping("/api/v1/bookings") @RequiredArgsConstructor +@Tag(name = "예매 대기열") public class BookingQueueController { private final BookingQueueService bookingQueueService; + @Operation(summary = "세션 아이디 발급") @PostMapping("/issue-session-id") public ResponseEntity> issueSessionId() { ApiResponse response = ApiResponse.ok(bookingQueueService.issueSessionId()); return ResponseEntity.ok(response); } + @Operation(summary = "대기열 진입") @PostMapping("/enter-queue") public ResponseEntity enterQueue(@RequestBody @Valid BookingQueueEnterRequest request, @RequestAttribute("bookingSessionId") String bookingSessionId) { bookingQueueService.enterQueue(request, bookingSessionId); return ResponseEntity.noContent().build(); } + @Operation(summary = "내 대기 순서 확인") @GetMapping("/order-in-queue") public ResponseEntity> getOrderInQueue(@RequestParam Long eventId, @RequestAttribute("bookingSessionId") String bookingSessionId) { ApiResponse response = @@ -47,12 +53,14 @@ public ResponseEntity> getOrderInQueue(@Req return ResponseEntity.ok(response); } + @Operation(summary = "예매 토큰 발급") @PostMapping("/issue-token") public ResponseEntity> issueToken(@RequestBody @Valid TokenIssueRequest request, @RequestAttribute("bookingSessionId") String bookingSessionId) { ApiResponse response = ApiResponse.ok(bookingQueueService.issueToken(request, bookingSessionId)); return ResponseEntity.ok(response); } + @Operation(summary = "대기열 이탈") @PostMapping("/exit-queue") public ResponseEntity exitQueue(@RequestBody @Valid BookingQueueExitRequest request, @RequestAttribute("bookingSessionId") String bookingSessionId) { bookingQueueService.exitQueue(request, bookingSessionId); diff --git a/api/api-booking/src/main/java/com/pgms/apibooking/domain/payment/controller/PaymentController.java b/api/api-booking/src/main/java/com/pgms/apibooking/domain/payment/controller/PaymentController.java index 180b2b11..6ada834f 100644 --- a/api/api-booking/src/main/java/com/pgms/apibooking/domain/payment/controller/PaymentController.java +++ b/api/api-booking/src/main/java/com/pgms/apibooking/domain/payment/controller/PaymentController.java @@ -13,15 +13,19 @@ import com.pgms.apibooking.domain.payment.service.PaymentService; import com.pgms.coredomain.response.ApiResponse; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; import lombok.RequiredArgsConstructor; @RestController @RequestMapping("/api/v1/payments") @RequiredArgsConstructor +@Tag(name = "결제") public class PaymentController { private final PaymentService paymentService; + @Operation(summary = "결제 성공 처리") @GetMapping("/success") public ResponseEntity confirmPaymentSuccess( @RequestParam String paymentKey, @@ -31,6 +35,7 @@ public ResponseEntity confirmPaymentSuccess( return ResponseEntity.ok(ApiResponse.ok(paymentService.successPayment(paymentKey, bookingId, amount))); } + @Operation(summary = "결제 실패 처리") @GetMapping("/fail") public ResponseEntity confirmPaymentFail( @RequestParam(name = "code") String errorCode, @@ -42,6 +47,7 @@ public ResponseEntity confirmPaymentFail( return ResponseEntity.ok(response); } + @Operation(summary = "가상계좌 입금 확인 웹훅") @PostMapping("/virtual/income") public ResponseEntity confirmVirtualAccountIncome(@RequestBody ConfirmVirtualIncomeRequest request) { System.out.println(request.createdAt()); diff --git a/api/api-booking/src/main/java/com/pgms/apibooking/domain/seat/controller/SeatController.java b/api/api-booking/src/main/java/com/pgms/apibooking/domain/seat/controller/SeatController.java index 1553eb4c..b8e0680b 100644 --- a/api/api-booking/src/main/java/com/pgms/apibooking/domain/seat/controller/SeatController.java +++ b/api/api-booking/src/main/java/com/pgms/apibooking/domain/seat/controller/SeatController.java @@ -16,28 +16,34 @@ import com.pgms.coredomain.response.ApiResponse; import com.pgms.coresecurity.security.resolver.CurrentAccount; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; import lombok.RequiredArgsConstructor; @RestController @RequestMapping("/api/v1/seats") @RequiredArgsConstructor +@Tag(name = "좌석") public class SeatController { private final SeatService seatService; + @Operation(summary = "좌석 목록 조회") @GetMapping public ResponseEntity>> getSeats(@ModelAttribute @Valid SeatsGetRequest request) { ApiResponse> response = ApiResponse.ok(seatService.getSeats(request)); return ResponseEntity.ok().body(response); } + @Operation(summary = "좌석 선택") @PostMapping("/{seatId}/select") public ResponseEntity selectSeat(@PathVariable Long seatId, @CurrentAccount Long memberId) { seatService.selectSeat(seatId, memberId); return ResponseEntity.noContent().build(); } + @Operation(summary = "좌석 선택 해제") @PostMapping("/{seatId}/deselect") public ResponseEntity deselectSeat(@PathVariable Long seatId, @CurrentAccount Long memberId) { seatService.deselectSeat(seatId, memberId);