-
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차 세미나 실습 과제_post 조회 record 추가 #7
- Loading branch information
1 parent
99d4503
commit b663aca
Showing
1 changed file
with
19 additions
and
0 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
week02/seminar/demo/src/main/java/com/example/demo/service/dto/post/PostFindDto.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.Member; | ||
import com.example.demo.domain.Post; | ||
import com.example.demo.service.dto.member.MemberFindDto; | ||
import jakarta.validation.constraints.NotBlank; | ||
|
||
public record PostFindDto( | ||
String name, | ||
|
||
String content | ||
|
||
) { | ||
public static PostFindDto of( | ||
Post post | ||
) { | ||
return new PostFindDto(post.getName(), post.getContent()); | ||
} | ||
} |