fix type mismatch
continuous-integration/drone/push Build is passing Details

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
1 changed files with 3 additions and 6 deletions

View File

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