springboot 使用@Autowired注入Mapper 报错

起因:

idea的检查spring bean的机制,并不影响运行和使用,但是看着特别碍眼。

解决:

网上搜索发现很多办法都是去setting中进行设置,但是过程繁琐,不容易被记住;

其实只要在Mapper接口上加上@Component注解,就可以了

完美解决。

猜你喜欢

转载自blog.csdn.net/inflaRunAs/article/details/86597547