refactor api
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-04-08 03:09:24 +02:00
parent f4ce568aa8
commit 928c9888dd
5 changed files with 29 additions and 19 deletions

View File

@@ -5,7 +5,5 @@ import java.time.LocalDate
data class ApiObject(
@SerializedName("tag") val tag: String,
@SerializedName("date") val date: LocalDate,
@SerializedName("decision") val decision: Boolean,
@SerializedName("confidence") val confidence: Double
@SerializedName("probability") val probability: Double
)

View File

@@ -24,13 +24,19 @@ class OutputServiceRDBServer() {
}
get("/output/filter/negative") {
val resultList = resultObjectService.getResultObjectbyDecision(false) ?: call.respond(HttpStatusCode.NotFound)
val resultList = resultObjectService.getResultObjecLessthanProbability(0.5) ?: call.respond(HttpStatusCode.NotFound)
call.respond(resultList)
}
get("/output/filter/positive") {
val resultList = resultObjectService.getResultObjectbyDecision(true) ?: call.respond(HttpStatusCode.NotFound)
val resultList = resultObjectService.getResultObjecGreaterthanProbability(0.5) ?: call.respond(HttpStatusCode.NotFound)
call.respond(resultList)
}
get("/output/filter/undecided") {
val resultList = resultObjectService.getResultObjecEqualsProbability(0.5) ?: call.respond(HttpStatusCode.NotFound)
call.respond(resultList)
}