From 15a9b5d49ab78987931169ff026145b83ad0ffd2 Mon Sep 17 00:00:00 2001 From: Lee ChanMi Date: Wed, 6 Dec 2023 03:26:15 +0900 Subject: [PATCH] =?UTF-8?q?[DOCS]=20cart,=20order=20controller=20=EB=AA=85?= =?UTF-8?q?=EC=84=B8=EC=84=9C=20=EC=84=A4=EB=AA=85=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../server/domain/cart/controller/CartController.java | 4 ++-- .../domain/cart/controller/dto/request/CartCountReq.java | 8 ++++++++ .../domain/cart/controller/dto/request/CartItemReq.java | 3 +++ .../cart/controller/dto/request/UpdateCartCountReq.java | 3 +++ 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/server/src/main/java/org/tattour/server/domain/cart/controller/CartController.java b/server/src/main/java/org/tattour/server/domain/cart/controller/CartController.java index 665820a..1f80049 100644 --- a/server/src/main/java/org/tattour/server/domain/cart/controller/CartController.java +++ b/server/src/main/java/org/tattour/server/domain/cart/controller/CartController.java @@ -115,7 +115,7 @@ public ResponseEntity getUserCartItem( @PatchMapping public ResponseEntity updateCartCount( @Parameter(hidden = true) @UserId Integer userId, - @RequestBody UpdateCartCountReq req) { + @RequestBody @Valid UpdateCartCountReq req) { cartFacade.updateCartsCount(userId, req); return BaseResponse.success(SuccessType.UPDATE_SUCCESS); } @@ -142,7 +142,7 @@ public ResponseEntity updateCartCount( @DeleteMapping("/{cartId}") public ResponseEntity deleteCartCount( @Parameter(hidden = true) @UserId Integer userId, - @PathVariable Integer cartId) { + @Parameter(description = "장바구니 Id") @PathVariable Integer cartId) { cartFacade.deleteCartItem(userId, cartId); return BaseResponse.success(SuccessType.DELETE_SUCCESS); } diff --git a/server/src/main/java/org/tattour/server/domain/cart/controller/dto/request/CartCountReq.java b/server/src/main/java/org/tattour/server/domain/cart/controller/dto/request/CartCountReq.java index 584dbf7..1ece005 100644 --- a/server/src/main/java/org/tattour/server/domain/cart/controller/dto/request/CartCountReq.java +++ b/server/src/main/java/org/tattour/server/domain/cart/controller/dto/request/CartCountReq.java @@ -1,9 +1,17 @@ package org.tattour.server.domain.cart.controller.dto.request; +import io.swagger.v3.oas.annotations.media.Schema; +import javax.validation.constraints.NotNull; import lombok.Getter; +@Schema(description = "장바구니 수량 수정 Request") @Getter public class CartCountReq { + @Schema(description = "장바구니 Id") + @NotNull(message = "장바구니 id는 null일 수 없습니다.") private int cartId; + + @Schema(description = "장바구니 수량") + @NotNull(message = "장바구니 수량 null일 수 없습니다.") private int count; } diff --git a/server/src/main/java/org/tattour/server/domain/cart/controller/dto/request/CartItemReq.java b/server/src/main/java/org/tattour/server/domain/cart/controller/dto/request/CartItemReq.java index 947c959..8333245 100644 --- a/server/src/main/java/org/tattour/server/domain/cart/controller/dto/request/CartItemReq.java +++ b/server/src/main/java/org/tattour/server/domain/cart/controller/dto/request/CartItemReq.java @@ -1,5 +1,6 @@ package org.tattour.server.domain.cart.controller.dto.request; +import io.swagger.v3.oas.annotations.media.Schema; import javax.validation.constraints.Min; import javax.validation.constraints.NotNull; import lombok.Getter; @@ -8,9 +9,11 @@ @Getter @NoArgsConstructor public class CartItemReq { + @Schema(description = "스티커 Id") @NotNull private int stickerId; + @Schema(description = "스티커 수량") @NotNull @Min(1) private int count; diff --git a/server/src/main/java/org/tattour/server/domain/cart/controller/dto/request/UpdateCartCountReq.java b/server/src/main/java/org/tattour/server/domain/cart/controller/dto/request/UpdateCartCountReq.java index 0c22765..e11f0ad 100644 --- a/server/src/main/java/org/tattour/server/domain/cart/controller/dto/request/UpdateCartCountReq.java +++ b/server/src/main/java/org/tattour/server/domain/cart/controller/dto/request/UpdateCartCountReq.java @@ -1,9 +1,12 @@ package org.tattour.server.domain.cart.controller.dto.request; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.List; import lombok.Getter; +@Schema(description = "장바구니 수량 일괄 수정 Request") @Getter public class UpdateCartCountReq { + @Schema(description = "장바구니 수량 수정 Request 목록") private List cartCountReqs; }