This commit is contained in:
parent
02793fa806
commit
b0fadd63d6
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user