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

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

View File

@ -1,5 +1,6 @@
package kr.co.vividnext.sodalive.content.main
import com.fasterxml.jackson.annotation.JsonProperty
import com.querydsl.core.annotations.QueryProjection
data class GetAudioContentRanking(
@ -9,12 +10,12 @@ data class GetAudioContentRanking(
)
data class GetAudioContentRankingItem @QueryProjection constructor(
val contentId: Long,
val title: String,
val coverImageUrl: String,
val themeStr: String,
val price: Int,
val duration: String,
val creatorId: Long,
val creatorNickname: String
@JsonProperty("contentId") val contentId: Long,
@JsonProperty("title") val title: String,
@JsonProperty("coverImageUrl") val coverImageUrl: String,
@JsonProperty("themeStr") val themeStr: String,
@JsonProperty("price") val price: Int,
@JsonProperty("duration") val duration: String,
@JsonProperty("creatorId") val creatorId: Long,
@JsonProperty("creatorNickname") val creatorNickname: String
)

View File

@ -1,9 +1,10 @@
package kr.co.vividnext.sodalive.content.main
import com.fasterxml.jackson.annotation.JsonProperty
import com.querydsl.core.annotations.QueryProjection
data class GetNewContentUploadCreator @QueryProjection constructor(
val creatorId: Long,
val creatorNickname: String,
val creatorProfileImageUrl: String
@JsonProperty("creatorId") val creatorId: Long,
@JsonProperty("creatorNickname") val creatorNickname: String,
@JsonProperty("creatorProfileImageUrl") val creatorProfileImageUrl: String
)

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
)

View File

@ -1,6 +1,8 @@
package kr.co.vividnext.sodalive.live.recommend
import com.fasterxml.jackson.annotation.JsonProperty
data class GetRecommendLiveResponse(
val imageUrl: String,
val creatorId: Long
@JsonProperty("imageUrl") val imageUrl: String,
@JsonProperty("creatorId") val creatorId: Long
)