diff --git a/src/main/java/com/example/nexus/app/mypage/dto/RecentlyViewedTestDto.java b/src/main/java/com/example/nexus/app/mypage/dto/RecentlyViewedTestDto.java index fa77f917..fb0dc2f2 100644 --- a/src/main/java/com/example/nexus/app/mypage/dto/RecentlyViewedTestDto.java +++ b/src/main/java/com/example/nexus/app/mypage/dto/RecentlyViewedTestDto.java @@ -12,6 +12,7 @@ public class RecentlyViewedTestDto { private String category; private String title; private String oneLineIntro; + private String thumbnailUrl; private List tags; private LocalDateTime viewedAt; } diff --git a/src/main/java/com/example/nexus/app/mypage/service/MyPageService.java b/src/main/java/com/example/nexus/app/mypage/service/MyPageService.java index bef64b84..3a38de68 100644 --- a/src/main/java/com/example/nexus/app/mypage/service/MyPageService.java +++ b/src/main/java/com/example/nexus/app/mypage/service/MyPageService.java @@ -55,6 +55,7 @@ public DashboardDto getDashboardData(Long userId) { .category(post.getMainCategory().stream().map(Enum::toString).collect(Collectors.joining(", "))) .title(post.getTitle()) .oneLineIntro(post.getServiceSummary()) + .thumbnailUrl(post.getThumbnailUrl()) .tags(post.getGenreCategories().stream().map(Enum::toString).collect(Collectors.toList())) .viewedAt(recentView.getViewedAt()) .build(); @@ -100,7 +101,7 @@ public TotalParticipationDto getTotalParticipationData(Long userId) { List participated = participationRepository.findByUserIdAndStatusWithPost(userId, ParticipationStatus.APPROVED, Pageable.unpaged()).getContent(); - List participatedPosts = participated.stream().map(Participation::getPost).collect(Collectors.toList()); + List participatedPosts = participated.stream().map(Participation::getPost).toList(); int totalCount = participatedPosts.size(); Map countByCategory = participatedPosts.stream() @@ -133,10 +134,10 @@ public ProfileDto getProfileData(Long userId) { .build(); } - Long testsUploaded = postRepository.countByCreatedBy(userId); - Long testsParticipating = participationRepository.countByUserIdAndStatus(userId, ParticipationStatus.APPROVED); + long testsUploaded = postRepository.countByCreatedBy(userId); + long testsParticipating = participationRepository.countByUserIdAndStatus(userId, ParticipationStatus.APPROVED); - int testsOngoing = testsParticipating.intValue(); + int testsOngoing = (int) testsParticipating; String affiliation = postRepository.findFirstByCreatedByAndStatusOrderByCreatedAtDesc(userId, PostStatus.ACTIVE) .map(Post::getCreatorIntroduction) @@ -146,8 +147,8 @@ public ProfileDto getProfileData(Long userId) { .profileImageUrl(user.getProfileUrl()) .name(user.getNickname()) .affiliation(affiliation) - .testsUploaded(testsUploaded.intValue()) - .testsParticipating(testsParticipating.intValue()) + .testsUploaded((int) testsUploaded) + .testsParticipating((int) testsParticipating) .testsOngoing(testsOngoing) .build(); }