-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathCertificateFacade.java
More file actions
29 lines (24 loc) · 1.35 KB
/
CertificateFacade.java
File metadata and controls
29 lines (24 loc) · 1.35 KB
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
package kgu.developers.api.certificate.application;
import kgu.developers.domain.certificate.application.command.CertificateCommandService;
import kgu.developers.domain.graduationUser.application.command.GraduationUserCommandService;
import kgu.developers.domain.graduationUser.application.query.GraduationUserQueryService;
import kgu.developers.domain.graduationUser.domain.GraduationUser;
import kgu.developers.domain.user.application.query.UserQueryService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;
import org.springframework.web.multipart.MultipartFile;
@Component
@RequiredArgsConstructor
public class CertificateFacade {
private final CertificateCommandService certificateCommandService;
private final UserQueryService userQueryService;
private final GraduationUserQueryService graduationUserQueryService;
private final GraduationUserCommandService graduationUserCommandService;
public Long submitCertificate(MultipartFile file, Long scheduleId) {
Long certificateId = certificateCommandService.submitCertificate(file,scheduleId);
String userId = userQueryService.getMyId();
GraduationUser graduationUser = graduationUserQueryService.getByUserId(userId);
graduationUserCommandService.updateCertificate(graduationUser, certificateId);
return certificateId;
}
}