diff --git a/src/main/java/com/gdsc/remine/declaration/dto/response/PrivateDeclarationElements.java b/src/main/java/com/gdsc/remine/declaration/dto/response/PrivateDeclarationElements.java index 96b8e6f..e9747ef 100644 --- a/src/main/java/com/gdsc/remine/declaration/dto/response/PrivateDeclarationElements.java +++ b/src/main/java/com/gdsc/remine/declaration/dto/response/PrivateDeclarationElements.java @@ -12,10 +12,12 @@ @NoArgsConstructor @AllArgsConstructor public class PrivateDeclarationElements { + private String memberName; private Long todayParticipantsCount; private List declarationList; public static PrivateDeclarationElements from( + String memberName, Long todayParticipantsCount, List declarationList ) { @@ -23,6 +25,10 @@ public static PrivateDeclarationElements from( PrivateDeclarationElement::new ).collect(Collectors.toList()); - return new PrivateDeclarationElements(todayParticipantsCount, declarationElementList); + return new PrivateDeclarationElements( + memberName, + todayParticipantsCount, + declarationElementList + ); } } diff --git a/src/main/java/com/gdsc/remine/declaration/service/DeclarationService.java b/src/main/java/com/gdsc/remine/declaration/service/DeclarationService.java index 2a5a75a..20e7d65 100644 --- a/src/main/java/com/gdsc/remine/declaration/service/DeclarationService.java +++ b/src/main/java/com/gdsc/remine/declaration/service/DeclarationService.java @@ -42,18 +42,19 @@ public PrivateDeclarationElement uploadDeclaration( } public PrivateDeclarationElements getDeclarationInWeek() { - final Long loginMemberId = authTokensGenerator.getLoginMemberId(); + final Member loginMember = authTokensGenerator.getLoginMember(); final LocalDateTime oneWeekAgo = getOneWeekAgoDate(); final List declarationList = declarationRepository.findInRecent7Day( oneWeekAgo, - loginMemberId + loginMember.getId() ); final LocalDateTime oneDayAgo = getOneDayAgoDate(); final Long count = declarationRepository.countInRecent1Day(oneDayAgo); return PrivateDeclarationElements.from( + loginMember.getName(), count, declarationList );