spring boot 報錯Could not autowire. No beans of 'BookMapper' type found. less... (Ctrl+F1)

最近使用spring boot+mybatis時出現了這個錯誤; 看IDEA的提示是這個mapper接口沒有被注入,不是一個bean,看百度很多人都說是在IDEA中降低提示級別,這種方法只能讓你看不到報紅,熟悉@Autowired註解就知道怎麼解決了, 我們在mapper接口上添加@Component註解,然後就沒問題了:
相關文章
相關標籤/搜索