This commit is contained in:
@@ -23,7 +23,6 @@ fun Application.module() {
|
||||
install(ContentNegotiation) {
|
||||
gson {
|
||||
setPrettyPrinting()
|
||||
setDateFormat("yyyy-MM-dd HH:mm:ss")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
package com.kmalbz.api.model
|
||||
|
||||
import com.google.gson.annotations.SerializedName
|
||||
import java.time.LocalDate
|
||||
|
||||
data class SampleObject(
|
||||
@SerializedName("date") val date: LocalDate,
|
||||
@SerializedName("device_id") val device_id: String
|
||||
)
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.kmalbz.api.route
|
||||
|
||||
import com.google.gson.Gson
|
||||
import com.google.gson.GsonBuilder
|
||||
import com.kmalbz.api.model.ApiObject
|
||||
import com.kmalbz.api.model.SampleObject
|
||||
@@ -33,6 +32,7 @@ import org.koin.ktor.ext.inject
|
||||
import java.io.File
|
||||
import java.io.InputStream
|
||||
import java.io.OutputStream
|
||||
import java.time.LocalDate
|
||||
import java.util.*
|
||||
import javax.activation.MimetypesFileTypeMap
|
||||
|
||||
@@ -65,7 +65,7 @@ class InputServiceServer {
|
||||
val queueName = channel.queueDeclare().queue
|
||||
channel.queueBind(queueName, rabbitExchangeName, "")
|
||||
|
||||
val gson = GsonBuilder().setDateFormat("yyyy-MM-dd").setPrettyPrinting().create()
|
||||
val gson = GsonBuilder().setPrettyPrinting().create()
|
||||
|
||||
get("/sample"){
|
||||
call.respond(resultObjectService.getAllInputObjects())
|
||||
@@ -100,7 +100,7 @@ class InputServiceServer {
|
||||
|
||||
val tag = UUID.randomUUID().toString()
|
||||
|
||||
val currentApiObject = ApiObject(tag = tag, date = description!!.date, device_id = description!!.device_id)
|
||||
val currentApiObject = ApiObject(tag = tag, date = LocalDate.now(), device_id = description!!.device_id)
|
||||
|
||||
transaction {
|
||||
resultObjectService.addOne(currentApiObject)
|
||||
|
||||
Reference in New Issue
Block a user