import org.springframework.context.annotation.Lazy;
@Service
public class CService {
private AService aService; // 去掉@Autowired
// 采用构造器方式,加入Lazy注解
public CService(@Lazy AService aService) {
this.aService = aService;
}
}
标签:CService,Lazy,依赖,springboot,aService,public,循环,AService
From: https://www.cnblogs.com/yqcg/p/17695358.html