摘要: 条件装配:满足Conditional指定的条件,则进行组件注入 @Configuration//告诉springboot这是一个配置类 public class MyConfig { @Bean("tom") public Stu stu01(){ return new Stu("汤姆"); } @ 阅读全文
posted @ 2022-09-18 22:54 Mr_sven 阅读(28) 评论(0) 推荐(0) 编辑
摘要: import boot.bean.Stu; import boot.bean.User; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configu 阅读全文
posted @ 2022-09-18 17:16 Mr_sven 阅读(27) 评论(0) 推荐(0) 编辑