-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor/#819 member 반환값 변경
- Loading branch information
Showing
7 changed files
with
84 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
backend/emm-sale/src/main/java/com/emmsale/member/application/dto/MemberDetailResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package com.emmsale.member.application.dto; | ||
|
||
import static java.util.stream.Collectors.toUnmodifiableList; | ||
|
||
import com.emmsale.member.domain.Member; | ||
import com.emmsale.member.domain.MemberActivity; | ||
import java.util.List; | ||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
@RequiredArgsConstructor | ||
@Getter | ||
public class MemberDetailResponse { | ||
|
||
private static final String GITHUB_URL_PREFIX = "https://github.com/"; | ||
|
||
private final Long id; | ||
private final String name; | ||
private final String description; | ||
private final String imageUrl; | ||
private final String githubUrl; | ||
private final List<MemberActivityResponse> activities; | ||
|
||
public static MemberDetailResponse of( | ||
final Member member, | ||
final List<MemberActivity> activities | ||
) { | ||
final List<MemberActivityResponse> memberActivityResponses = activities.stream() | ||
.map(MemberActivityResponse::from) | ||
.collect(toUnmodifiableList()); | ||
|
||
return new MemberDetailResponse( | ||
member.getId(), | ||
member.getName(), | ||
member.getDescription(), | ||
member.getImageUrl(), | ||
GITHUB_URL_PREFIX + member.getGithubUsername(), | ||
memberActivityResponses | ||
); | ||
} | ||
} |
28 changes: 0 additions & 28 deletions
28
backend/emm-sale/src/main/java/com/emmsale/member/application/dto/MemberProfileResponse.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters