diff --git a/src/main/java/com/codiary/backend/global/converter/PostConverter.java b/src/main/java/com/codiary/backend/global/converter/PostConverter.java index c8b16f88..52acae22 100644 --- a/src/main/java/com/codiary/backend/global/converter/PostConverter.java +++ b/src/main/java/com/codiary/backend/global/converter/PostConverter.java @@ -15,7 +15,6 @@ public static Post toPost(PostRequestDTO.CreatePostRequestDTO request) { // List categories = request.getPostCategory().stream() // .map(Categories::new) // Assuming Categories has a constructor that accepts String // .collect(Collectors.toList()); - return Post.builder() .postTitle(request.getPostTitle()) .postBody(request.getPostBody()) @@ -29,7 +28,6 @@ public static PostResponseDTO.CreatePostResultDTO toCreateResultDTO(Post post) { // List postCategories = post.getCategoriesList().stream() // .map(Categories::getName) // .collect(Collectors.toList()); - return PostResponseDTO.CreatePostResultDTO.builder() .postId(post.getPostId()) .memberId(post.getMember().getMemberId()) @@ -65,6 +63,7 @@ public static PostResponseDTO.UpdatePostResultDTO toUpdatePostResultDTO(Post pos .map(author -> author.getMember().getMemberId()) .collect(Collectors.toSet())) .postAccess(post.getPostAccess()) + .postFileList(PostFileConverter.toPostFileListDTO(post.getPostFileList())) .build(); } @@ -87,6 +86,7 @@ public static PostResponseDTO.PostPreviewDTO toPostPreviewDTO(Post post) { .map(author -> author.getMember().getMemberId()) .collect(Collectors.toSet())) .postAccess(post.getPostAccess()) + .postFileList(PostFileConverter.toPostFileListDTO(post.getPostFileList())) .createdAt(post.getCreatedAt()) .updatedAt(post.getUpdatedAt()) .build(); @@ -127,6 +127,7 @@ public static PostResponseDTO.MemberPostPreviewDTO toMemberPostPreviewDTO(Post p .map(author -> author.getMember().getMemberId()) .collect(Collectors.toSet())) .postAccess(post.getPostAccess()) + .postFileList(PostFileConverter.toPostFileListDTO(post.getPostFileList())) .createdAt(post.getCreatedAt()) .updatedAt(post.getUpdatedAt()) .build(); @@ -167,6 +168,7 @@ public static PostResponseDTO.TeamPostPreviewDTO toTeamPostPreviewDTO(Post post) .map(author -> author.getMember().getMemberId()) .collect(Collectors.toSet())) .postAccess(post.getPostAccess()) + .postFileList(PostFileConverter.toPostFileListDTO(post.getPostFileList())) .createdAt(post.getCreatedAt()) .updatedAt(post.getUpdatedAt()) .build(); @@ -208,6 +210,7 @@ public static PostResponseDTO.MemberPostInProjectPreviewDTO toMemberPostInProjec .map(author -> author.getMember().getMemberId()) .collect(Collectors.toSet())) .postAccess(post.getPostAccess()) + .postFileList(PostFileConverter.toPostFileListDTO(post.getPostFileList())) .createdAt(post.getCreatedAt()) .updatedAt(post.getUpdatedAt()) .build(); @@ -248,6 +251,7 @@ public static PostResponseDTO.TeamPostInProjectPreviewDTO toTeamPostInProjectPre .map(author -> author.getMember().getMemberId()) .collect(Collectors.toSet())) .postAccess(post.getPostAccess()) + .postFileList(PostFileConverter.toPostFileListDTO(post.getPostFileList())) .createdAt(post.getCreatedAt()) .updatedAt(post.getUpdatedAt()) .build(); @@ -288,6 +292,7 @@ public static PostResponseDTO.MemberPostInTeamPreviewDTO toMemberPostInTeamPrevi .map(author -> author.getMember().getMemberId()) .collect(Collectors.toSet())) .postAccess(post.getPostAccess()) + .postFileList(PostFileConverter.toPostFileListDTO(post.getPostFileList())) .createdAt(post.getCreatedAt()) .updatedAt(post.getUpdatedAt()) .build(); @@ -330,6 +335,7 @@ public static PostResponseDTO.PostAdjacentDTO.PostAdjacentPreviewDTO toPostAdjac .map(author -> author.getMember().getMemberId()) .collect(Collectors.toSet())) .postAccess(post.getPostAccess()) + .postFileList(PostFileConverter.toPostFileListDTO(post.getPostFileList())) .createdAt(post.getCreatedAt()) .updatedAt(post.getUpdatedAt()) .build(); @@ -363,6 +369,7 @@ public static PostResponseDTO.UpdatePostResultDTO toSetPostCategoriesResultDTO(P .map(author -> author.getMember().getMemberId()) .collect(Collectors.toSet())) .postAccess(post.getPostAccess()) + .postFileList(PostFileConverter.toPostFileListDTO(post.getPostFileList())) .build(); } diff --git a/src/main/java/com/codiary/backend/global/web/dto/Post/PostResponseDTO.java b/src/main/java/com/codiary/backend/global/web/dto/Post/PostResponseDTO.java index bd36c2df..10e52d9f 100644 --- a/src/main/java/com/codiary/backend/global/web/dto/Post/PostResponseDTO.java +++ b/src/main/java/com/codiary/backend/global/web/dto/Post/PostResponseDTO.java @@ -64,9 +64,10 @@ public static class PostPreviewDTO { // Post 조회 Boolean postStatus; String postCategory; Set coauthorIds; + PostAccess postAccess; + PostFileResponseDTO.PostFileListDTO postFileList; LocalDateTime createdAt; LocalDateTime updatedAt; - PostAccess postAccess; } @Getter @@ -97,6 +98,7 @@ public static class MemberPostPreviewDTO { // 저자별 Post 조회 String postCategory; Set coauthorIds; PostAccess postAccess; + PostFileResponseDTO.PostFileListDTO postFileList; LocalDateTime createdAt; LocalDateTime updatedAt; } @@ -130,6 +132,7 @@ public static class TeamPostPreviewDTO { // 팀별 Post 조회 String postCategory; Set coauthorIds; PostAccess postAccess; + PostFileResponseDTO.PostFileListDTO postFileList; LocalDateTime createdAt; LocalDateTime updatedAt; } @@ -162,6 +165,7 @@ public static class MemberPostInProjectPreviewDTO { // 프로젝트별 저자의 String postCategory; Set coauthorIds; PostAccess postAccess; + PostFileResponseDTO.PostFileListDTO postFileList; LocalDateTime createdAt; LocalDateTime updatedAt; } @@ -194,6 +198,7 @@ public static class TeamPostInProjectPreviewDTO { // 프로젝트별 팀의 Post String postCategory; Set coauthorIds; PostAccess postAccess; + PostFileResponseDTO.PostFileListDTO postFileList; LocalDateTime createdAt; LocalDateTime updatedAt; } @@ -226,6 +231,7 @@ public static class MemberPostInTeamPreviewDTO { // 팀별 멤버의 Post 조회 String postCategory; Set coauthorIds; PostAccess postAccess; + PostFileResponseDTO.PostFileListDTO postFileList; LocalDateTime createdAt; LocalDateTime updatedAt; } @@ -268,9 +274,10 @@ public static class PostAdjacentPreviewDTO { Boolean postStatus; String postCategory; Set coauthorIds; + PostAccess postAccess; + PostFileResponseDTO.PostFileListDTO postFileList; LocalDateTime createdAt; LocalDateTime updatedAt; - PostAccess postAccess; } }