기본 생성자 없는 data class에 @JsonProperty를 추가하여 Jackson에서 직렬화 할 수 있도록 수정

This commit is contained in:
2023-10-17 18:11:56 +09:00
parent e5c85287bb
commit cda2f1ec36
4 changed files with 27 additions and 22 deletions

View File

@@ -1,18 +1,19 @@
package kr.co.vividnext.sodalive.event
import com.fasterxml.jackson.annotation.JsonProperty
import com.querydsl.core.annotations.QueryProjection
data class GetEventResponse(
val totalCount: Int,
val eventList: List<EventItem>
@JsonProperty("totalCount") val totalCount: Int,
@JsonProperty("eventList") val eventList: List<EventItem>
)
data class EventItem @QueryProjection constructor(
val id: Long,
val title: String? = null,
var thumbnailImageUrl: String,
var detailImageUrl: String? = null,
var popupImageUrl: String? = null,
val link: String? = null,
val isPopup: Boolean
@JsonProperty("id") val id: Long,
@JsonProperty("title") val title: String? = null,
@JsonProperty("thumbnailImageUrl") var thumbnailImageUrl: String,
@JsonProperty("detailImageUrl") var detailImageUrl: String? = null,
@JsonProperty("popupImageUrl") var popupImageUrl: String? = null,
@JsonProperty("link") val link: String? = null,
@JsonProperty("isPopup") val isPopup: Boolean
)