@SpringBootApplication注解是SpringBoot的灵魂注解
这个注解整合了3个注解的特性:分别是@Configuration注解、@Component注解、@EnableAutoConfiguration注解。这个三个注解的作用分别是:
- @Configuration注解:声明当前类为配置类
- @ComponentScan注解:指定扫描包路径,默认不填扫描当前包及其子包
- @EnableAutoConfiguration注解:最重要注解没有之一,打开SpringBoot的自