From ab0637e981ab4c85120ccde35ee24ec4abbe3e24 Mon Sep 17 00:00:00 2001
From: xin <1099200748@qq.com>
Date: Fri, 17 Oct 2025 17:20:15 +0800
Subject: [PATCH] Merge branch 'refs/heads/master' into xin
---
oying-system/src/main/java/com/oying/modules/pc/product/rest/ProductMerchantController.java | 30 ++++++++++++++++++++++--------
1 files changed, 22 insertions(+), 8 deletions(-)
diff --git a/oying-system/src/main/java/com/oying/modules/pc/product/rest/ProductMerchantController.java b/oying-system/src/main/java/com/oying/modules/pc/product/rest/ProductMerchantController.java
index 800f96f..1994fd3 100644
--- a/oying-system/src/main/java/com/oying/modules/pc/product/rest/ProductMerchantController.java
+++ b/oying-system/src/main/java/com/oying/modules/pc/product/rest/ProductMerchantController.java
@@ -7,10 +7,7 @@
import com.oying.annotation.Log;
import com.oying.modules.pc.product.domain.Product;
import com.oying.modules.pc.product.domain.ProductLabel;
-import com.oying.modules.pc.product.domain.dto.ProductImageCreateRequest;
-import com.oying.modules.pc.product.domain.dto.ProductMerchantCreateRequest;
-import com.oying.modules.pc.product.domain.dto.ProductMerchantUpdateRequest;
-import com.oying.modules.pc.product.domain.dto.ProductQueryCriteria;
+import com.oying.modules.pc.product.domain.dto.*;
import com.oying.modules.pc.product.service.ProductImageService;
import com.oying.modules.pc.product.service.ProductLabelService;
import com.oying.modules.pc.product.service.ProductMerchantService;
@@ -41,9 +38,6 @@
@Api(tags = "商品(商户端)")
@RequestMapping("/api/pc/merchant/store/{storeId}/product")
public class ProductMerchantController {
-
- private final int MAX_IMAGES = 5;
- private final int MAX_LABELS = 10;
private final ProductService productService;
private final ProductMerchantService productMerchantService;
@@ -98,7 +92,7 @@
public ResponseEntity<?> createProduct(@PathVariable Long storeId,
@Validated @RequestBody ProductMerchantCreateRequest request) {
request.setStoreId(ObjectUtils.defaultIfNull(request.getStoreId(), storeId));
- productMerchantService.create(request);
+ productMerchantService.createWithAudit(request);
return ResponseEntity.status(HttpStatus.CREATED).build();
}
@@ -114,6 +108,16 @@
return ResponseEntity.noContent().build();
}
+ @PutMapping(value = "/{productId}/price")
+ @Log("修改价格")
+ @ApiOperation("修改价格")
+ public ResponseEntity<?> updateProductPrice(@PathVariable Long productId,
+ @Validated @RequestBody ProductPriceUpdateRequest request) {
+ request.setProductId(ObjectUtils.defaultIfNull(request.getProductId(), productId));
+ productMerchantService.updatePrice(request);
+ return ResponseEntity.noContent().build();
+ }
+
@DeleteMapping
@Log("批量删除商品")
@ApiOperation("批量删除商品")
@@ -124,6 +128,16 @@
return ResponseEntity.noContent().build();
}
+ @PostMapping(value = "/delete")
+ @Log("批量删除商品")
+ @ApiOperation("批量删除商品")
+ //@PreAuthorize("@el.check('merchant:product:batchDel') " +
+ // "and @storeMerchantOwnershipService.check(#storeId)")
+ public ResponseEntity<?> delProduct(@ApiParam(value = "传ID数组[]") @RequestBody List<Long> ids) {
+ productMerchantService.batchDelete(ids);
+ return ResponseEntity.noContent().build();
+ }
+
@PutMapping(value = "/{productId}/on")
@Log("上架商品")
@ApiOperation("上架商品")
--
Gitblit v1.9.3