我在Controller中写了如下代码

Could not autowire. No beans of


但我明明写了

Could not autowire. No beans of


然后我进入代码中看了下

Could not autowire. No beans of


发现其类上没有写@Service,写上就完事了

Could not autowire. No beans of


错误也不见了

Could not autowire. No beans of


其原因是它们不在同一个包下,所以一定要写上

Could not autowire. No beans of