-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPostRequestDTO.java
More file actions
37 lines (32 loc) ยท 951 Bytes
/
PostRequestDTO.java
File metadata and controls
37 lines (32 loc) ยท 951 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package aibe.hosik.post.dto;
import aibe.hosik.post.entity.Post;
import aibe.hosik.post.entity.PostCategory;
import aibe.hosik.post.entity.PostType;
import aibe.hosik.user.User;
import java.time.LocalDate;
import java.util.List;
public record PostRequestDTO(
String title,
String content,
Integer headCount,
String image,
String requirementPersonality,
LocalDate endedAt,
PostCategory category,
PostType type,
List<String> skills
) {
public Post toEntity(User user) {
return Post.builder()
.title(title())
.content(content())
.headCount(headCount())
.image(image())
.requirementPersonality(requirementPersonality())
.endedAt(endedAt())
.category(category())
.type(type())
.user(user)
.build();
}
}