Springboot ,1开启配置与2.扫描包(控制层,service层)二个注解@EnableAutoConfiguration,@ComponentScan 合并成一个注解@SpringBootApplication

//@EnableAutoConfiguration
//@ComponentScan(value= {"com.foen.cloud.controller.*","com.foen.cloud.service.impl"})
@SpringBootApplication(scanBasePackages= {"com.foen.cloud.controller.*","com.foen.cloud.service.impl"})

@SpringBootApplication(@EnableAutoConfiguration,ComponentScan)

原文地址:https://www.cnblogs.com/gzhbk/p/9692782.html