Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
class ArticleController(private val repository: ArticleRepository) {
fun findAll() = repository.findAllByOrderByAddedAtDesc()
fun findOne(@PathVariable id: UUID) =
repository.findBySlug(slug) ?: ResponseStatusException(HttpStatus.NOT_FOUND, "This article does not exist")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment