This commit is contained in:
ParkWonYeop
2025-12-27 17:52:40 +09:00
parent 884853586d
commit 46a8a43163
29 changed files with 646 additions and 149 deletions

View File

@@ -8,6 +8,12 @@ data class CategoryCreateRequest(
val parentId: Long? = null // null이면 최상위(Root) 카테고리
)
// [요청] 카테고리 수정 (이름 + 부모 이동)
data class CategoryUpdateRequest(
val name: String,
val parentId: Long? // null이면 최상위(Root)로 이동
)
// [응답] 카테고리 트리 구조 (재귀)
data class CategoryResponse(
val id: Long,

View File

@@ -8,7 +8,8 @@ data class CommentResponse(
val id: Long,
val content: String,
val author: String,
val isPostAuthor: Boolean, // 👈 [추가] 게시글 작성자 여부
val isPostAuthor: Boolean,
val memberId: Long?,
val createdAt: LocalDateTime,
val children: List<CommentResponse>
) {
@@ -22,7 +23,8 @@ data class CommentResponse(
id = comment.id!!,
content = comment.content,
author = comment.getAuthorName(),
isPostAuthor = isAuthor, // 👈 계산된 값 주입
isPostAuthor = isAuthor,
memberId = comment.member?.id,
createdAt = comment.createdAt,
children = comment.children.map { from(it) }
)

View File

@@ -36,7 +36,8 @@ data class PostSummaryResponse(
val slug: String,
val categoryName: String?,
val viewCount: Long,
val createdAt: LocalDateTime
val createdAt: LocalDateTime,
val content: String?
) {
companion object {
fun from(post: Post): PostSummaryResponse {
@@ -46,7 +47,8 @@ data class PostSummaryResponse(
slug = post.slug,
categoryName = post.category?.name,
viewCount = post.viewCount,
createdAt = post.createdAt
createdAt = post.createdAt,
content = post.content
)
}
}

View File

@@ -0,0 +1,31 @@
package me.wypark.blogbackend.api.dto
import me.wypark.blogbackend.domain.profile.BlogProfile
data class ProfileResponse(
val name: String,
val bio: String,
val imageUrl: String?,
val githubUrl: String?,
val email: String?
) {
companion object {
fun from(profile: BlogProfile): ProfileResponse {
return ProfileResponse(
name = profile.name,
bio = profile.bio,
imageUrl = profile.imageUrl,
githubUrl = profile.githubUrl,
email = profile.email
)
}
}
}
data class ProfileUpdateRequest(
val name: String,
val bio: String,
val imageUrl: String?,
val githubUrl: String?,
val email: String?
)