1.百度不知道多久,大部分教程都试了,实在无解。给大伙猜猜坑。仅供参考不喜勿喷
2.报的错
3.解决办法,代码参考
controller层
UserService接口
最重要的,我一直忽视掉,前两步做完之后,还是会报另一个错误
No qualifying bean of type 'com.fang.bs.service.UserService' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
UserServiceImpl实现
再次运行成功