use my own gson
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Torma Kristóf 2020-05-22 00:23:50 +02:00
parent 4edd409cc8
commit 1bb96f90a1
Signed by: tormakris
GPG Key ID: DC83C4F2C41B1047

View File

@ -1,6 +1,7 @@
package com.kmalbz.api.route package com.kmalbz.api.route
import com.google.gson.Gson import com.google.gson.Gson
import com.google.gson.GsonBuilder
import com.kmalbz.api.model.ApiObject import com.kmalbz.api.model.ApiObject
import com.kmalbz.api.model.SampleObject import com.kmalbz.api.model.SampleObject
import com.kmalbz.database.service.IInputObjectService import com.kmalbz.database.service.IInputObjectService
@ -64,6 +65,8 @@ class InputServiceServer {
val queueName = channel.queueDeclare().queue val queueName = channel.queueDeclare().queue
channel.queueBind(queueName, rabbitExchangeName, "") channel.queueBind(queueName, rabbitExchangeName, "")
val gson = GsonBuilder().setDateFormat("yyyy-MM-dd HH:mm:ss").create()
get("/sample"){ get("/sample"){
call.respond(resultObjectService.getAllInputObjects()) call.respond(resultObjectService.getAllInputObjects())
} }
@ -76,7 +79,6 @@ class InputServiceServer {
when (part) { when (part) {
is PartData.FormItem -> { is PartData.FormItem -> {
if (part.name == "description") { if (part.name == "description") {
val gson = Gson()
print(part.value) print(part.value)
description = gson.fromJson(part.value, SampleObject::class.java) description = gson.fromJson(part.value, SampleObject::class.java)
} }