-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathThesisAdminFacade.java
More file actions
26 lines (22 loc) · 1020 Bytes
/
ThesisAdminFacade.java
File metadata and controls
26 lines (22 loc) · 1020 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 kgu.developers.admin.thesis.application;
import kgu.developers.admin.thesis.presentation.response.ThesisDetailResponse;
import kgu.developers.domain.file.application.query.FileQueryService;
import kgu.developers.domain.thesis.application.query.ThesisQueryService;
import kgu.developers.domain.thesis.domain.Thesis;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
@Component
@Transactional
@RequiredArgsConstructor
public class ThesisAdminFacade {
private final ThesisQueryService thesisQueryService;
private final FileQueryService fileQueryService;
public ThesisDetailResponse getById(Long id){
Thesis thesis = thesisQueryService.getById(id);
String physicalPath = thesis.getThesisFileId() != null
? fileQueryService.getFilePhysicalPath(thesis.getThesisFileId())
: null;
return ThesisDetailResponse.from(thesis, physicalPath);
}
}