@@ -57,31 +57,31 @@ fun Application.ebmsSendInModule() {
57
57
call.respondText(marshal(response))
58
58
}
59
59
60
+ post(" /fagmelding/synkron" ) {
61
+ val request = this .call.receive(SendInRequest ::class )
62
+ runCatching {
63
+ log.info(request.marker(), " Payload ${request.payloadId} videresendes" )
64
+ frikortsporring(wrapMessageInEIFellesFormat(request))
65
+ }.onSuccess {
66
+ log.info(request.marker(), " Payload ${request.payloadId} videresendt til fagsystem" )
67
+ call.respond(
68
+ SendInResponse (
69
+ request.messageId,
70
+ request.conversationId,
71
+ it.eiFellesformat.addressing(request.addressing.from),
72
+ marshal(it.eiFellesformat.msgHead).toByteArray()
73
+ )
74
+ )
75
+ }.onFailure {
76
+ log.error(request.marker(), " Payload ${request.payloadId} videresending feilet" , it)
77
+ call.respond(HttpStatusCode .BadRequest , it.localizedMessage)
78
+ }
79
+ }
80
+
60
81
authenticate(AZURE_AD_AUTH ) {
61
82
get(" /" ) {
62
83
call.respondText(" Hello world, but securely" )
63
84
}
64
-
65
- post(" /fagmelding/synkron" ) {
66
- val request = this .call.receive(SendInRequest ::class )
67
- runCatching {
68
- log.info(request.marker(), " Payload ${request.payloadId} videresendes" )
69
- frikortsporring(wrapMessageInEIFellesFormat(request))
70
- }.onSuccess {
71
- log.info(request.marker(), " Payload ${request.payloadId} videresendt til fagsystem" )
72
- call.respond(
73
- SendInResponse (
74
- request.messageId,
75
- request.conversationId,
76
- it.eiFellesformat.addressing(request.addressing.from),
77
- marshal(it.eiFellesformat.msgHead).toByteArray()
78
- )
79
- )
80
- }.onFailure {
81
- log.error(request.marker(), " Payload ${request.payloadId} videresending feilet" , it)
82
- call.respond(HttpStatusCode .BadRequest , it.localizedMessage)
83
- }
84
- }
85
85
}
86
86
}
87
87
}
0 commit comments