SpringBoot框架 @Service 是springboot纳入容器管理的注解, 要在其他类中注入必须要@Repository、@Service 和 @Controller @Component这些注解,否则就只是一个普通的类。 @Service @Repository @Controller @Component