Przeglądaj źródła

fix(backend): 打破 ProductService↔NutritionProductService 循环依赖(NutritionProductService 改走 productMapper.selectById,与 a2e208687 同向修复)

Xiaogang Liao 1 tydzień temu
rodzic
commit
05cfaf2de2

+ 1 - 4
cfc-backend/src/main/java/com/etotem/cfc/service/NutritionProductService.java

@@ -39,9 +39,6 @@ public class NutritionProductService {
     private NutritionProductReviewMapper reviewMapper;
 
 
-    @Resource
-    private ProductService productService;
-
 
     @Resource
     private NutritionUlLimitMapper ulLimitMapper;
@@ -266,7 +263,7 @@ public class NutritionProductService {
      * @return true=成功/已存在, false=主商品不存在
      */
     public boolean addNutritionProductFromProduct(Long productId) {
-        Product product = productService.getById(productId);
+        Product product = productMapper.selectById(productId);
         if (product == null) {
             log.warn("主平台商品不存在,ID: {}", productId);
             return false;