update koin
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2021-08-16 14:52:27 +02:00
parent b16a5702b4
commit 5b9bb8bb82
4 changed files with 9 additions and 11 deletions

View File

@@ -20,16 +20,16 @@ class OutputServiceRDBServer {
* sample
*/
fun Routing.registerOutput() {
val resultObjectService by inject<ISampleObjectService>()
val sampleObjectService:ISampleObjectService by inject()
get("/sample"){
call.respond(resultObjectService.getAllSampleObjects())
call.respond(sampleObjectService.getAllSampleObjects())
}
get("/sample/after/{dateAfter}") {
val dateAfter = call.parameters["dateAfter"] ?: error(HttpStatusCode.NotAcceptable)
val dateTimeFormatter: DateTimeFormatter = DateTimeFormatter.ISO_LOCAL_DATE
val localDateAfter : LocalDate = LocalDate.parse(dateAfter,dateTimeFormatter)
val resultList = resultObjectService.getSampleObjectafterDate(localDateAfter)
val resultList = sampleObjectService.getSampleObjectafterDate(localDateAfter)
call.respond(resultList)
}
@@ -38,14 +38,14 @@ class OutputServiceRDBServer {
val dateAfter = call.parameters["dateBefore"] ?: error(HttpStatusCode.NotAcceptable)
val dateTimeFormatter: DateTimeFormatter = DateTimeFormatter.ISO_LOCAL_DATE
val localDateBefore : LocalDate = LocalDate.parse(dateAfter,dateTimeFormatter)
val resultList = resultObjectService.getSampleObjectbeforeDate(localDateBefore)
val resultList = sampleObjectService.getSampleObjectbeforeDate(localDateBefore)
call.respond(resultList)
}
get("/sample/{tagID}") {
val tagID = call.parameters["tagID"] ?: error(HttpStatusCode.NotAcceptable)
val resultObject = resultObjectService.getSampleObjectbyTag(tagID) ?: call.respond(HttpStatusCode.NotFound)
val resultObject = sampleObjectService.getSampleObjectbyTag(tagID) ?: call.respond(HttpStatusCode.NotFound)
call.respond(resultObject)
}