Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[*.{kt,kts}]
indent_size = 4
continuation_indent_size = 4
insert_final_newline = true
max_line_length = 120
12 changes: 12 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
plugins {
alias(libs.plugins.kotlin.jvm)
alias(libs.plugins.ktor)
alias(libs.plugins.spotless)
}

group = "com.es"
Expand Down Expand Up @@ -33,3 +34,14 @@ dependencies {
testImplementation(libs.ktor.server.test.host)
testImplementation(libs.kotlin.test.junit)
}

spotless {
kotlin {
ktlint("1.2.1")
target("**/*.kt")
suppressLintsFor {
step = "ktlint"
shortCode = "standard:no-wildcard-imports"
}
}
}
2 changes: 2 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ kotlin-version = "2.1.20"
ktor-version = "3.1.1"
logback-version = "1.4.14"
jackson-version = "2.15.0"
spotless-version = "7.0.3"

[libraries]
ktor-server-content-negotiation = { module = "io.ktor:ktor-server-content-negotiation", version.ref = "ktor-version" }
Expand All @@ -22,3 +23,4 @@ jackson-dataformat-xml = { module = "com.fasterxml.jackson.dataformat:jackson-da
[plugins]
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin-version" }
ktor = { id = "io.ktor.plugin", version.ref = "ktor-version" }
spotless = { id = "com.diffplug.spotless", version.ref = "spotless-version" }
2 changes: 1 addition & 1 deletion src/main/kotlin/model/BGGPropertyValue.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty
data class BGGPropertyValue(
@JacksonXmlProperty(isAttribute = true)
@JsonProperty("value")
val value: String? = null
val value: String? = null,
)
15 changes: 1 addition & 14 deletions src/main/kotlin/model/detail/BGGGameDetailItem.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.es.model.detail

import com.es.model.search.BGGGameItemName
import com.es.model.BGGPropertyValue
import com.es.model.search.BGGGameItemName
import com.fasterxml.jackson.annotation.JsonIgnoreProperties
import com.fasterxml.jackson.annotation.JsonProperty
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper
Expand All @@ -12,63 +12,50 @@ data class BGGGameDetailItem(
@JacksonXmlProperty(isAttribute = true)
@JsonProperty("id")
val id: String,

@JacksonXmlProperty(isAttribute = true)
@JsonProperty("type")
val type: String,

@JacksonXmlProperty(localName = "thumbnail")
@JsonProperty("thumbnail")
val thumbnail: String? = null,

@JacksonXmlProperty(localName = "image")
@JsonProperty("image")
val image: String? = null,

@JacksonXmlElementWrapper(useWrapping = false)
@JacksonXmlProperty(localName = "name")
@JsonProperty("names")
val names: List<BGGGameItemName>? = null,

@JacksonXmlProperty(localName = "description")
@JsonProperty("description")
val description: String? = null,

@JacksonXmlElementWrapper(useWrapping = false)
@JacksonXmlProperty(localName = "yearpublished")
@JsonProperty("yearpublished")
val yearPublished: BGGPropertyValue? = null,

@JacksonXmlElementWrapper(useWrapping = false)
@JacksonXmlProperty(localName = "minplayers")
@JsonProperty("minplayers")
val minPlayers: BGGPropertyValue? = null,

@JacksonXmlElementWrapper(useWrapping = false)
@JacksonXmlProperty(localName = "maxplayers")
@JsonProperty("maxplayers")
val maxPlayers: BGGPropertyValue? = null,

@JacksonXmlElementWrapper(useWrapping = false)
@JacksonXmlProperty(localName = "playingtime")
@JsonProperty("playingtime")
val playingTime: BGGPropertyValue? = null,

@JacksonXmlElementWrapper(useWrapping = false)
@JacksonXmlProperty(localName = "minplaytime")
@JsonProperty("minplaytime")
val minPlayTime: BGGPropertyValue? = null,

@JacksonXmlElementWrapper(useWrapping = false)
@JacksonXmlProperty(localName = "maxplaytime")
@JsonProperty("maxplaytime")
val maxPlayTime: BGGPropertyValue? = null,

@JacksonXmlElementWrapper(useWrapping = false)
@JacksonXmlProperty(localName = "minage")
@JsonProperty("minage")
val minAge: BGGPropertyValue? = null,

@JacksonXmlElementWrapper(useWrapping = false)
@JacksonXmlProperty(localName = "link")
@JsonProperty("links")
Expand Down
4 changes: 1 addition & 3 deletions src/main/kotlin/model/detail/BGGGameDetailLink.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@ data class BGGGameDetailLink(
@JacksonXmlProperty(isAttribute = true)
@JsonProperty("type")
val type: String? = null,

@JacksonXmlProperty(isAttribute = true)
@JsonProperty("id")
val id: String? = null,

@JacksonXmlProperty(isAttribute = true)
@JsonProperty("value")
val value: String? = null
val value: String? = null,
)
6 changes: 2 additions & 4 deletions src/main/kotlin/model/search/BGGGameItem.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,20 @@ package com.es.model.search
import com.es.model.BGGPropertyValue
import com.fasterxml.jackson.annotation.JsonIgnoreProperties
import com.fasterxml.jackson.annotation.JsonProperty
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty

@JsonIgnoreProperties(ignoreUnknown = true)
data class BGGGameItem(
@JacksonXmlProperty(isAttribute = true)
@JsonProperty("id")
val id: String,

@JacksonXmlElementWrapper(useWrapping = false)
@JacksonXmlProperty(localName = "name")
@JsonProperty("name")
val name: BGGGameItemName? = null,

@JacksonXmlElementWrapper(useWrapping = false)
@JacksonXmlProperty(localName = "yearpublished")
@JsonProperty("yearpublished")
val yearPublished: BGGPropertyValue? = null
val yearPublished: BGGPropertyValue? = null,
)
3 changes: 1 addition & 2 deletions src/main/kotlin/model/search/BGGGameItemName.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ data class BGGGameItemName(
@JacksonXmlProperty(isAttribute = true)
@JsonProperty("type")
val type: String? = null,

@JacksonXmlProperty(isAttribute = true)
@JsonProperty("value")
val value: String? = null
val value: String? = null,
)