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