기본 생성자 없는 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 package kr.co.vividnext.sodalive.content.main
import com.fasterxml.jackson.annotation.JsonProperty
import com.querydsl.core.annotations.QueryProjection import com.querydsl.core.annotations.QueryProjection
data class GetAudioContentRanking( data class GetAudioContentRanking(
@ -9,12 +10,12 @@ data class GetAudioContentRanking(
) )
data class GetAudioContentRankingItem @QueryProjection constructor( data class GetAudioContentRankingItem @QueryProjection constructor(
val contentId: Long, @JsonProperty("contentId") val contentId: Long,
val title: String, @JsonProperty("title") val title: String,
val coverImageUrl: String, @JsonProperty("coverImageUrl") val coverImageUrl: String,
val themeStr: String, @JsonProperty("themeStr") val themeStr: String,
val price: Int, @JsonProperty("price") val price: Int,
val duration: String, @JsonProperty("duration") val duration: String,
val creatorId: Long, @JsonProperty("creatorId") val creatorId: Long,
val creatorNickname: String @JsonProperty("creatorNickname") val creatorNickname: String
) )

View File

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

View File

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

View File

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