-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #202 from prgrms-web-devcourse-final-project/develop
qovh
- Loading branch information
Showing
10 changed files
with
83 additions
and
30 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
43 changes: 43 additions & 0 deletions
43
src/main/java/com/mallangs/domain/member/dto/response/MemberGetByOtherResponse.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,43 @@ | ||
package com.mallangs.domain.member.dto.response; | ||
|
||
import com.mallangs.domain.member.entity.Member; | ||
import com.mallangs.domain.pet.dto.PetMemberProfileResponse; | ||
import lombok.Getter; | ||
import lombok.ToString; | ||
import java.time.LocalDateTime; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
import java.util.stream.Collectors; | ||
|
||
@Getter | ||
@ToString | ||
public class MemberGetByOtherResponse { | ||
|
||
private Long memberId; | ||
private String userId; | ||
private String nickname; | ||
private String email; | ||
private String profileImage; | ||
private LocalDateTime createdAt; | ||
private LocalDateTime updatedAt; | ||
private List<PetMemberProfileResponse> pets; | ||
|
||
public MemberGetByOtherResponse(Member member) { | ||
this.memberId = member.getMemberId(); | ||
this.userId = member.getUserId().getValue(); | ||
this.nickname = member.getNickname().getValue(); | ||
this.email = member.getEmail().getValue(); | ||
this.profileImage = member.getProfileImage(); | ||
this.createdAt = member.getCreatedAt(); | ||
this.updatedAt = member.getUpdatedAt(); | ||
|
||
if (!member.getPets().isEmpty()) { | ||
this.pets = member.getPets().stream() | ||
.map(PetMemberProfileResponse::new) | ||
.collect(Collectors.toList()); | ||
} else { | ||
this.pets = new ArrayList<>(); | ||
} | ||
|
||
} | ||
} |
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
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