Skip to content
This repository was archived by the owner on Jan 11, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ public StudyPostResDTO.PostDetailDTO getPost(Long studyId, Long postId) {

Integer commentNum = studyPostCommentRepository.findAllByStudyPostId(postId).size();
boolean isLiked = studyLikedPostRepository.existsByMemberIdAndStudyPostId(memberId, studyPost.getId());

return StudyPostResDTO.PostDetailDTO.toDTO(studyPost, commentNum, isLiked);
boolean isWriter = studyPost.getMember().getId().equals(memberId);
return StudyPostResDTO.PostDetailDTO.toDTO(studyPost, commentNum, isLiked, isWriter);
}

/* ----------------------------- 스터디 게시글 댓글 관련 API ------------------------------------- */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,10 @@ public static class PostDetailDTO {
private final Integer hitNum;
private final Integer commentNum;
private final Boolean isLiked;
private final Boolean isWriter;
private final List<ImageDTO> studyPostImages;

public static PostDetailDTO toDTO(StudyPost studyPost, Integer commentNum, boolean isLiked) {
public static PostDetailDTO toDTO(StudyPost studyPost, Integer commentNum, boolean isLiked, boolean isWriter) {
return PostDetailDTO.builder()
.member(PostMemberDTO.toDTO(studyPost.getMember()))
.postId(studyPost.getId())
Expand All @@ -114,6 +115,7 @@ public static PostDetailDTO toDTO(StudyPost studyPost, Integer commentNum, boole
.hitNum(studyPost.getHitNum())
.commentNum(commentNum)
.isLiked(isLiked)
.isWriter(isWriter)
.studyPostImages(studyPost.getImages().stream()
.map(ImageDTO::toDTO)
.toList())
Expand Down