多个控制器需要运行时,需要添加扫包操作
@ComponentScan(basePackages = "com.itmayiedu.controller")
@EnableAutoConfiguration
public class App {
public static void main(String[] args) {
SpringApplication.run(App.class, args);
}
}
@ComponentScan(basePackages = "com.itmayiedu.controller")---控制器扫包范围 需要运行的控制器所对应的包