aboutsummaryrefslogtreecommitdiff
path: root/kvision-modules/kvision-server-jooby/src/main/kotlin/pl/treksoft
diff options
context:
space:
mode:
authorRobert Jaros <rjaros@finn.pl>2019-07-13 00:21:33 +0200
committerRobert Jaros <rjaros@finn.pl>2019-07-13 00:59:50 +0200
commita804e0aa277efc1b46c1111b0ad8302d267684b2 (patch)
treedbd5329f003b386b5196b510526c9cee75db3514 /kvision-modules/kvision-server-jooby/src/main/kotlin/pl/treksoft
parent7fe158d0f2243c460c4f1848bb7989c559362cdf (diff)
downloadkvision-a804e0aa277efc1b46c1111b0ad8302d267684b2.tar.gz
kvision-a804e0aa277efc1b46c1111b0ad8302d267684b2.tar.bz2
kvision-a804e0aa277efc1b46c1111b0ad8302d267684b2.zip
Refactor RemoteSelect -> SelectRemote and RemoteTabulator -> TabulatorRemote
Diffstat (limited to 'kvision-modules/kvision-server-jooby/src/main/kotlin/pl/treksoft')
-rw-r--r--kvision-modules/kvision-server-jooby/src/main/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt6
1 files changed, 4 insertions, 2 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 a2bb2386..4c4d4af0 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
@@ -42,7 +42,7 @@ import kotlin.reflect.KClass
/**
* Multiplatform service manager for Jooby.
*/
-@Suppress("LargeClass")
+@Suppress("LargeClass", "TooManyFunctions")
@UseExperimental(ExperimentalCoroutinesApi::class)
actual open class KVServiceManager<T : Any> actual constructor(val serviceClass: KClass<T>) {
@@ -396,7 +396,7 @@ actual open class KVServiceManager<T : Any> actual constructor(val serviceClass:
*/
@Suppress("TooGenericExceptionCaught")
protected actual fun bind(
- function: T.(String?, String?) -> List<RemoteSelectOption>
+ function: T.(String?, String?) -> List<RemoteOption>
) {
val routeDef = "route${this::class.simpleName}${counter++}"
routes.add {
@@ -440,10 +440,12 @@ actual open class KVServiceManager<T : Any> actual constructor(val serviceClass:
routes.add {
call(HttpMethod.POST, "/kv/$routeDef") { req, res ->
val jsonRpcRequest = req.body(JsonRpcRequest::class.java)
+ @Suppress("MagicNumber")
if (jsonRpcRequest.params.size == 4) {
val param1 = getParameter<Int?>(jsonRpcRequest.params[0])
val param2 = getParameter<Int?>(jsonRpcRequest.params[1])
val param3 = getParameter<List<RemoteFilter>?>(jsonRpcRequest.params[2])
+ @Suppress("MagicNumber")
val param4 = getParameter<List<RemoteSorter>?>(jsonRpcRequest.params[3])
val injector = req.require(Injector::class.java)
val service = injector.getInstance(serviceClass.java)