upfixes
This commit is contained in:
parent
626edccc7d
commit
8a4934a65a
@ -15,12 +15,12 @@ class ReadPublishingKeysRepoKtorClient (
|
|||||||
private val client: HttpClient = HttpClient()
|
private val client: HttpClient = HttpClient()
|
||||||
) : ReadPublishingKeysRepo {
|
) : ReadPublishingKeysRepo {
|
||||||
override suspend fun getPostIdByTriggerControlKey(key: TriggerControlKey): PostId? = client.uniget(
|
override suspend fun getPostIdByTriggerControlKey(key: TriggerControlKey): PostId? = client.uniget(
|
||||||
"$baseUrl/$getPostIdByTriggerControlKeyRoute",
|
"$baseUrl/$getPostIdByTriggerControlKeyRoute/$key",
|
||||||
PostId.serializer().nullable
|
PostId.serializer().nullable
|
||||||
)
|
)
|
||||||
|
|
||||||
override suspend fun getTriggerControlKeyByPostId(postId: PostId): TriggerControlKey? = client.uniget(
|
override suspend fun getTriggerControlKeyByPostId(postId: PostId): TriggerControlKey? = client.uniget(
|
||||||
"$baseUrl/$getTriggerControlKeyByPostIdRoute",
|
"$baseUrl/$getTriggerControlKeyByPostIdRoute/$postId",
|
||||||
TriggerControlKey.serializer().nullable
|
TriggerControlKey.serializer().nullable
|
||||||
)
|
)
|
||||||
}
|
}
|
@ -1,5 +1,7 @@
|
|||||||
package com.insanusmokrassar.postssystem.publishing.ktor
|
package com.insanusmokrassar.postssystem.publishing.ktor
|
||||||
|
|
||||||
|
const val publishingKeysRootRoute = "publishingKeys"
|
||||||
|
|
||||||
const val getPostIdByTriggerControlKeyRoute = "getPostIdByTriggerControlKey"
|
const val getPostIdByTriggerControlKeyRoute = "getPostIdByTriggerControlKey"
|
||||||
const val getTriggerControlKeyByPostIdRoute = "getTriggerControlKeyByPostId"
|
const val getTriggerControlKeyByPostIdRoute = "getTriggerControlKeyByPostId"
|
||||||
|
|
||||||
|
@ -2,13 +2,17 @@ package com.insanusmokrassar.postssystem.publishing.ktor.server
|
|||||||
|
|
||||||
import com.insanusmokrassar.postssystem.core.publishing.repos.PublishingKeysRepo
|
import com.insanusmokrassar.postssystem.core.publishing.repos.PublishingKeysRepo
|
||||||
import com.insanusmokrassar.postssystem.ktor.server.configurators.ApplicationRoutingConfigurator
|
import com.insanusmokrassar.postssystem.ktor.server.configurators.ApplicationRoutingConfigurator
|
||||||
|
import com.insanusmokrassar.postssystem.publishing.ktor.publishingKeysRootRoute
|
||||||
import io.ktor.routing.Route
|
import io.ktor.routing.Route
|
||||||
|
import io.ktor.routing.route
|
||||||
|
|
||||||
fun Route.configurePublishingKeysRepoRoutes (
|
fun Route.configurePublishingKeysRepoRoutes (
|
||||||
proxyTo: PublishingKeysRepo
|
proxyTo: PublishingKeysRepo
|
||||||
) {
|
) {
|
||||||
|
route(publishingKeysRootRoute) {
|
||||||
configureReadPublishingKeysRepoRoutes(proxyTo)
|
configureReadPublishingKeysRepoRoutes(proxyTo)
|
||||||
configureWritePublishingKeysRepoRoutes(proxyTo)
|
configureWritePublishingKeysRepoRoutes(proxyTo)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class PublishingKeysRepoRoutingConfigurator (
|
class PublishingKeysRepoRoutingConfigurator (
|
||||||
|
Loading…
Reference in New Issue
Block a user