File tree Expand file tree Collapse file tree
apps/commerce-api/src/main/java/com/loopers/interfaces/api/product Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99@ Tag (name = "Product V1 API" , description = "Product API 입니다." )
1010public interface ProductV1ApiSpec {
1111 @ Operation (summary = "상품 등록" )
12- ApiResponse <ProductV1Dto .ProductResponse > registerProduct (ProductV1Dto .ProductRequest request );
12+ ApiResponse <ProductV1Dto .ProductResponse > registerProduct (ProductV1Dto .ProductRequest request );
1313
1414 @ Operation (summary = "상품 목록 조회" )
15- ApiResponse <List <ProductV1Dto .ProductResponse >> findAllProducts ();
15+ ApiResponse <List <ProductV1Dto .ProductResponse >> findAllProducts ();
1616
1717 @ Operation (summary = "상품 상세 조회" )
18- ApiResponse <ProductV1Dto .ProductResponse > findProductById (Long id );
18+ ApiResponse <ProductV1Dto .ProductResponse > findProductById (Long id );
1919
2020 @ Operation (summary = "상품 정렬 조회" )
21- ApiResponse <List <ProductV1Dto .ProductResponse >> findProductsBySortCondition (ProductV1Dto .SearchProductRequest request );
21+ ApiResponse <List <ProductV1Dto .ProductResponse >> findProductsBySortCondition (ProductV1Dto .SearchProductRequest request );
22+
23+ @ Operation (summary = "상품 가격 변경" )
24+ ApiResponse <ProductV1Dto .ProductResponse > changePrice (ProductV1Dto .ChangePriceRequest request );
25+
2226}
Original file line number Diff line number Diff line change @@ -60,4 +60,14 @@ public ApiResponse<List<ProductV1Dto.ProductResponse>> findProductsBySortConditi
6060
6161 return ApiResponse .success (responses );
6262 }
63+
64+ @ PostMapping ("/change" )
65+ @ Override
66+ public ApiResponse <ProductV1Dto .ProductResponse > changePrice (@ RequestBody ProductV1Dto .ChangePriceRequest request ) {
67+ ProductInfo info = productFacade .changePrice (request );
68+
69+ ProductV1Dto .ProductResponse response = ProductV1Dto .ProductResponse .from (info );
70+
71+ return ApiResponse .success (response );
72+ }
6373}
Original file line number Diff line number Diff line change @@ -54,4 +54,7 @@ public void conditionValidate() {
5454 }
5555 }
5656 }
57+
58+ public record ChangePriceRequest (Long id , BigDecimal newPrice ) {
59+ }
5760}
You can’t perform that action at this time.
0 commit comments