File tree Expand file tree Collapse file tree 8 files changed +32
-18
lines changed
src/main/kotlin/infrastructure/api/handlers Expand file tree Collapse file tree 8 files changed +32
-18
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ package infrastructure.api.handlers
1111import application.presenter.api.tracking.toTrackingInfoDto
1212import application.service.TrackingService
1313import infrastructure.provider.Provider
14+ import io.netty.handler.codec.http.HttpResponseStatus
1415import io.vertx.core.CompositeFuture
1516import io.vertx.core.Handler
1617import io.vertx.ext.web.RoutingContext
@@ -33,7 +34,10 @@ class BlockHealthProfessionalTrackingHandler(
3334 val block = list.map { hp ->
3435 hp.result().toTrackingInfoDto()
3536 }
36- routingContext.response().end(Json .encodeToString(block))
37+ routingContext.response()
38+ .putHeader(" content-type" , " application/json" )
39+ .setStatusCode(HttpResponseStatus .OK .code())
40+ .end(Json .encodeToString(block))
3741 }
3842 }
3943 }
Original file line number Diff line number Diff line change @@ -35,9 +35,9 @@ class ProcessInfoHandler(
3535 provider.webClient,
3636 ).execute().onSuccess { surgicalProcess ->
3737 if (surgicalProcess != null ) {
38- routingContext.response().setStatusCode(HttpResponseStatus .OK .code()).end(
39- Json .encodeToString(surgicalProcess.toSurgicalProcessDto()),
40- )
38+ routingContext.response().setStatusCode(HttpResponseStatus .OK .code())
39+ .putHeader( " content-type " , " application/json " )
40+ .end( Json .encodeToString(surgicalProcess.toSurgicalProcessDto()) )
4141 } else {
4242 routingContext.response().setStatusCode(HttpResponseStatus .NO_CONTENT .code()).end()
4343 }
Original file line number Diff line number Diff line change @@ -33,14 +33,16 @@ class ProcessStateHandler(
3333 provider.webClient,
3434 ).execute().onSuccess { surgicalProcess ->
3535 if (surgicalProcess != null ) {
36- routingContext.response().setStatusCode(HttpResponseStatus .OK .code()).end(
37- Json .encodeToString(
38- ProcessStateInfoDto (
39- surgicalProcess.state.toString(),
40- surgicalProcess.step.toString(),
36+ routingContext.response().setStatusCode(HttpResponseStatus .OK .code())
37+ .putHeader(" content-type" , " application/json" )
38+ .end(
39+ Json .encodeToString(
40+ ProcessStateInfoDto (
41+ surgicalProcess.state.toString(),
42+ surgicalProcess.step.toString(),
43+ ),
4144 ),
42- ),
43- )
45+ )
4446 } else {
4547 routingContext.response().setStatusCode(HttpResponseStatus .NO_CONTENT .code()).end()
4648 }
Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ class RoomInfoHandler(
3333 ).execute().onSuccess { room ->
3434 routingContext.response()
3535 .setStatusCode(HttpResponseStatus .OK .code())
36+ .putHeader(" content-type" , " application/json" )
3637 .end(
3738 Json .encodeToString(room.toRoomDto()),
3839 )
Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ class SurgeryReportInfoHandler(
3232 routingContext
3333 .response()
3434 .setStatusCode(HttpResponseStatus .OK .code())
35+ .putHeader(" content-type" , " application/json" )
3536 .end(
3637 Json .encodeToJsonElement(report.toApiDto()).toString(),
3738 )
Original file line number Diff line number Diff line change @@ -29,9 +29,11 @@ class SurgeryReportsArchiveHandler(
2929 reports.map { report ->
3030 report.toSurgeryReportEntryDto()
3131 }.run {
32- routingContext.response().setStatusCode(HttpResponseStatus .OK .code()).end(
33- Json .encodeToString(this ),
34- )
32+ routingContext.response().setStatusCode(HttpResponseStatus .OK .code())
33+ .putHeader(" content-type" , " application/json" )
34+ .end(
35+ Json .encodeToString(this ),
36+ )
3537 }
3638 }
3739 }
Original file line number Diff line number Diff line change @@ -45,7 +45,9 @@ class ZoneHealthProfessionalTrackingHandler(
4545 val preOperating = result.second.result().map { hp ->
4646 hp.result().toTrackingInfoDto()
4747 }
48- routingContext.response().end(Json .encodeToString(operating + preOperating))
48+ routingContext.response()
49+ .putHeader(" content-type" , " application/json" )
50+ .end(Json .encodeToString(operating + preOperating))
4951 }
5052 }
5153 }
Original file line number Diff line number Diff line change @@ -41,9 +41,11 @@ class ZonesHandler(
4141 }?.id?.id,
4242 )
4343 }.run {
44- routingContext.response().setStatusCode(HttpResponseStatus .OK .code()).end(
45- Json .encodeToString(this ),
46- )
44+ routingContext.response().setStatusCode(HttpResponseStatus .OK .code())
45+ .putHeader(" content-type" , " application/json" )
46+ .end(
47+ Json .encodeToString(this ),
48+ )
4749 }
4850 }
4951 }
You can’t perform that action at this time.
0 commit comments