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

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

In fact, the startup class did not scan the error file

Add annotations before the startup class

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

Guess you like

Origin blog.csdn.net/qq_45884783/article/details/123076575