Просмотр исходного кода

fix(backend): 打破 memberSubscriptionService↔butlerService 循环依赖 - @Lazy 注入

Xiaogang Liao 3 недель назад
Родитель
Сommit
ef65175783
1 измененных файлов с 2 добавлено и 0 удалено
  1. 2 0
      cfc-backend/src/main/java/com/etotem/cfc/service/ButlerService.java

+ 2 - 0
cfc-backend/src/main/java/com/etotem/cfc/service/ButlerService.java

@@ -13,6 +13,7 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.annotation.Transactional;
 
 
 import javax.annotation.Resource;
 import javax.annotation.Resource;
+import org.springframework.context.annotation.Lazy;
 import java.util.Date;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.HashMap;
 import java.util.List;
 import java.util.List;
@@ -42,6 +43,7 @@ public class ButlerService {
     private ButlerAssignmentMapper butlerAssignmentMapper;
     private ButlerAssignmentMapper butlerAssignmentMapper;
 
 
     @Resource
     @Resource
+    @Lazy
     private MemberSubscriptionService memberSubscriptionService;
     private MemberSubscriptionService memberSubscriptionService;
 
 
     /**
     /**