fix type mismatch
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Torma Kristóf 2021-08-18 15:49:07 +02:00
parent 02793fa806
commit b0fadd63d6
Signed by: tormakris
GPG Key ID: DC83C4F2C41B1047

View File

@ -6,9 +6,8 @@ import io.ktor.http.HttpStatusCode
import io.ktor.response.respond import io.ktor.response.respond
import io.ktor.routing.Routing import io.ktor.routing.Routing
import io.ktor.routing.get import io.ktor.routing.get
import kotlinx.datetime.LocalDateTime
import org.koin.ktor.ext.inject import org.koin.ktor.ext.inject
import java.time.LocalDate
import java.time.format.DateTimeFormatter
/** /**
* Sample Service * Sample Service
@ -43,8 +42,7 @@ class SampleServiceServer {
get("/sample/after/{dateAfter}") { get("/sample/after/{dateAfter}") {
val dateAfter = call.parameters["dateAfter"] ?: error(HttpStatusCode.NotAcceptable) val dateAfter = call.parameters["dateAfter"] ?: error(HttpStatusCode.NotAcceptable)
val dateTimeFormatter: DateTimeFormatter = DateTimeFormatter.ISO_LOCAL_DATE val localDateAfter : LocalDateTime = LocalDateTime.parse(dateAfter)
val localDateAfter : LocalDate = LocalDate.parse(dateAfter,dateTimeFormatter)
val resultList = sampleObjectService.getSampleObjectafterDate(localDateAfter) val resultList = sampleObjectService.getSampleObjectafterDate(localDateAfter)
call.respond(resultList) call.respond(resultList)
@ -52,8 +50,7 @@ class SampleServiceServer {
get("/sample/before/{dateBefore}") { get("/sample/before/{dateBefore}") {
val dateAfter = call.parameters["dateBefore"] ?: error(HttpStatusCode.NotAcceptable) val dateAfter = call.parameters["dateBefore"] ?: error(HttpStatusCode.NotAcceptable)
val dateTimeFormatter: DateTimeFormatter = DateTimeFormatter.ISO_LOCAL_DATE val localDateBefore : LocalDateTime = LocalDateTime.parse(dateAfter)
val localDateBefore : LocalDate = LocalDate.parse(dateAfter,dateTimeFormatter)
val resultList = sampleObjectService.getSampleObjectbeforeDate(localDateBefore) val resultList = sampleObjectService.getSampleObjectbeforeDate(localDateBefore)
call.respond(resultList) call.respond(resultList)