77import org .springframework .data .domain .Sort ;
88import org .springframework .format .annotation .DateTimeFormat ;
99import org .springframework .security .core .annotation .AuthenticationPrincipal ;
10+ import org .springframework .web .bind .annotation .DeleteMapping ;
1011import org .springframework .web .bind .annotation .GetMapping ;
1112import org .springframework .web .bind .annotation .PatchMapping ;
1213import org .springframework .web .bind .annotation .PathVariable ;
@@ -83,7 +84,7 @@ public DataResponse<OrderHistoryResponse> getOrderHistory(
8384 @ PostMapping
8485 @ Operation (
8586 summary = "상품 화면에서 바로 상품 주문" ,
86- description = "장바구니를 거치지 않고 개별 상품을 즉시 주문합니다. 성공 시 생성된 주문 ID(orderId)를 반환합니다."
87+ description = "장바구니를 거치지 않고 개별 상품을 즉시 주문합니다. 성공 시 생성된 주문 ID(orderId)를 반환합니다. 토큰 필요 "
8788 )
8889 public DataResponse <Long > createOrder (
8990 @ AuthenticationPrincipal Long userId , @ RequestBody @ Valid OrderCreateRequest request
@@ -97,7 +98,7 @@ public DataResponse<Long> createOrder(
9798 summary = "장바구니 상품 주문" ,
9899 description = "장바구니에서 선택한 하나 이상의 상품들을 한 번에 주문합니다. " +
99100 "cartItemIds 필드에 장바구니 항목 ID 리스트(예: [3, 4])를 담아 보냅니다. " +
100- "성공 시 생성된 주문 ID(orderId)를 반환하며, 해당 장바구니 항목들은 삭제됩니다."
101+ "성공 시 생성된 주문 ID(orderId)를 반환하며, 해당 장바구니 항목들은 삭제됩니다. 토큰 필요 "
101102 )
102103 public DataResponse <Long > createOrderFromCart (
103104 @ AuthenticationPrincipal Long userId , @ RequestBody @ Valid CartOrderRequest request
@@ -107,7 +108,7 @@ public DataResponse<Long> createOrderFromCart(
107108 }
108109
109110 @ GetMapping ("/{orderId}" )
110- @ Operation (summary = "주문 상세 조회" , description = "orderId를 통한 주문 상세 조회" )
111+ @ Operation (summary = "주문 상세 조회" , description = "orderId를 통한 주문 상세 조회. 토큰 필요 " )
111112 public DataResponse <OrderDetailResponse > getOrderDetail (
112113 @ AuthenticationPrincipal Long userId , @ PathVariable Long orderId
113114 ) {
@@ -139,6 +140,18 @@ public DataResponse<OrderCancelResponse> cancelOrder(
139140 return DataResponse .from (orderService .cancelOrder (userId , orderId , request ));
140141 }
141142
143+ @ DeleteMapping ("/{orderId}" )
144+ @ Operation (
145+ summary = "주문 내역 삭제" ,
146+ description = "주문 내역을 삭제합니다. 구매 확정 또는 취소된 주문만 삭제 가능합니다. 토큰 필요"
147+ )
148+ public DataResponse <String > deleteOrder (
149+ @ AuthenticationPrincipal Long userId , @ PathVariable Long orderId
150+ ) {
151+ orderService .deleteOrder (userId , orderId );
152+ return DataResponse .from ("주문 내역이 삭제되었습니다." );
153+ }
154+
142155 @ PatchMapping ("/{orderId}/delivery-address" )
143156 @ Operation (
144157 summary = "주문 배송지 변경" ,
0 commit comments