From 2f975707c23a92b3bcfb9091102d18aad09e3226 Mon Sep 17 00:00:00 2001 From: minsu20 Date: Sun, 3 Dec 2023 22:53:57 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EC=86=8C=EB=AA=A8=EC=9E=84=20=EA=B0=9C?= =?UTF-8?q?=EC=88=98=20=EB=B3=B4=EB=82=BC=20=EB=95=8C=20=EC=9C=A0=EC=A0=80?= =?UTF-8?q?=20=EB=8B=89=EB=84=A4=EC=9E=84=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../team/application/dto/response/GetTeamCountResponse.java | 5 +++++ .../domain/team/application/service/GetTeamUseCase.java | 4 +++- .../backend/domain/team/presentation/TeamControllerTest.java | 4 +++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/moing/backend/domain/team/application/dto/response/GetTeamCountResponse.java b/src/main/java/com/moing/backend/domain/team/application/dto/response/GetTeamCountResponse.java index ff627afc..e6ad022b 100644 --- a/src/main/java/com/moing/backend/domain/team/application/dto/response/GetTeamCountResponse.java +++ b/src/main/java/com/moing/backend/domain/team/application/dto/response/GetTeamCountResponse.java @@ -13,11 +13,16 @@ public class GetTeamCountResponse { private String teamName; private Long numOfTeam; private String leaderName; + private String memberName; public void updateCount(Long count){ this.numOfTeam=count; } + public void updateMemberName(String nickName){ + this.memberName=memberName; + } + @QueryProjection public GetTeamCountResponse(String teamName, String leaderName){ this.teamName=teamName; diff --git a/src/main/java/com/moing/backend/domain/team/application/service/GetTeamUseCase.java b/src/main/java/com/moing/backend/domain/team/application/service/GetTeamUseCase.java index 74700bc0..d81edcba 100644 --- a/src/main/java/com/moing/backend/domain/team/application/service/GetTeamUseCase.java +++ b/src/main/java/com/moing/backend/domain/team/application/service/GetTeamUseCase.java @@ -50,6 +50,8 @@ public Page getNewTeam(String dateSort, Pageable pageable) { public GetTeamCountResponse getTeamCount(String socialId, Long teamId) { Member member = memberGetService.getMemberBySocialId(socialId); - return teamGetService.getTeamCountAndName(teamId, member.getMemberId()); + GetTeamCountResponse response= teamGetService.getTeamCountAndName(teamId, member.getMemberId()); + response.updateMemberName(member.getNickName()); + return response; } } diff --git a/src/test/java/com/moing/backend/domain/team/presentation/TeamControllerTest.java b/src/test/java/com/moing/backend/domain/team/presentation/TeamControllerTest.java index fd30a521..7306ffe0 100644 --- a/src/test/java/com/moing/backend/domain/team/presentation/TeamControllerTest.java +++ b/src/test/java/com/moing/backend/domain/team/presentation/TeamControllerTest.java @@ -521,6 +521,7 @@ public void get_team_count() throws Exception { .teamName("소모임 이름") .numOfTeam(2L) .leaderName("소모임장 이름") + .memberName("멤버 이름") .build(); given(getTeamUseCase.getTeamCount(any(), any())).willReturn(output); @@ -550,7 +551,8 @@ public void get_team_count() throws Exception { fieldWithPath("message").description("소모임을 수정했습니다."), fieldWithPath("data.teamName").description("소모임 이름"), fieldWithPath("data.numOfTeam").description("지금까지 가입한 소모임 개수"), - fieldWithPath("data.leaderName").description("소모임장 이름") + fieldWithPath("data.leaderName").description("소모임장 이름"), + fieldWithPath("data.memberName").description("유저 닉네임") ) ) );