Skip to content

Commit

Permalink
[DOCS] cart, order controller 명세서 설명 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
05AM committed Dec 5, 2023
1 parent fd77555 commit 15a9b5d
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
}
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -8,9 +9,11 @@
@Getter
@NoArgsConstructor
public class CartItemReq {
@Schema(description = "스티커 Id")
@NotNull
private int stickerId;

@Schema(description = "스티커 수량")
@NotNull
@Min(1)
private int count;
Expand Down
Original file line number Diff line number Diff line change
@@ -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<CartCountReq> cartCountReqs;
}

0 comments on commit 15a9b5d

Please sign in to comment.