diff --git a/src/main/java/com/moing/backend/domain/member/dto/response/UserProperty.java b/src/main/java/com/moing/backend/domain/member/dto/response/UserProperty.java new file mode 100644 index 00000000..14eaa609 --- /dev/null +++ b/src/main/java/com/moing/backend/domain/member/dto/response/UserProperty.java @@ -0,0 +1,18 @@ +package com.moing.backend.domain.member.dto.response; + +import com.moing.backend.domain.member.domain.constant.Gender; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; + +import java.time.LocalDate; + +@Builder +@AllArgsConstructor +@NoArgsConstructor +@Getter +public class UserProperty { + private Gender gender; + private LocalDate birthDate; +} diff --git a/src/main/java/com/moing/backend/domain/team/application/dto/response/GetTeamResponse.java b/src/main/java/com/moing/backend/domain/team/application/dto/response/GetTeamResponse.java index bad378b3..3bacdbe8 100644 --- a/src/main/java/com/moing/backend/domain/team/application/dto/response/GetTeamResponse.java +++ b/src/main/java/com/moing/backend/domain/team/application/dto/response/GetTeamResponse.java @@ -1,5 +1,7 @@ package com.moing.backend.domain.team.application.dto.response; +import com.moing.backend.domain.member.domain.entity.Member; +import com.moing.backend.domain.member.dto.response.UserProperty; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Getter; @@ -16,13 +18,16 @@ public class GetTeamResponse { private String memberNickName; private Integer numOfTeam; private List teamBlocks = new ArrayList<>(); + private UserProperty userProperty; public GetTeamResponse(Integer numOfTeam, List teamBlocks) { this.numOfTeam=numOfTeam; this.teamBlocks = teamBlocks; } - public void updateMemberNickName(String memberNickName) { - this.memberNickName=memberNickName; + public void updateMemberInfo(Member member) { + this.memberNickName=member.getNickName(); + this.userProperty=new UserProperty(member.getGender(), member.getBirthDate()); + } } diff --git a/src/main/java/com/moing/backend/domain/team/domain/service/TeamGetService.java b/src/main/java/com/moing/backend/domain/team/domain/service/TeamGetService.java index 360190f4..a89d672e 100644 --- a/src/main/java/com/moing/backend/domain/team/domain/service/TeamGetService.java +++ b/src/main/java/com/moing/backend/domain/team/domain/service/TeamGetService.java @@ -26,7 +26,7 @@ public class TeamGetService { public GetTeamResponse getTeamByMember(Member member) { GetTeamResponse getTeamResponse = teamRepository.findTeamByMemberId(member.getMemberId()); - getTeamResponse.updateMemberNickName(member.getNickName()); + getTeamResponse.updateMemberInfo(member); return getTeamResponse; } 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 7ccf996b..93a3fb28 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 @@ -1,6 +1,8 @@ package com.moing.backend.domain.team.presentation; import com.moing.backend.config.CommonControllerTest; +import com.moing.backend.domain.member.domain.constant.Gender; +import com.moing.backend.domain.member.dto.response.UserProperty; import com.moing.backend.domain.team.application.dto.request.CreateTeamRequest; import com.moing.backend.domain.team.application.dto.request.UpdateTeamRequest; import com.moing.backend.domain.team.application.dto.response.*; @@ -12,6 +14,7 @@ import org.springframework.restdocs.mockmvc.RestDocumentationRequestBuilders; import org.springframework.test.web.servlet.ResultActions; +import java.time.LocalDate; import java.time.LocalDateTime; import java.util.ArrayList; import java.util.List; @@ -129,10 +132,12 @@ public void get_team() throws Exception { teamBlocks.add(teamBlock1); teamBlocks.add(teamBlock2); + UserProperty userProperty=new UserProperty(Gender.WOMAN, LocalDate.of(2000, 3, 28)); GetTeamResponse output = GetTeamResponse.builder() .numOfTeam(1) .memberNickName("유저 닉네임") .teamBlocks(teamBlocks) + .userProperty(userProperty) .build(); given(getTeamUseCase.getTeam(any())).willReturn(output); @@ -167,7 +172,9 @@ public void get_team() throws Exception { fieldWithPath("data.teamBlocks[].category").description("소모임 카테고리"), fieldWithPath("data.teamBlocks[].startDate").description("소모임 시작일"), fieldWithPath("data.teamBlocks[].deletionTime").description("소모임 삭제 시간 (삭제 안했으면 null)"), - fieldWithPath("data.teamBlocks[].profileImgUrl").description("프로필 사진 url") + fieldWithPath("data.teamBlocks[].profileImgUrl").description("프로필 사진 url"), + fieldWithPath("data.userProperty.gender").description("유저 성별"), + fieldWithPath("data.userProperty.birthDate").description("유저 태어난 날") ) )