-
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.
add : 3차 세미나 실습 과제_ PostFindDto를 요소로 가지는 ListDto 구현 #7
- Loading branch information
1 parent
3305c4f
commit 0bdefff
Showing
4 changed files
with
19 additions
and
0 deletions.
There are no files selected for viewing
Binary file modified
BIN
+0 Bytes
(100%)
week02/seminar/demo/.gradle/8.7/executionHistory/executionHistory.lock
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
week02/seminar/demo/.gradle/buildOutputCleanup/buildOutputCleanup.lock
Binary file not shown.
19 changes: 19 additions & 0 deletions
19
week02/seminar/demo/src/main/java/com/example/demo/service/dto/post/PostListFindDto.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,19 @@ | ||
package com.example.demo.service.dto.post; | ||
|
||
import com.example.demo.domain.Post; | ||
import java.util.List; | ||
|
||
public record PostListFindDto( | ||
List<PostFindDto> postList | ||
|
||
) { | ||
public static PostListFindDto of( | ||
List<Post> posts | ||
) { | ||
List<PostFindDto> postFindDtoList = posts.stream() | ||
.map(PostFindDto::of) | ||
.toList(); | ||
return new PostListFindDto(postFindDtoList); | ||
} | ||
} | ||
|