diff options
author | Robert Jaros <rjaros@finn.pl> | 2019-07-13 00:21:33 +0200 |
---|---|---|
committer | Robert Jaros <rjaros@finn.pl> | 2019-07-13 00:59:50 +0200 |
commit | a804e0aa277efc1b46c1111b0ad8302d267684b2 (patch) | |
tree | dbd5329f003b386b5196b510526c9cee75db3514 /kvision-modules/kvision-server-ktor/src/main/kotlin | |
parent | 7fe158d0f2243c460c4f1848bb7989c559362cdf (diff) | |
download | kvision-a804e0aa277efc1b46c1111b0ad8302d267684b2.tar.gz kvision-a804e0aa277efc1b46c1111b0ad8302d267684b2.tar.bz2 kvision-a804e0aa277efc1b46c1111b0ad8302d267684b2.zip |
Refactor RemoteSelect -> SelectRemote and RemoteTabulator -> TabulatorRemote
Diffstat (limited to 'kvision-modules/kvision-server-ktor/src/main/kotlin')
-rw-r--r-- | kvision-modules/kvision-server-ktor/src/main/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/kvision-modules/kvision-server-ktor/src/main/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt b/kvision-modules/kvision-server-ktor/src/main/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt index c5c579a6..847604fb 100644 --- a/kvision-modules/kvision-server-ktor/src/main/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt +++ b/kvision-modules/kvision-server-ktor/src/main/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt @@ -55,7 +55,7 @@ import kotlin.reflect.KClass */ @KtorExperimentalAPI @UseExperimental(ExperimentalCoroutinesApi::class) -@Suppress("LargeClass") +@Suppress("LargeClass", "TooManyFunctions") actual open class KVServiceManager<T : Any> actual constructor(val serviceClass: KClass<T>) { companion object { @@ -419,7 +419,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++}" addRoute(HttpMethod.POST, "/kv/$routeDef") { @@ -468,10 +468,12 @@ actual open class KVServiceManager<T : Any> actual constructor(val serviceClass: addRoute(HttpMethod.POST, "/kv/$routeDef") { val service = call.injector.createChildInjector(DummyWsSessionModule()).getInstance(serviceClass.java) val jsonRpcRequest = call.receive<JsonRpcRequest>() + @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]) try { val result = function.invoke(service, param1, param2, param3, param4) |