aboutsummaryrefslogtreecommitdiff
path: root/kvision-modules/kvision-server-spring-boot
diff options
context:
space:
mode:
authorRobert Jaros <rjaros@finn.pl>2019-01-09 12:19:18 +0100
committerRobert Jaros <rjaros@finn.pl>2019-01-09 12:19:18 +0100
commitec61850780cac4e84826aca95a14d8010813b13a (patch)
tree78a7c7f4e8ee041255b29093707537a5faf27218 /kvision-modules/kvision-server-spring-boot
parentd74b2813ac456ce3a69ba2afc2f8409f30c92cda (diff)
downloadkvision-ec61850780cac4e84826aca95a14d8010813b13a.tar.gz
kvision-ec61850780cac4e84826aca95a14d8010813b13a.tar.bz2
kvision-ec61850780cac4e84826aca95a14d8010813b13a.zip
Dependencies upgrade.
Diffstat (limited to 'kvision-modules/kvision-server-spring-boot')
-rw-r--r--kvision-modules/kvision-server-spring-boot/src/main/kotlin/pl/treksoft/kvision/remote/KVServer.kt6
-rw-r--r--kvision-modules/kvision-server-spring-boot/src/main/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt11
2 files changed, 6 insertions, 11 deletions
diff --git a/kvision-modules/kvision-server-spring-boot/src/main/kotlin/pl/treksoft/kvision/remote/KVServer.kt b/kvision-modules/kvision-server-spring-boot/src/main/kotlin/pl/treksoft/kvision/remote/KVServer.kt
index ba7264e8..b0052be0 100644
--- a/kvision-modules/kvision-server-spring-boot/src/main/kotlin/pl/treksoft/kvision/remote/KVServer.kt
+++ b/kvision-modules/kvision-server-spring-boot/src/main/kotlin/pl/treksoft/kvision/remote/KVServer.kt
@@ -27,7 +27,6 @@ import org.pac4j.core.profile.CommonProfile
import org.pac4j.core.profile.ProfileManager
import org.springframework.web.context.request.RequestContextHolder
import org.springframework.web.context.request.ServletRequestAttributes
-import javax.servlet.http.HttpServletRequest
import kotlinx.coroutines.async as coroutinesAsync
/**
@@ -36,11 +35,6 @@ import kotlinx.coroutines.async as coroutinesAsync
actual open class KVServer(val services: List<KVServiceManager<*>>)
/**
- * A server request.
- */
-actual typealias Request = HttpServletRequest
-
-/**
* A user profile.
*/
actual typealias Profile = CommonProfile
diff --git a/kvision-modules/kvision-server-spring-boot/src/main/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt b/kvision-modules/kvision-server-spring-boot/src/main/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt
index 24c6c9db..8513c128 100644
--- a/kvision-modules/kvision-server-spring-boot/src/main/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt
+++ b/kvision-modules/kvision-server-spring-boot/src/main/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt
@@ -30,6 +30,7 @@ import org.slf4j.Logger
import org.slf4j.LoggerFactory
import pl.treksoft.kvision.types.KV_DATE_FORMAT
import java.text.SimpleDateFormat
+import javax.servlet.http.HttpServletRequest
import javax.servlet.http.HttpServletResponse
import kotlin.reflect.KClass
@@ -43,10 +44,10 @@ actual open class KVServiceManager<T : Any> actual constructor(val serviceClass:
val LOG: Logger = LoggerFactory.getLogger(KVServiceManager::class.java.name)
}
- val postRequests: MutableMap<String, (Request, HttpServletResponse) -> Unit> = mutableMapOf()
- val putRequests: MutableMap<String, (Request, HttpServletResponse) -> Unit> = mutableMapOf()
- val deleteRequests: MutableMap<String, (Request, HttpServletResponse) -> Unit> = mutableMapOf()
- val optionsRequests: MutableMap<String, (Request, HttpServletResponse) -> Unit> = mutableMapOf()
+ val postRequests: MutableMap<String, (HttpServletRequest, HttpServletResponse) -> Unit> = mutableMapOf()
+ val putRequests: MutableMap<String, (HttpServletRequest, HttpServletResponse) -> Unit> = mutableMapOf()
+ val deleteRequests: MutableMap<String, (HttpServletRequest, HttpServletResponse) -> Unit> = mutableMapOf()
+ val optionsRequests: MutableMap<String, (HttpServletRequest, HttpServletResponse) -> Unit> = mutableMapOf()
val mapper = jacksonObjectMapper().apply {
dateFormat = SimpleDateFormat(KV_DATE_FORMAT)
@@ -426,7 +427,7 @@ actual open class KVServiceManager<T : Any> actual constructor(val serviceClass:
fun addRoute(
method: RpcHttpMethod,
path: String,
- handler: (Request, HttpServletResponse) -> Unit
+ handler: (HttpServletRequest, HttpServletResponse) -> Unit
) {
when (method) {
RpcHttpMethod.POST -> postRequests[path] = handler