Skip to content

Commit

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ data class QuestionResponse(
val originId: Long?,
val tags: List<TagResponse>,
val isHot: Boolean,
val writerId: Long,
val createdAt: LocalDateTime,
val updatedAt: LocalDateTime
) {
Expand All @@ -27,6 +28,7 @@ data class QuestionResponse(
originId = question.originId,
tags = question.questionTags.map { it.tag }.map { TagResponse.from(it) },
isHot = question.isHot(),
writerId = question.member.id!!,
createdAt = question.createdAt,
updatedAt = question.updatedAt
)
Expand Down

0 comments on commit a76b8ac

Please sign in to comment.