一、根据配置值决定实现的bean
//当配置文件 user.enable=1时才会创建bean,否则不会创建
@ConditionalOnProperty(prefix = "user", name = "enable",havingValue = "1")
二、默认bean,存在其他的则不实现
@Bean
@ConditionalOnMissingBean
public HomeService defaultHomeService(){
HomeServiceImpl homeService=new HomeServiceImpl();
return homeService;
}