You've already forked FrameTour-BE
refactor(core): 添加 Lazy 注解解决循环依赖问题
- 在多个 Service 类中为注入的依赖添加 @Lazy 注解 - 修改了微信支付服务实现类中的依赖注入方式 - 更新了打印机服务实现类中的依赖注入配置 - 调整了统计拦截器和服务类中的依赖注入策略 - 优化了 FaceService 和相关 Repository 的注入方式 - 防止应用启动时因循环依赖导致的初始化失败
This commit is contained in:
@@ -119,29 +119,37 @@ public class PrinterServiceImpl implements PrinterService {
|
||||
@Lazy
|
||||
private OrderBiz orderBiz;
|
||||
@Autowired
|
||||
@Lazy
|
||||
private WxPayService wxPayService;
|
||||
@Autowired
|
||||
private PrintTaskMapper printTaskMapper;
|
||||
@Autowired
|
||||
@Lazy
|
||||
private IPriceCalculationService priceCalculationService;
|
||||
@Autowired
|
||||
@Lazy
|
||||
private IAutoCouponService autoCouponService;
|
||||
@Autowired
|
||||
@Lazy
|
||||
private ScenicRepository scenicRepository;
|
||||
@Autowired
|
||||
@Lazy
|
||||
private OrderRepository orderRepository;
|
||||
@Autowired
|
||||
private FaceSampleMapper faceSampleMapper;
|
||||
@Autowired
|
||||
private FaceMapper faceMapper;
|
||||
@Autowired
|
||||
@Lazy
|
||||
private FaceRepository faceRepository;
|
||||
@Lazy
|
||||
@Autowired
|
||||
private FaceService faceService;
|
||||
@Autowired
|
||||
@Lazy
|
||||
private DeviceRepository deviceRepository;
|
||||
@Autowired
|
||||
@Lazy
|
||||
private PrinterTaskPushService taskPushService;
|
||||
|
||||
// 用于优先打印的线程池,核心线程数根据实际情况调整
|
||||
|
||||
Reference in New Issue
Block a user