mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2025-10-22 15:50:34 +00:00
getAll
This commit is contained in:
@@ -5,6 +5,7 @@ import dev.inmo.micro_utils.pagination.*
|
||||
import dev.inmo.micro_utils.repos.ReadCRUDRepo
|
||||
import dev.inmo.micro_utils.repos.ktor.common.countRouting
|
||||
import dev.inmo.micro_utils.repos.ktor.common.crud.*
|
||||
import dev.inmo.micro_utils.repos.ktor.common.getAllRoute
|
||||
import dev.inmo.micro_utils.repos.ktor.common.idParameterName
|
||||
import io.ktor.client.HttpClient
|
||||
import io.ktor.client.call.body
|
||||
@@ -58,6 +59,15 @@ class KtorReadCRUDRepoClient<ObjectType, IdType> (
|
||||
contentType(contentType)
|
||||
}.body()
|
||||
|
||||
override suspend fun getAll(): Map<IdType, ObjectType> = httpClient.get(
|
||||
buildStandardUrl(
|
||||
baseUrl,
|
||||
getAllRoute
|
||||
)
|
||||
) {
|
||||
contentType(contentType)
|
||||
}.body()
|
||||
|
||||
override suspend fun count(): Long = httpClient.get(
|
||||
buildStandardUrl(
|
||||
baseUrl,
|
||||
|
@@ -48,6 +48,15 @@ class KtorReadKeyValueRepoClient<Key, Value>(
|
||||
contentType(contentType)
|
||||
}.body()
|
||||
|
||||
override suspend fun getAll(): Map<Key, Value> = httpClient.get(
|
||||
buildStandardUrl(
|
||||
baseUrl,
|
||||
getAllRoute
|
||||
)
|
||||
) {
|
||||
contentType(contentType)
|
||||
}.body()
|
||||
|
||||
override suspend fun values(
|
||||
pagination: Pagination,
|
||||
reversed: Boolean
|
||||
|
Reference in New Issue
Block a user