Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor: Post 리스트 조회시 다이어리 글에 포함된 이미지 url도 함께 반환하도록 수정 #72

Merged
merged 1 commit into from
Aug 2, 2024
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 @@ -15,7 +15,6 @@ public static Post toPost(PostRequestDTO.CreatePostRequestDTO request) {
// List<Categories> 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())
Expand All @@ -29,7 +28,6 @@ public static PostResponseDTO.CreatePostResultDTO toCreateResultDTO(Post post) {
// List<String> postCategories = post.getCategoriesList().stream()
// .map(Categories::getName)
// .collect(Collectors.toList());

return PostResponseDTO.CreatePostResultDTO.builder()
.postId(post.getPostId())
.memberId(post.getMember().getMemberId())
Expand Down Expand Up @@ -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();
}

Expand All @@ -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();
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,10 @@ public static class PostPreviewDTO { // Post 조회
Boolean postStatus;
String postCategory;
Set<Long> coauthorIds;
PostAccess postAccess;
PostFileResponseDTO.PostFileListDTO postFileList;
LocalDateTime createdAt;
LocalDateTime updatedAt;
PostAccess postAccess;
}

@Getter
Expand Down Expand Up @@ -97,6 +98,7 @@ public static class MemberPostPreviewDTO { // 저자별 Post 조회
String postCategory;
Set<Long> coauthorIds;
PostAccess postAccess;
PostFileResponseDTO.PostFileListDTO postFileList;
LocalDateTime createdAt;
LocalDateTime updatedAt;
}
Expand Down Expand Up @@ -130,6 +132,7 @@ public static class TeamPostPreviewDTO { // 팀별 Post 조회
String postCategory;
Set<Long> coauthorIds;
PostAccess postAccess;
PostFileResponseDTO.PostFileListDTO postFileList;
LocalDateTime createdAt;
LocalDateTime updatedAt;
}
Expand Down Expand Up @@ -162,6 +165,7 @@ public static class MemberPostInProjectPreviewDTO { // 프로젝트별 저자의
String postCategory;
Set<Long> coauthorIds;
PostAccess postAccess;
PostFileResponseDTO.PostFileListDTO postFileList;
LocalDateTime createdAt;
LocalDateTime updatedAt;
}
Expand Down Expand Up @@ -194,6 +198,7 @@ public static class TeamPostInProjectPreviewDTO { // 프로젝트별 팀의 Post
String postCategory;
Set<Long> coauthorIds;
PostAccess postAccess;
PostFileResponseDTO.PostFileListDTO postFileList;
LocalDateTime createdAt;
LocalDateTime updatedAt;
}
Expand Down Expand Up @@ -226,6 +231,7 @@ public static class MemberPostInTeamPreviewDTO { // 팀별 멤버의 Post 조회
String postCategory;
Set<Long> coauthorIds;
PostAccess postAccess;
PostFileResponseDTO.PostFileListDTO postFileList;
LocalDateTime createdAt;
LocalDateTime updatedAt;
}
Expand Down Expand Up @@ -268,9 +274,10 @@ public static class PostAdjacentPreviewDTO {
Boolean postStatus;
String postCategory;
Set<Long> coauthorIds;
PostAccess postAccess;
PostFileResponseDTO.PostFileListDTO postFileList;
LocalDateTime createdAt;
LocalDateTime updatedAt;
PostAccess postAccess;
}
}

Expand Down
Loading