实现类的注册方法
1.抽象类 @Qualifier 指定绑定的注册类
@Autowired @Qualifier("professionOrderSendEmailImpl") private SendBiDataService<ProfessionOrderEntity> sendBiDataService;
2.实现类
@Autowired
ProfessionOrderSendEmailImpl professionOrderSendEmailImpl;
3.都注册成功啦,服务启动打印Bean日志查看:
2024-03-27 12:06:12.322 [Thread-57][orderCoreApi,,,] INFO c.a.o.c.j.ProfessionOrderSendEmailTask#execute [line:51] - bean注册(实现类方式) professionOrderSendEmailImpl=com.mytest.service.bi.ProfessionOrderSendEmailImpl@2bae8dff
2024-03-27 12:06:12.322 [Thread-57][orderCoreApi,,,] INFO c.a.o.c.j.ProfessionOrderSendEmailTask#execute [line:63] - bean注册(绑定抽象类方式) sendBiDataService=com.mytest.service.bi.ProfessionOrderSendEmailImpl@2bae8dff