org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘loginController’: Unsatisfied dependency expressed through field ‘userService’;
解决办法:
检查启动类是否加上如下注解:
@MapperScan(basePackages = {“com.xx.xx.mapper”}, markerInterface = BaseMapper.class)
@ComponentScan(basePackages = {“com.xx.xx”})
@SpringBootApplication(exclude= {DataSourceAutoConfiguration.class})
-
检查service的实现类上是否加上了注解 @Service
-
检查mapper接口类上面是否加了注解:@Mapper