Skip to content

Commit

Permalink
feat : 응답 dto에 postType 추가해 회고일지/커뮤니티 구분
Browse files Browse the repository at this point in the history
  • Loading branch information
jeong724 committed Jan 13, 2025
1 parent 72f41d3 commit 5263b6c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/java/itstime/reflog/community/dto/CommunityDto.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import itstime.reflog.comment.dto.CommentDto;
import itstime.reflog.community.domain.Community;
import itstime.reflog.postlike.domain.enums.PostType;
import itstime.reflog.retrospect.domain.Retrospect;
import lombok.*;

Expand Down Expand Up @@ -46,6 +47,7 @@ public static class CombinedCategoryResponse {
private int totalLike;
private Long totalComment;
private Long postId;
private PostType postType;

public static CombinedCategoryResponse fromCommunity(Community community, String writer, Boolean isLike, Integer totalLike, Long totalComment) {
return CombinedCategoryResponse.builder()
Expand All @@ -59,6 +61,7 @@ public static CombinedCategoryResponse fromCommunity(Community community, String
.totalLike(totalLike)
.writer(writer)
.postId(community.getId())
.postType(PostType.COMMUNITY)
.build();
}

Expand All @@ -77,6 +80,7 @@ public static CombinedCategoryResponse fromRetrospect(Retrospect retrospect, Str
.totalComment(totalComment)
.writer(writer)
.postId(retrospect.getId())
.postType(PostType.RETROSPECT)
.build();
}
}
Expand Down

0 comments on commit 5263b6c

Please sign in to comment.