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; }