aboutsummaryrefslogtreecommitdiff
path: root/kvision-modules/kvision-server-jooby/src
diff options
context:
space:
mode:
Diffstat (limited to 'kvision-modules/kvision-server-jooby/src')
-rw-r--r--kvision-modules/kvision-server-jooby/src/main/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt7
1 files changed, 4 insertions, 3 deletions
diff --git a/kvision-modules/kvision-server-jooby/src/main/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt b/kvision-modules/kvision-server-jooby/src/main/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt
index e2a26967..fd95be3e 100644
--- a/kvision-modules/kvision-server-jooby/src/main/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt
+++ b/kvision-modules/kvision-server-jooby/src/main/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt
@@ -417,20 +417,21 @@ actual open class KVServiceManager<T : Any> actual constructor(val serviceClass:
*/
@Suppress("TooGenericExceptionCaught")
protected actual fun bind(
- function: T.(String?, String?) -> List<RemoteOption>
+ function: T.(String?, String?, String?) -> List<RemoteOption>
) {
val routeDef = "route${this::class.simpleName}${counter++}"
routes.add {
call(HttpMethod.POST, "/kv/$routeDef") { req, res ->
val jsonRpcRequest = req.body(JsonRpcRequest::class.java)
- if (jsonRpcRequest.params.size == 2) {
+ if (jsonRpcRequest.params.size == 3) {
val param1 = getParameter<String?>(jsonRpcRequest.params[0])
val param2 = getParameter<String?>(jsonRpcRequest.params[1])
+ val param3 = getParameter<String?>(jsonRpcRequest.params[2])
val injector = req.require(Injector::class.java)
val service = injector.getInstance(serviceClass.java)
GlobalScope.launch(start = CoroutineStart.UNDISPATCHED) {
try {
- val result = function.invoke(service, param1, param2)
+ val result = function.invoke(service, param1, param2, param3)
res.send(
JsonRpcResponse(
id = jsonRpcRequest.id,