Skip to content

Commit

Permalink
feat(api): get all publishers
Browse files Browse the repository at this point in the history
  • Loading branch information
gotson committed Aug 25, 2020
1 parent 28598cb commit 1929061
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ interface ReferentialRepository {
fun findAllGenres(): Set<String>
fun findAllTags(): Set<String>
fun findAllLanguages(): Set<String>
fun findAllPublishers(): Set<String>
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,11 @@ class ReferentialDao(
.from(sd)
.orderBy(sd.LANGUAGE)
.fetchSet(sd.LANGUAGE)

override fun findAllPublishers(): Set<String> =
dsl.selectDistinct(sd.PUBLISHER)
.from(sd)
.where(sd.PUBLISHER.ne(""))
.orderBy(sd.PUBLISHER)
.fetchSet(sd.PUBLISHER)
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,8 @@ class ReferentialController(
@GetMapping("/languages")
fun getLanguages(): Set<String> =
referentialRepository.findAllLanguages()

@GetMapping("/publishers")
fun getPublishers(): Set<String> =
referentialRepository.findAllPublishers()
}

0 comments on commit 1929061

Please sign in to comment.