Type mismatch: cannot convert from PageRequest to SpringDataWebProperties.Pageable;
The method findAll(Sort) in the type JpaRepository<Topico,Long> is not applicable for the arguments (SpringDataWebProperties.Pageable);
The method findByCursoNome(String, Pageable) in the type TopicoRepository is not applicable for the arguments (String, SpringDataWebProperties.Pageable)
@GetMapping public Page lista(@RequestParam(required = false) String nomeCurso, @RequestParam int pagina, @RequestParam int qtd){
Pageable paginacao = PageRequest.of(pagina, qtd);
if (nomeCurso == null) {
Page<Topico> topicos = topicoRepository.findAll(paginacao);
return TopicoDto.converter(topicos);
} else {
Page<Topico> topicos = topicoRepository.findByCursoNome(nomeCurso, paginacao);
return TopicoDto.converter(topicos);
}
}