This commit is contained in:
parent
a6bb5c8cc8
commit
938348cb60
@ -2,9 +2,10 @@ package com.kmalbz.api.model
|
|||||||
|
|
||||||
import com.google.gson.annotations.SerializedName
|
import com.google.gson.annotations.SerializedName
|
||||||
import java.time.LocalDate
|
import java.time.LocalDate
|
||||||
|
import java.util.*
|
||||||
|
|
||||||
data class ApiObject(
|
data class ApiObject(
|
||||||
@SerializedName("tag") val tag: String,
|
@SerializedName("tag") val tag: UUID,
|
||||||
@SerializedName("date") val date: LocalDate,
|
@SerializedName("date") val date: LocalDate,
|
||||||
@SerializedName("device_id") val device_id: String
|
@SerializedName("device_id") val device_id: String
|
||||||
|
|
||||||
|
@ -98,7 +98,7 @@ class InputServiceServer {
|
|||||||
if (description == null || soundFile == null)
|
if (description == null || soundFile == null)
|
||||||
call.respond(HttpStatusCode.ExpectationFailed)
|
call.respond(HttpStatusCode.ExpectationFailed)
|
||||||
|
|
||||||
val tag = UUID.randomUUID().toString()
|
val tag = UUID.randomUUID()
|
||||||
|
|
||||||
val currentApiObject = ApiObject(tag = tag, date = LocalDate.now(), device_id = description!!.device_id)
|
val currentApiObject = ApiObject(tag = tag, date = LocalDate.now(), device_id = description!!.device_id)
|
||||||
|
|
||||||
@ -108,7 +108,7 @@ class InputServiceServer {
|
|||||||
|
|
||||||
connection.confirmChannel {
|
connection.confirmChannel {
|
||||||
publish {
|
publish {
|
||||||
publishWithConfirm(OutboundMessage(rabbitExchangeName, "", MessageProperties.PERSISTENT_BASIC, tag))
|
publishWithConfirm(OutboundMessage(rabbitExchangeName, "", MessageProperties.PERSISTENT_BASIC, tag.toString()))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,9 +4,10 @@ import org.jetbrains.exposed.dao.id.IntIdTable
|
|||||||
import org.jetbrains.exposed.sql.*
|
import org.jetbrains.exposed.sql.*
|
||||||
import org.jetbrains.exposed.sql.`java-time`.date
|
import org.jetbrains.exposed.sql.`java-time`.date
|
||||||
import java.time.LocalDate
|
import java.time.LocalDate
|
||||||
|
import java.util.*
|
||||||
|
|
||||||
object InputObjects : IntIdTable() {
|
object InputObjects : IntIdTable() {
|
||||||
val tag: Column<String> = varchar("tag",32)
|
val tag: Column<UUID> = uuid("tag")
|
||||||
val date: Column<LocalDate> = date("date").default(LocalDate.now())
|
val date: Column<LocalDate> = date("date").default(LocalDate.now())
|
||||||
val device_id: Column<String> = varchar("device_id", 32)
|
val device_id: Column<String> = varchar("device_id", 32)
|
||||||
override val primaryKey = PrimaryKey(id, name = "PK_ResultObject_Id")
|
override val primaryKey = PrimaryKey(id, name = "PK_ResultObject_Id")
|
||||||
|
Loading…
Reference in New Issue
Block a user