dont send date
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-05-22 00:39:25 +02:00
parent 53b6b23ccc
commit a6bb5c8cc8
4 changed files with 4 additions and 8 deletions

View File

@@ -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
)

View File

@@ -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)