Make sure that your main class is in a root package above other classes.
When you run a Spring Boot Application, (i.e. a class annotated with @SpringBootApplication), Spring will only scan the classes below your main class package.
com
+- APP
+- Application.java <--- your main class should be here, above your controller classes
|
+- model
| +- user.java
+- controller
+- UserController.java
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…