diff --git a/src/docs/asciidoc/form.adoc b/src/docs/asciidoc/form.adoc index 635ad538..8aef113d 100644 --- a/src/docs/asciidoc/form.adoc +++ b/src/docs/asciidoc/form.adoc @@ -420,6 +420,22 @@ include::{snippets}/form-controller-test/수험표를_발급받을_때_원서를 ===== 불합격한 경우 include::{snippets}/form-controller-test/수험표를_발급받을_때_불합격자라면_에러가_발생한다/http-response.adoc[] +=== 수험표 전체 발급 +어드민은 1차 전형에서 합격한 전체 유저의 수험표를 발급받을 수 있습니다. + +==== 요청 형식 + +===== Request Header +include::{snippets}/form-controller-test/수험표_전체를_발급받는다/request-headers.adoc[] + +==== 요청 +include::{snippets}/form-controller-test/수험표_전체를_발급받는다/http-request.adoc[] + +==== 응답 + +===== 정상 응답 +include::{snippets}/form-controller-test/수험표_전체를_발급받는다/http-response.adoc[] + === 접수증 발급 원서를 최종 제출한 유저는 접수증을 발급받을 수 있습니다. diff --git a/src/main/java/com/bamdoliro/maru/application/form/GenerateAllAdmissionTicketUseCase.java b/src/main/java/com/bamdoliro/maru/application/form/GenerateAllAdmissionTicketUseCase.java new file mode 100644 index 00000000..5184b730 --- /dev/null +++ b/src/main/java/com/bamdoliro/maru/application/form/GenerateAllAdmissionTicketUseCase.java @@ -0,0 +1,70 @@ +package com.bamdoliro.maru.application.form; + +import com.bamdoliro.maru.domain.form.domain.Form; +import com.bamdoliro.maru.domain.form.domain.type.FormStatus; +import com.bamdoliro.maru.infrastructure.pdf.GeneratePdfService; +import com.bamdoliro.maru.infrastructure.pdf.MergePdfService; +import com.bamdoliro.maru.infrastructure.persistence.form.FormRepository; +import com.bamdoliro.maru.infrastructure.s3.FileService; +import com.bamdoliro.maru.infrastructure.s3.constants.FolderConstant; +import com.bamdoliro.maru.infrastructure.thymeleaf.ProcessTemplateService; +import com.bamdoliro.maru.infrastructure.thymeleaf.Templates; +import com.bamdoliro.maru.shared.annotation.UseCase; +import com.bamdoliro.maru.shared.constants.Schedule; +import com.itextpdf.kernel.pdf.PdfDocument; +import com.itextpdf.kernel.pdf.PdfWriter; +import com.itextpdf.kernel.utils.PdfMerger; +import lombok.RequiredArgsConstructor; +import org.springframework.core.io.ByteArrayResource; + +import java.util.List; + +import java.io.ByteArrayOutputStream; +import java.util.Map; + +import static com.bamdoliro.maru.shared.constants.Schedule.*; + +@RequiredArgsConstructor +@UseCase +public class GenerateAllAdmissionTicketUseCase { + + private final FormRepository formRepository; + private final ProcessTemplateService processTemplateService; + private final GeneratePdfService generatePdfService; + private final MergePdfService mergePdfService; + private final FileService fileService; + + public ByteArrayResource execute() { + List