feat(dto): update GameWritebackEventDto for JSON deserialization and remove unused mixin
Build & Test (NowChessSystems) TeamCity build failed
Build & Test (NowChessSystems) TeamCity build failed
This commit is contained in:
@@ -49,6 +49,7 @@ dependencies {
|
||||
strictly(versions["SCALA_LIBRARY"]!!)
|
||||
}
|
||||
}
|
||||
implementation("com.fasterxml.jackson.databind:jackson-databind:${versions["JACKSON"]!!}")
|
||||
|
||||
testImplementation(platform("org.junit:junit-bom:5.13.4"))
|
||||
testImplementation("org.junit.jupiter:junit-jupiter")
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package de.nowchess.api.dto
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize
|
||||
|
||||
case class GameWritebackEventDto(
|
||||
gameId: String,
|
||||
fen: String,
|
||||
@@ -14,11 +16,11 @@ case class GameWritebackEventDto(
|
||||
limitSeconds: Option[Int],
|
||||
incrementSeconds: Option[Int],
|
||||
daysPerMove: Option[Int],
|
||||
whiteRemainingMs: Option[Long],
|
||||
blackRemainingMs: Option[Long],
|
||||
incrementMs: Option[Long],
|
||||
clockLastTickAt: Option[Long],
|
||||
clockMoveDeadline: Option[Long],
|
||||
@JsonDeserialize(contentAs = classOf[java.lang.Long]) whiteRemainingMs: Option[Long],
|
||||
@JsonDeserialize(contentAs = classOf[java.lang.Long]) blackRemainingMs: Option[Long],
|
||||
@JsonDeserialize(contentAs = classOf[java.lang.Long]) incrementMs: Option[Long],
|
||||
@JsonDeserialize(contentAs = classOf[java.lang.Long]) clockLastTickAt: Option[Long],
|
||||
@JsonDeserialize(contentAs = classOf[java.lang.Long]) clockMoveDeadline: Option[Long],
|
||||
clockActiveColor: Option[String],
|
||||
pendingDrawOffer: Option[String],
|
||||
result: Option[String] = None,
|
||||
|
||||
-10
@@ -1,10 +0,0 @@
|
||||
package de.nowchess.store.config
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize
|
||||
|
||||
abstract class GameWritebackEventDtoMixin:
|
||||
@JsonDeserialize(contentAs = classOf[java.lang.Long]) val whiteRemainingMs: Option[Long]
|
||||
@JsonDeserialize(contentAs = classOf[java.lang.Long]) val blackRemainingMs: Option[Long]
|
||||
@JsonDeserialize(contentAs = classOf[java.lang.Long]) val incrementMs: Option[Long]
|
||||
@JsonDeserialize(contentAs = classOf[java.lang.Long]) val clockLastTickAt: Option[Long]
|
||||
@JsonDeserialize(contentAs = classOf[java.lang.Long]) val clockMoveDeadline: Option[Long]
|
||||
@@ -3,7 +3,6 @@ package de.nowchess.store.config
|
||||
import com.fasterxml.jackson.core.Version
|
||||
import com.fasterxml.jackson.databind.ObjectMapper
|
||||
import com.fasterxml.jackson.module.scala.DefaultScalaModule
|
||||
import de.nowchess.api.dto.GameWritebackEventDto
|
||||
import io.quarkus.jackson.ObjectMapperCustomizer
|
||||
import jakarta.inject.Singleton
|
||||
|
||||
@@ -16,4 +15,3 @@ class JacksonConfig extends ObjectMapperCustomizer:
|
||||
new Version(2, 21, 1, null, "com.fasterxml.jackson.module", "jackson-module-scala")
|
||||
// scalafix:on DisableSyntax.null
|
||||
})
|
||||
mapper.addMixIn(classOf[GameWritebackEventDto], classOf[GameWritebackEventDtoMixin])
|
||||
|
||||
Reference in New Issue
Block a user