Skip to content

Commit

Permalink
Merge pull request #112 from DaITssu/feat/comment
Browse files Browse the repository at this point in the history
[마이페이지] 댓글에 원글의 Title, topic, id도 함께 출력
  • Loading branch information
HwanGonJang authored Feb 2, 2024
2 parents 1a78939 + 91410ea commit 07ba913
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.example.daitssuapi.domain.article.dto.response

import com.example.daitssuapi.domain.article.enums.Topic
import com.example.daitssuapi.domain.article.model.entity.Comment
import java.time.LocalDateTime

Expand All @@ -10,7 +11,10 @@ data class CommentResponse(
val content: String,
val originalCommentId: Long? = null,
val createdAt: LocalDateTime,
val updatedAt: LocalDateTime
val updatedAt: LocalDateTime,
val title: String? = null,
val topic: Topic? = null,
val articleId: Long? = null
) {
companion object {
fun of(comment: Comment): CommentResponse = with(comment) {
Expand All @@ -21,7 +25,10 @@ data class CommentResponse(
content = content,
originalCommentId = originalId,
createdAt = createdAt,
updatedAt = updatedAt
updatedAt = updatedAt,
title = article?.title,
topic = article?.topic,
articleId = article?.id
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ class AuthController(
private val userService: UserService,
private val argumentResolver: ArgumentResolver
) {
@GetMapping
fun ping(): String {
return "pong"
}

@Operation(
summary = "회원가입",
description = "회원가입 API입니다.",
Expand Down

0 comments on commit 07ba913

Please sign in to comment.