From 69958b1a08f46aecd6ceda54780f362019150052 Mon Sep 17 00:00:00 2001 From: Robert Jaros Date: Tue, 22 Oct 2019 23:18:59 +0200 Subject: Send additional state with SelectRemote request. --- .../src/main/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'kvision-modules/kvision-server-spring-boot/src/main/kotlin') diff --git a/kvision-modules/kvision-server-spring-boot/src/main/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt b/kvision-modules/kvision-server-spring-boot/src/main/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt index 14360abc..25ad52ed 100644 --- a/kvision-modules/kvision-server-spring-boot/src/main/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt +++ b/kvision-modules/kvision-server-spring-boot/src/main/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt @@ -507,18 +507,19 @@ actual open class KVServiceManager actual constructor(val serviceClass: */ @Suppress("TooGenericExceptionCaught") protected actual fun bind( - function: T.(String?, String?) -> List + function: T.(String?, String?, String?) -> List ) { val routeDef = "route${this::class.simpleName}${counter++}" addRoute(HttpMethod.POST, "/kv/$routeDef") { req, ctx -> val service = ctx.getBean(serviceClass.java) initializeService(service, req) val jsonRpcRequest = req.awaitBody() - if (jsonRpcRequest.params.size == 2) { + if (jsonRpcRequest.params.size == 3) { val param1 = getParameter(jsonRpcRequest.params[0]) val param2 = getParameter(jsonRpcRequest.params[1]) + val param3 = getParameter(jsonRpcRequest.params[2]) try { - val result = function.invoke(service, param1, param2) + val result = function.invoke(service, param1, param2, param3) ServerResponse.ok().json().bodyValueAndAwait( mapper.writeValueAsString( JsonRpcResponse( -- cgit