기본 생성자 없는 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,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
)