From c0b7927e19bb5ec4cd0c3b973486a85f4a1ff56a Mon Sep 17 00:00:00 2001 From: Robert Jaros Date: Mon, 11 Feb 2019 23:02:40 +0100 Subject: Refactoring of server side components. --- .../pl/treksoft/kvision/remote/KVServiceManager.kt | 43 +++++++++------------- 1 file changed, 18 insertions(+), 25 deletions(-) (limited to 'kvision-modules/kvision-common-remote/src/main/kotlin/pl') diff --git a/kvision-modules/kvision-common-remote/src/main/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt b/kvision-modules/kvision-common-remote/src/main/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt index 224a8542..514fb07d 100644 --- a/kvision-modules/kvision-common-remote/src/main/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt +++ b/kvision-modules/kvision-common-remote/src/main/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt @@ -23,13 +23,6 @@ package pl.treksoft.kvision.remote import kotlin.reflect.KClass -enum class RpcHttpMethod { - POST, - PUT, - DELETE, - OPTIONS -} - enum class HttpMethod { GET, POST, @@ -46,73 +39,73 @@ expect open class KVServiceManager(serviceClass: KClass) { /** * Binds a given route with a function of the receiver. * @param function a function of the receiver - * @param route a route * @param method a HTTP method + * @param route a route */ protected inline fun bind( noinline function: suspend T.() -> RET, - route: String? = null, - method: RpcHttpMethod = RpcHttpMethod.POST + method: HttpMethod = HttpMethod.POST, + route: String? = null ) /** * Binds a given route with a function of the receiver. * @param function a function of the receiver - * @param route a route * @param method a HTTP method + * @param route a route */ protected inline fun bind( noinline function: suspend T.(PAR) -> RET, - route: String? = null, - method: RpcHttpMethod = RpcHttpMethod.POST + method: HttpMethod = HttpMethod.POST, + route: String? = null ) /** * Binds a given route with a function of the receiver. * @param function a function of the receiver - * @param route a route * @param method a HTTP method + * @param route a route */ protected inline fun bind( noinline function: suspend T.(PAR1, PAR2) -> RET, - route: String? = null, - method: RpcHttpMethod = RpcHttpMethod.POST + method: HttpMethod = HttpMethod.POST, + route: String? = null ) /** * Binds a given route with a function of the receiver. * @param function a function of the receiver - * @param route a route * @param method a HTTP method + * @param route a route */ protected inline fun bind( noinline function: suspend T.(PAR1, PAR2, PAR3) -> RET, - route: String? = null, - method: RpcHttpMethod = RpcHttpMethod.POST + method: HttpMethod = HttpMethod.POST, + route: String? = null ) /** * Binds a given route with a function of the receiver. * @param function a function of the receiver - * @param route a route * @param method a HTTP method + * @param route a route */ protected inline fun bind( noinline function: suspend T.(PAR1, PAR2, PAR3, PAR4) -> RET, - route: String? = null, - method: RpcHttpMethod = RpcHttpMethod.POST + method: HttpMethod = HttpMethod.POST, + route: String? = null ) /** * Binds a given route with a function of the receiver. * @param function a function of the receiver - * @param route a route * @param method a HTTP method + * @param route a route */ protected inline fun bind( noinline function: suspend T.(PAR1, PAR2, PAR3, PAR4, PAR5) -> RET, - route: String? = null, - method: RpcHttpMethod = RpcHttpMethod.POST + method: HttpMethod = HttpMethod.POST, + route: String? = null ) /** -- cgit