Skip to content

Commit

Permalink
feat: bundle originId 응답 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
annahxxl committed Mar 4, 2024
1 parent 945e7ef commit a72ab4d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ data class BundleDetailResponse(
val tags: List<TagResponse>? = null,
val questions: List<QuestionResponse>? = null,
val createdAt: LocalDateTime? = null,
val updatedAt: LocalDateTime? = null
val updatedAt: LocalDateTime? = null,
val originId: Long? = null
) {
companion object {
fun from(bundle: Bundle, questions: List<Question>): BundleDetailResponse {
Expand All @@ -23,6 +24,7 @@ data class BundleDetailResponse(
shareType = bundle.shareType.name,
tags = bundle.bundleTags.map { it.tag }.map { TagResponse.from(it) },
questions = questions.map { QuestionResponse.from(it) },
originId = bundle.originId,
createdAt = bundle.createdAt,
updatedAt = bundle.updatedAt
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ data class BundleResponse(
val scrapeCount: Long,
val tags: List<TagResponse>,
val isHot: Boolean,
val originId: Long? = null,
val createdAt: LocalDateTime,
val updatedAt: LocalDateTime
) {
Expand All @@ -23,6 +24,7 @@ data class BundleResponse(
scrapeCount = bundle.scrapeCount,
tags = bundle.bundleTags.map { TagResponse.from(it.tag) },
isHot = bundle.isHot(),
originId = bundle.originId,
createdAt = bundle.createdAt,
updatedAt = bundle.updatedAt
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ class BundleService(
return BundleDetailResponse(
id = bundle.id!!,
shareType = bundle.shareType.name,
originId = bundle.originId
)
}

Expand Down

0 comments on commit a72ab4d

Please sign in to comment.