1
1
package no.nav.hjelpemidler.oebs.listener.api
2
2
3
3
import com.fasterxml.jackson.annotation.JsonProperty
4
- import com.fasterxml.jackson.module.kotlin.readValue
5
4
import io.github.oshai.kotlinlogging.KotlinLogging
6
5
import io.ktor.http.HttpStatusCode
7
6
import io.ktor.server.application.call
8
- import io.ktor.server.request.receiveText
7
+ import io.ktor.server.request.receive
9
8
import io.ktor.server.response.respond
10
9
import io.ktor.server.routing.Route
11
10
import io.ktor.server.routing.post
12
11
import no.nav.hjelpemidler.logging.secureLog
13
- import no.nav.hjelpemidler.oebs.listener.ApplicationJacksonObjectMapperProvider
14
12
import no.nav.hjelpemidler.oebs.listener.Context
15
13
import no.nav.hjelpemidler.oebs.listener.model.ServiceforespørselEndringMessage
16
14
@@ -20,13 +18,7 @@ fun Route.serviceforespørselAPI(context: Context) {
20
18
post(" /sf" ) {
21
19
log.info { " Innkommende SF-oppdatering" }
22
20
try {
23
- val requestBody = call.receiveText()
24
- log.info { " Request body i SF oppdatering: $requestBody " }
25
-
26
- val endring = ApplicationJacksonObjectMapperProvider ().invoke().readValue<Serviceforesp ørselEndring>(requestBody)
27
- // val endring = ApplicationJacksonObjectMapperProvider().invoke().readValue(requestBody, ServiceforespørselEndring::class.java)
28
- log.info { " Endring: $endring " }
29
- // val endring = call.receive<ServiceforespørselEndring>()
21
+ val endring = call.receive<Serviceforesp ørselEndring>()
30
22
val message = Serviceforesp ørselEndringMessage(endring)
31
23
publiserMelding(context, endring, message)
32
24
call.respond(HttpStatusCode .OK )
0 commit comments