From 2ea80b25bacd35c0d36e65ec0460db2428f219e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9C=A4=EC=A4=80=EC=84=9D=28YunJunSeok=29?= <83647215+junseok0304@users.noreply.github.com> Date: Sun, 28 Dec 2025 23:18:34 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20Mypage=20=EB=8C=80=EC=8B=9C=EB=B3=B4?= =?UTF-8?q?=EB=93=9C=20=EA=B4=80=EB=A0=A8=20Dto=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit FE요청사항반영: 썸네일 URL반환 항목 추가 --- .../nexus/app/mypage/dto/RecentlyViewedTestDto.java | 1 + .../nexus/app/mypage/service/MyPageService.java | 13 +++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) 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(); }