1、SpringBoot 程序,每个类应该有一个包,没有包的话会出现问题;
2、一个合理的包结构:
3、我们通常建议您将主应用程序类放在其他类之上的根包中,主类上需要有一个@SpringBootApplication注解,默认是扫描当前包及子类下的标有@Component,
@Service, @Repository, @Controller等注解的bean;
4、如果main类上不使用@SpringBootApplication注解,可以使用@EnableAutoConfiguration、@ComponentScan、@Configuration
注解代替;
@SpringBootApplication是一个组合注解,是由@SpringBootConfiguration @EnableAutoConfiguration @Com