具体报错信息

Description: Field repository in com.imooc.luckymoney.LuckymoneyController required a bean of type ‘

解决办法

创建一个class类实现该接口,并在该类上加一个@Configuration的注解
Description: Field repository in com.imooc.luckymoney.LuckymoneyController required a bean of type ‘

修改后运行结果

Description: Field repository in com.imooc.luckymoney.LuckymoneyController required a bean of type ‘

思路

上实验楼找springboot课程的时候看到其中讲配置文件的那一章有跟自己类似的代码,所以就模仿了一下,没想到成功了,但是没想明白为啥,希望有大神看到可以讲解一下!!!灰常感谢!
Description: Field repository in com.imooc.luckymoney.LuckymoneyController required a bean of type ‘
-2020年10月11日

相关文章: