After some configuration, I can’t use the service layer in my Spring Boot. This is my src
in the control layer:
I can’t use the last URL to access my data, but the first two URLs are accessible
@RestController public class hello {
@Autowired
private ArticleMapper articleMapper;
@GetMapping("/getall")
public List<Article> getAllArticles() {
return articleMapper.find();
}
@GetMapping("/getArticle/{id}")
public Article getArticleById(@PathVariable Long id) {
return articleMapper.findById(id);
}
@Autowired
private ArticleService articleService;
@GetMapping("/test")
public List<Article> test() {
return articleService.list();
}
}
This is the error info:
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.blog.blogend.mapper.ArticleMapper.selectList`
How can I access my service layer?
New contributor
zhong nagisa is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
3