Skip to content

Commit

Permalink
♻️ refactor: 메세지함 조회 데이터 식별자 추가 (#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
loveysuby committed Sep 30, 2024
1 parent 3c60f56 commit c13c147
Showing 1 changed file with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@

import java.util.List;
import slvtwn.khu.toyouserver.domain.RollingPaper;
import slvtwn.khu.toyouserver.domain.Sticker;

public record RollingPaperResponse(String coverImageUrl, String title, String content, Long themeId,
public record RollingPaperResponse(Long id, String coverImageUrl, String title, String content, Long themeId,
List<StickerResponse> stickers) {

public static RollingPaperResponse from(RollingPaper rollingPaper) {
List<StickerResponse> stickerResponses = rollingPaper.getStickers().stream()
.map(StickerResponse::from)
.toList();
public static RollingPaperResponse from(RollingPaper rollingPaper) {
List<StickerResponse> stickerResponses = rollingPaper.getStickers().stream()
.map(StickerResponse::from)
.toList();

return new RollingPaperResponse(rollingPaper.getCoverImageUrl(), rollingPaper.getTitle(),
rollingPaper.getContent(), rollingPaper.getThemeId(), stickerResponses);
}
return new RollingPaperResponse(rollingPaper.getId(), rollingPaper.getCoverImageUrl(), rollingPaper.getTitle(),
rollingPaper.getContent(), rollingPaper.getThemeId(), stickerResponses);
}
}

0 comments on commit c13c147

Please sign in to comment.