From 80f33eae37fff276f538ce43d2b0e18f773a839b Mon Sep 17 00:00:00 2001 From: Robert Jaros Date: Sat, 18 Apr 2020 20:20:21 +0200 Subject: Support for method annotations for compiler plugin (#142) --- .../jvmMain/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'kvision-modules/kvision-server-spring-boot/src/jvmMain/kotlin/pl/treksoft') diff --git a/kvision-modules/kvision-server-spring-boot/src/jvmMain/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt b/kvision-modules/kvision-server-spring-boot/src/jvmMain/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt index eb602aa1..3a73003b 100644 --- a/kvision-modules/kvision-server-spring-boot/src/jvmMain/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt +++ b/kvision-modules/kvision-server-spring-boot/src/jvmMain/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt @@ -530,7 +530,7 @@ actual open class KVServiceManager actual constructor(val serviceClass: noinline function: suspend T.(ReceiveChannel, SendChannel) -> Unit, route: String? ) { - val routeDef = "route${this::class.simpleName}${counter++}" + val routeDef = route ?: "route${this::class.simpleName}${counter++}" webSocketsRequests[routeDef] = { webSocketSession, tlWsSession, ctx, incoming, outgoing -> tlWsSession.set(webSocketSession) val service = ctx.getBean(serviceClass.java) @@ -583,9 +583,10 @@ actual open class KVServiceManager actual constructor(val serviceClass: */ @Suppress("TooGenericExceptionCaught") protected actual inline fun bindTabulatorRemote( - noinline function: suspend T.(Int?, Int?, List?, List?, String?) -> RemoteData + noinline function: suspend T.(Int?, Int?, List?, List?, String?) -> RemoteData, + route: String? ) { - val routeDef = "route${this::class.simpleName}${counter++}" + val routeDef = route ?: "route${this::class.simpleName}${counter++}" addRoute(HttpMethod.POST, "/kv/$routeDef") { req, tlReq, ctx -> tlReq.set(req) val service = ctx.getBean(serviceClass.java) -- cgit