diff --git a/server/api/src/main/kotlin/com/kw/api/domain/bundle/dto/response/BundleDetailResponse.kt b/server/api/src/main/kotlin/com/kw/api/domain/bundle/dto/response/BundleDetailResponse.kt index 2bac0ce..a0b5b97 100644 --- a/server/api/src/main/kotlin/com/kw/api/domain/bundle/dto/response/BundleDetailResponse.kt +++ b/server/api/src/main/kotlin/com/kw/api/domain/bundle/dto/response/BundleDetailResponse.kt @@ -12,9 +12,10 @@ data class BundleDetailResponse( val shareType: String, val tags: List? = null, val questions: List? = 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): BundleDetailResponse { @@ -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 ) diff --git a/server/api/src/main/kotlin/com/kw/api/domain/bundle/dto/response/BundleResponse.kt b/server/api/src/main/kotlin/com/kw/api/domain/bundle/dto/response/BundleResponse.kt index 8441160..581ffc0 100644 --- a/server/api/src/main/kotlin/com/kw/api/domain/bundle/dto/response/BundleResponse.kt +++ b/server/api/src/main/kotlin/com/kw/api/domain/bundle/dto/response/BundleResponse.kt @@ -12,6 +12,7 @@ data class BundleResponse( val tags: List, val isHot: Boolean, val originId: Long? = null, + val writerId: Long, val createdAt: LocalDateTime, val updatedAt: LocalDateTime ) { @@ -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 ) diff --git a/server/api/src/main/kotlin/com/kw/api/domain/bundle/service/BundleService.kt b/server/api/src/main/kotlin/com/kw/api/domain/bundle/service/BundleService.kt index a57a730..a415a56 100644 --- a/server/api/src/main/kotlin/com/kw/api/domain/bundle/service/BundleService.kt +++ b/server/api/src/main/kotlin/com/kw/api/domain/bundle/service/BundleService.kt @@ -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!!, ) } diff --git a/server/api/src/main/kotlin/com/kw/api/domain/question/dto/response/QuestionResponse.kt b/server/api/src/main/kotlin/com/kw/api/domain/question/dto/response/QuestionResponse.kt index 7860d40..cde02d8 100644 --- a/server/api/src/main/kotlin/com/kw/api/domain/question/dto/response/QuestionResponse.kt +++ b/server/api/src/main/kotlin/com/kw/api/domain/question/dto/response/QuestionResponse.kt @@ -13,6 +13,7 @@ data class QuestionResponse( val originId: Long?, val tags: List, val isHot: Boolean, + val writerId: Long, val createdAt: LocalDateTime, val updatedAt: LocalDateTime ) { @@ -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 )