diff --git a/src/main/java/com/gamemoonchul/infrastructure/web/dto/response/PostMainPageResponse.java b/src/main/java/com/gamemoonchul/infrastructure/web/dto/response/PostMainPageResponse.java index ebcc9714..3304e558 100644 --- a/src/main/java/com/gamemoonchul/infrastructure/web/dto/response/PostMainPageResponse.java +++ b/src/main/java/com/gamemoonchul/infrastructure/web/dto/response/PostMainPageResponse.java @@ -3,13 +3,18 @@ import com.gamemoonchul.application.converter.MemberConverter; import com.gamemoonchul.common.util.StringUtils; import com.gamemoonchul.domain.entity.Post; +import lombok.AccessLevel; +import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Getter; +import lombok.NoArgsConstructor; import java.util.List; @Getter @Builder +@AllArgsConstructor +@NoArgsConstructor(access = AccessLevel.PROTECTED) public class PostMainPageResponse { private Long id; private MemberResponseDto member; @@ -24,16 +29,16 @@ public class PostMainPageResponse { public static PostMainPageResponse entityToResponse(Post entity) { List voteRatio = List.of(100 - entity.getVoteRatio(), entity.getVoteRatio()); return PostMainPageResponse.builder() - .id(entity.getId()) - .member(MemberConverter.toResponseDto(entity.getMember())) - .videoUrl(entity.getVideoUrl()) - .thumbnailUrl(entity.getThumbnailUrl()) - .title(entity.getTitle()) - .content(entity.getContent()) - .viewCount(entity.getViewCount()) - .timesAgo(StringUtils.getTimeAgo(entity.getCreatedAt())) - .voteRatio(voteRatio) - .build(); + .id(entity.getId()) + .member(MemberConverter.toResponseDto(entity.getMember())) + .videoUrl(entity.getVideoUrl()) + .thumbnailUrl(entity.getThumbnailUrl()) + .title(entity.getTitle()) + .content(entity.getContent()) + .viewCount(entity.getViewCount()) + .timesAgo(StringUtils.getTimeAgo(entity.getCreatedAt())) + .voteRatio(voteRatio) + .build(); } -} \ No newline at end of file +}