今天碰到了映射的问题:
Description: Field commentMapper in zero.file.videoProject.controller.CommentController required a bean of type 'zero.file.videoProject.mappers.CommentMapper' that could not be found. The injection point has the following annotations: - @org.springframework.beans.factory.annotation.Autowired(required=true) Action: Consider defining a bean of type 'zero.file.videoProject.mappers.CommentMapper' in your configuration.
英文翻译:
描述: zero . file . video project . controller . comment controller中的字段commentMapper需要一个类型为“zero . file . video project . mappers . comment mapper”的bean,但找不到该bean。 注入点有以下注释: -@ org . spring framework . beans . factory . annotation . auto wired(required = true) 行动: 请考虑在您的配置中定义一个“zero . file . video project . mappers . comment mapper”类型的bean。
解决问题方法,在springBoot的初始化页面中,就是Application这个文件,添加一个注解:
找到你的mappers映射文件路径,点击CopyPath
在springBoot添加一句这个,这个包的位置是你自己mappers映射的路
@MapperScan("zero.file.videoProject.mappers")
重新启动就好了