Field userDAO in com.evan.wj.service.UserService required a bean of type 'com.evan.wj.dao.UserDao' that could not be found.
The injection point has the following annotations:
- @org.springframework.beans.factory.annotation.Autowired(required=true)
出现该问题,是由于springboot扫描没有发现dao层的类。需要在springboot启动类下加上注解@ComponentScan(basePackages = {"com.evan.wj.dao"})括号内是需要扫描的包。不需要在dao上加@mappers注解,我试了,没有用。