Consider defining a bean of type ‘com.moshang.msmall.service.UserService’ in your configuration.

其实是启动类没有扫描到报错这个文件

在启动类前加上注解

@MapperScan("com.moshang.msmall.dao")
@SpringBootApplication(scanBasePackages ="com.moshang")

更多推荐

Spring Boot 报错:Consider defining a bean of type ‘com.UserService‘ in your config