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/service/ProductInventoryService.java | 43 +++++++++++++++++++++++++++++++++++++++----
1 files changed, 39 insertions(+), 4 deletions(-)
diff --git a/oying-system/src/main/java/com/oying/modules/pc/product/service/ProductInventoryService.java b/oying-system/src/main/java/com/oying/modules/pc/product/service/ProductInventoryService.java
index c425722..a805c15 100644
--- a/oying-system/src/main/java/com/oying/modules/pc/product/service/ProductInventoryService.java
+++ b/oying-system/src/main/java/com/oying/modules/pc/product/service/ProductInventoryService.java
@@ -3,9 +3,44 @@
import com.oying.modules.pc.product.domain.Product;
public interface ProductInventoryService {
- Product getProductById(Long id);
- Product setStockQuantity(Long product, Integer quantity, Long version);
- Product increaseStock(Long product, Integer amount);
- Product decreaseStock(Long product, Integer amount);
+
+ /**
+ * 获取商品信息
+ * @param productId 商品ID
+ * @return Product
+ */
+ Product getProductById(Long productId);
+
+ /**
+ * 设置库存数量
+ * @param productId 商品ID
+ * @param quantity 库存数量
+ * @param version 版本号
+ * @return Product
+ */
+ Product setStockQuantity(Long productId, Integer quantity, Long version);
+
+ /**
+ * 增加库存
+ * @param productId 商品ID
+ * @param amount 库存数量
+ * @return Product
+ */
+ Product increaseStock(Long productId, Integer amount);
+
+ /**
+ * 减少库存
+ * @param productId 商品ID
+ * @param amount 库存数量
+ * @return Product
+ */
+ Product decreaseStock(Long productId, Integer amount);
+
+ /**
+ * 库存是否足够
+ * @param productId 商品ID
+ * @param requiredAmount 库存数量
+ * @return true Or false
+ */
boolean isStockSufficient(Long productId, Integer requiredAmount);
}
--
Gitblit v1.9.3