alem de não esta senho reconecida, tambem nao esta retonadno o Bd
@Service
class TopicoService(
private val repository: TopicoRepository,
private val topicoViewMapper: TopicoViewMapper,
private val topicoFormMapper: TopicoFormMapper,
private val notFoundMessage: String = "Dados nao encontrado!"
) {
fun listar(
nomeCurso: String?,
paginacao: Pageable
): Page<TopicoView> {
val topicos = if (nomeCurso == null) {
repository.findAll(paginacao)
} else {
repository.findByCursoNome(nomeCurso, paginacao)
}
return topicos.map { t ->
topicoViewMapper.map(t)
}
}
fun buscarPorId(id: Long): TopicoView {
val topico = repository.findById(id)
.orElseThrow{NotFoundException(notFoundMessage)}
return topicoViewMapper.map(topico)
}
fun cadastrar(form: TopicoForm): TopicoView {
val topico = topicoFormMapper.map(form)
repository.save(topico)
return topicoViewMapper.map(topico)
}
fun atualizar(form: AtualizacaoTopicoForm): TopicoView {
val topico = repository.findById(form.id)
.orElseThrow{NotFoundException(notFoundMessage)}
topico.titulo = form.titulo
topico.mensagem = form.mensagem
return topicoViewMapper.map(topico)
}
fun deletar(id: Long) {
repository.deleteById(id)
}
}
pegui o codigo do git da aula anterio porem rodou normal , mais , não rodou o Bd ,
apos da um build no rpojeto vem o seguite erro ..
C:\forum\src\main\kotlin\br\com\alura\forum\service\TopicoService.kt:31:24
Kotlin: None of the following functions can be called with the arguments supplied:
public abstract fun <S : Topico!> findAll(p0: Example<TypeVariable(S)!>): (Mutable)List<TypeVariable(S)!> defined in br.com.alura.forum.repository.TopicoRepository
public abstract fun findAll(p0: Pageable): Page<Topico!> defined in br.com.alura.forum.repository.TopicoRepository
public abstract fun findAll(p0: Sort): (Mutable)List<Topico!> defined in br.com.alura.forum.repository.TopicoRepository
C:\forum\src\main\kotlin\br\com\alura\forum\service\TopicoService.kt:33:51
Kotlin: Type mismatch: inferred type is java.awt.print.Pageable but org.springframework.data.domain.Pageable was expected
Kotlin: Language version 1.4 is deprecated and its support will be removed in a future version of Kotlin