set method in realizations

This commit is contained in:
2020-11-18 20:27:29 +06:00
parent dd2fc5a86f
commit fcacdcd544
6 changed files with 54 additions and 3 deletions

View File

@@ -42,12 +42,12 @@ class KtorWriteOneToManyKeyValueRepo<Key, Value> (
override suspend fun add(toAdd: Map<Key, List<Value>>) = client.unipost(
buildStandardUrl(
baseUrl,
clearRoute,
addRoute,
),
BodyPair(keyValueMapSerializer, toAdd),
Unit.serializer(),
)
override suspend fun clear(k: Key) = client.unipost(
override suspend fun clear(k: Key) = client.unipost(
buildStandardUrl(
baseUrl,
clearRoute,
@@ -55,4 +55,13 @@ class KtorWriteOneToManyKeyValueRepo<Key, Value> (
BodyPair(keySerializer, k),
Unit.serializer(),
)
override suspend fun set(toSet: Map<Key, List<Value>>) = client.unipost(
buildStandardUrl(
baseUrl,
setRoute,
),
BodyPair(keyValueMapSerializer, toSet),
Unit.serializer(),
)
}