This commit is contained in:
parent
4edd409cc8
commit
1bb96f90a1
@ -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)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user