-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathAttachmentMapper.java
More file actions
27 lines (22 loc) · 924 Bytes
/
AttachmentMapper.java
File metadata and controls
27 lines (22 loc) · 924 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
package clap.server.application.mapper;
import clap.server.adapter.inbound.web.dto.task.AttachmentResponse;
import clap.server.adapter.inbound.web.dto.task.FindTaskDetailsResponse;
import clap.server.domain.model.task.Attachment;
import clap.server.domain.model.task.Task;
import java.util.List;
import java.util.stream.Collectors;
public class AttachmentMapper {
private AttachmentMapper() {
throw new IllegalArgumentException();
}
public static List<Attachment> toAttachments(Task task, List<String> fileUrls) {
return fileUrls.stream()
.map(fileUrl -> Attachment.builder()
.task(task)
.fileUrl(fileUrl)
.originalName("파일 예시 이름")
.fileSize("16MB") //TODO: 하드코딩 제거
.build())
.collect(Collectors.toList());
}
}