diff options
author | Robert Jaros <rjaros@finn.pl> | 2018-06-02 00:07:39 +0200 |
---|---|---|
committer | Robert Jaros <rjaros@finn.pl> | 2018-06-02 00:07:39 +0200 |
commit | 93cfdf0dcf6404eb636037fbb59fbff8389a434a (patch) | |
tree | 8d25e6a099811e2fd771d49f4b5fb62ceaea9e2e /kvision-common/src/main/kotlin/pl | |
parent | 656e823d91301f637feff2edea3920d3625b43c2 (diff) | |
download | kvision-93cfdf0dcf6404eb636037fbb59fbff8389a434a.tar.gz kvision-93cfdf0dcf6404eb636037fbb59fbff8389a434a.tar.bz2 kvision-93cfdf0dcf6404eb636037fbb59fbff8389a434a.zip |
Generate automatic routes names.
Diffstat (limited to 'kvision-common/src/main/kotlin/pl')
-rw-r--r-- | kvision-common/src/main/kotlin/pl/treksoft/kvision/remote/ServiceManager.kt | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/kvision-common/src/main/kotlin/pl/treksoft/kvision/remote/ServiceManager.kt b/kvision-common/src/main/kotlin/pl/treksoft/kvision/remote/ServiceManager.kt index b3db5d0e..1f31dec0 100644 --- a/kvision-common/src/main/kotlin/pl/treksoft/kvision/remote/ServiceManager.kt +++ b/kvision-common/src/main/kotlin/pl/treksoft/kvision/remote/ServiceManager.kt @@ -41,87 +41,87 @@ enum class HttpMethod { /** * Multiplatform service manager. */ -expect open class ServiceManager<out T>(service: T? = null) { +expect open class ServiceManager<out T>(service: T) { /** * Binds a given route with a function of the receiver. - * @param route a route * @param function a function of the receiver + * @param route a route * @param method a HTTP method * @param prefix an URL address prefix */ protected inline fun <reified RET> bind( - route: String, noinline function: T.(Request?) -> Deferred<RET>, + route: String? = null, method: RpcHttpMethod = RpcHttpMethod.POST, prefix: String = "/" ) /** * Binds a given route with a function of the receiver. - * @param route a route * @param function a function of the receiver + * @param route a route * @param method a HTTP method * @param prefix an URL address prefix */ protected inline fun <reified PAR, reified RET> bind( - route: String, noinline function: T.(PAR, Request?) -> Deferred<RET>, + route: String? = null, method: RpcHttpMethod = RpcHttpMethod.POST, prefix: String = "/" ) /** * Binds a given route with a function of the receiver. - * @param route a route * @param function a function of the receiver + * @param route a route * @param method a HTTP method * @param prefix an URL address prefix */ protected inline fun <reified PAR1, reified PAR2, reified RET> bind( - route: String, noinline function: T.(PAR1, PAR2, Request?) -> Deferred<RET>, + route: String? = null, method: RpcHttpMethod = RpcHttpMethod.POST, prefix: String = "/" ) /** * Binds a given route with a function of the receiver. - * @param route a route * @param function a function of the receiver + * @param route a route * @param method a HTTP method * @param prefix an URL address prefix */ protected inline fun <reified PAR1, reified PAR2, reified PAR3, reified RET> bind( - route: String, noinline function: T.(PAR1, PAR2, PAR3, Request?) -> Deferred<RET>, + route: String? = null, method: RpcHttpMethod = RpcHttpMethod.POST, prefix: String = "/" ) /** * Binds a given route with a function of the receiver. - * @param route a route * @param function a function of the receiver + * @param route a route * @param method a HTTP method * @param prefix an URL address prefix */ protected inline fun <reified PAR1, reified PAR2, reified PAR3, reified PAR4, reified RET> bind( - route: String, noinline function: T.(PAR1, PAR2, PAR3, PAR4, Request?) -> Deferred<RET>, + route: String? = null, method: RpcHttpMethod = RpcHttpMethod.POST, prefix: String = "/" ) /** * Binds a given route with a function of the receiver. - * @param route a route * @param function a function of the receiver + * @param route a route * @param method a HTTP method * @param prefix an URL address prefix */ protected inline fun <reified PAR1, reified PAR2, reified PAR3, reified PAR4, reified PAR5, reified RET> bind( - route: String, noinline function: T.(PAR1, PAR2, PAR3, PAR4, PAR5, Request?) -> Deferred<RET>, + route: String? = null, method: RpcHttpMethod = RpcHttpMethod.POST, prefix: String = "/" ) |