Skip to content

Commit 18d849d

Browse files
committed
CommentAllResponse에 memberId 추가
1 parent 7ab9c8d commit 18d849d

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

back/src/main/java/com/back/domain/post/comment/dto/CommentAllResponse.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ public record CommentAllResponse(
1010
Long id,
1111
String content,
1212
String authorName,
13-
LocalDateTime createdAt
13+
LocalDateTime createdAt,
14+
Long memberId
1415
) {
1516

1617

@@ -19,7 +20,8 @@ public static CommentAllResponse from(PostComment comment) {
1920
comment.getId(),
2021
comment.getContent(),
2122
comment.getAuthorName(),
22-
comment.getCreateDate()
23+
comment.getCreateDate(),
24+
comment.getAuthorId()
2325
);
2426
}
2527
}

back/src/main/java/com/back/domain/post/comment/entity/PostComment.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ public String getAuthorName() {
3737
return member.getName();
3838
}
3939

40+
public Long getAuthorId() {
41+
return member.getId();
42+
}
43+
4044
@Builder
4145
public PostComment(Post post, String content, Member member, String role) {
4246
this.post = post;

0 commit comments

Comments
 (0)