Skip to content

Commit

Permalink
hotfix: response dto 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
ori0o0p committed Aug 17, 2024
1 parent 966e3bb commit d6ab6c4
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,19 @@
import java.util.List;

public record DocumentResponse(
IntroduceElement introduce,
IntroduceElementDto introduce,
List<ShardLibrary> recentlyShared
) {
public static DocumentResponse of(DocumentEntity document, List<ShardLibrary> recentlyShared) {
return new DocumentResponse(
document.getIntroduce(),
IntroduceElementDto.fromElement(document.getIntroduce()),
recentlyShared
);
}

record IntroduceElementDto(String heading, String introduce) {
public static IntroduceElementDto fromElement(IntroduceElement element) {
return new IntroduceElementDto(element.getHeading(), element.getIntroduce());
}
}
}

0 comments on commit d6ab6c4

Please sign in to comment.