mirror of
https://github.com/gotson/komga.git
synced 2025-12-21 16:03:03 +01:00
feat(api): get all publishers
This commit is contained in:
parent
28598cbef5
commit
1929061393
3 changed files with 12 additions and 0 deletions
|
|
@ -5,4 +5,5 @@ interface ReferentialRepository {
|
|||
fun findAllGenres(): Set<String>
|
||||
fun findAllTags(): Set<String>
|
||||
fun findAllLanguages(): Set<String>
|
||||
fun findAllPublishers(): Set<String>
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,4 +31,8 @@ class ReferentialController(
|
|||
@GetMapping("/languages")
|
||||
fun getLanguages(): Set<String> =
|
||||
referentialRepository.findAllLanguages()
|
||||
|
||||
@GetMapping("/publishers")
|
||||
fun getPublishers(): Set<String> =
|
||||
referentialRepository.findAllPublishers()
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue