-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: studyMemberMapper 생성 및 매핑 코드 리팩토링
- Loading branch information
1 parent
3557b00
commit 48f8337
Showing
3 changed files
with
24 additions
and
6 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
15 changes: 15 additions & 0 deletions
15
src/main/java/com/example/demo/mapper/StudyMemberMapper.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 |
---|---|---|
@@ -1,5 +1,20 @@ | ||
package com.example.demo.mapper; | ||
|
||
import java.util.List; | ||
import java.util.stream.Collectors; | ||
|
||
import com.example.demo.domain.StudyMember; | ||
import com.example.demo.dto.MemberResponse; | ||
|
||
public class StudyMemberMapper { | ||
|
||
public List<MemberResponse> toMemberResponses(List<StudyMember> studyMembers) { | ||
return studyMembers.stream() | ||
.map(studyMember -> new MemberResponse( | ||
studyMember.getMember().getId(), | ||
studyMember.getMember().getName(), | ||
studyMember.getMember().getThumbnailImage().getThumbnailImage())) | ||
.collect(Collectors.toList()); | ||
} | ||
|
||
} |
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