From 02fb5e406abcda2534ed1f2505c5226027c13473 Mon Sep 17 00:00:00 2001 From: zepengdev <lzpsmith@outlook.com> Date: Mon, 23 Jun 2025 00:57:32 +0800 Subject: [PATCH] fix:调整字段 --- oying-system/src/main/java/com/oying/modules/pc/product/rest/ProductController.java | 16 +++++++++------- 1 files changed, 9 insertions(+), 7 deletions(-) diff --git a/oying-system/src/main/java/com/oying/modules/pc/product/rest/ProductController.java b/oying-system/src/main/java/com/oying/modules/pc/product/rest/ProductController.java index 7f42839..035c778 100644 --- a/oying-system/src/main/java/com/oying/modules/pc/product/rest/ProductController.java +++ b/oying-system/src/main/java/com/oying/modules/pc/product/rest/ProductController.java @@ -16,7 +16,6 @@ import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import lombok.RequiredArgsConstructor; -import org.apache.commons.lang3.ObjectUtils; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -52,6 +51,13 @@ // @PreAuthorize("@el.check('product:list')") public ResponseEntity<?> getProducts(ProductQueryCriteria criteria) { return ResponseEntity.ok(R.success(productService.queryAll(criteria))); + } + + @GetMapping(value = "/batch") + @ApiOperation("查询商品(批量)") + // @PreAuthorize("@el.check('product:list')") + public ResponseEntity<?> getProductsByIds(@RequestParam(value = "ids") List<Long> ids) { + return ResponseEntity.ok(R.success(productService.listByIds(ids))); } @GetMapping(value = "/page") @@ -104,9 +110,7 @@ @Log("新增商品") @ApiOperation("新增商品") //@PreAuthorize("@el.check('merchant:product:add')") - public ResponseEntity<?> createProduct(@PathVariable Long storeId, - @Validated @RequestBody ProductMerchantCreateRequest request) { - request.setStoreId(ObjectUtils.defaultIfNull(request.getStoreId(), storeId)); + public ResponseEntity<?> createProduct(@Validated @RequestBody ProductMerchantCreateRequest request) { productAdminService.create(request); return ResponseEntity.noContent().build(); } @@ -115,9 +119,7 @@ @Log("修改商品") @ApiOperation("修改商品") // @PreAuthorize("@el.check('product:edit')") - public ResponseEntity<?> updateProduct(@PathVariable Long productId, - @Validated @RequestBody ProductMerchantUpdateRequest request) { - request.setProductId(ObjectUtils.defaultIfNull(request.getProductId(), productId)); + public ResponseEntity<?> updateProduct(@Validated @RequestBody ProductMerchantUpdateRequest request) { productAdminService.update(request); return ResponseEntity.noContent().build(); } -- Gitblit v1.9.3