Skip to content

Commit 1fe34ee

Browse files
authored
Merge pull request #5 from FlipNoteTeam/feat/modify-get-response
Feat: 좋아요, 즐겨찾기 목록 조회 응답 수정
2 parents b2d698f + 677542f commit 1fe34ee

4 files changed

Lines changed: 32 additions & 12 deletions

File tree

src/main/java/flipnote/reaction/bookmark/model/response/BookmarkResponse.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,17 @@
66
import flipnote.reaction.bookmark.entity.Bookmark;
77

88
public record BookmarkResponse(
9-
String targetType,
10-
Long targetId,
11-
Long targetGroupId,
9+
BookmarkTargetResponse target,
1210
LocalDateTime bookmarkedAt
1311
) {
1412
public static BookmarkResponse from(Bookmark bookmark, CardSetSummary summary) {
1513
return new BookmarkResponse(
16-
bookmark.getTargetType().name(),
17-
bookmark.getTargetId(),
18-
summary != null ? summary.getGroupId() : null,
14+
new BookmarkTargetResponse(
15+
bookmark.getTargetType().name(),
16+
bookmark.getTargetId(),
17+
summary != null ? summary.getGroupId() : null,
18+
summary != null ? summary.getName() : null
19+
),
1920
bookmark.getCreatedAt()
2021
);
2122
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package flipnote.reaction.bookmark.model.response;
2+
3+
public record BookmarkTargetResponse(
4+
String type,
5+
Long id,
6+
Long groupId,
7+
String name
8+
) {
9+
}

src/main/java/flipnote/reaction/like/model/response/LikeResponse.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,17 @@
66
import flipnote.reaction.like.entity.Like;
77

88
public record LikeResponse(
9-
String targetType,
10-
Long targetId,
11-
Long targetGroupId,
9+
LikeTargetResponse target,
1210
LocalDateTime likedAt
1311
) {
1412
public static LikeResponse from(Like like, CardSetSummary summary) {
1513
return new LikeResponse(
16-
like.getTargetType().name(),
17-
like.getTargetId(),
18-
summary != null ? summary.getGroupId() : null,
14+
new LikeTargetResponse(
15+
like.getTargetType().name(),
16+
like.getTargetId(),
17+
summary != null ? summary.getGroupId() : null,
18+
summary != null ? summary.getName() : null
19+
),
1920
like.getCreatedAt()
2021
);
2122
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package flipnote.reaction.like.model.response;
2+
3+
public record LikeTargetResponse(
4+
String type,
5+
Long id,
6+
Long groupId,
7+
String name
8+
) {
9+
}

0 commit comments

Comments
 (0)