Skip to content

Commit

Permalink
fix(#111): 수험표 증명사진 url 오류 수정
Browse files Browse the repository at this point in the history
- Form에서 identificationPictureUri가 삭제되면서 GenerateAdmissionTicketUseCase에서 직접 presigned URL을 변수로 선언하는 형식으로 수정했어요.
- 최종 합격 발표일을 수험표에 추가했어요.
  • Loading branch information
cabbage16 committed Sep 3, 2024
1 parent 0116910 commit b88338b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import com.bamdoliro.maru.domain.form.service.FormFacade;
import com.bamdoliro.maru.domain.user.domain.User;
import com.bamdoliro.maru.infrastructure.pdf.GeneratePdfService;
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;
Expand All @@ -15,10 +17,7 @@
import java.io.ByteArrayOutputStream;
import java.util.Map;

import static com.bamdoliro.maru.shared.constants.Schedule.CODING_TEST;
import static com.bamdoliro.maru.shared.constants.Schedule.DEPTH_INTERVIEW;
import static com.bamdoliro.maru.shared.constants.Schedule.NCS;
import static com.bamdoliro.maru.shared.constants.Schedule.PHYSICAL_EXAMINATION;
import static com.bamdoliro.maru.shared.constants.Schedule.*;

@RequiredArgsConstructor
@UseCase
Expand All @@ -27,6 +26,7 @@ public class GenerateAdmissionTicketUseCase {
private final FormFacade formFacade;
private final ProcessTemplateService processTemplateService;
private final GeneratePdfService generatePdfService;
private final FileService fileService;

public ByteArrayResource execute(User user) {
Form form = formFacade.getForm(user);
Expand All @@ -38,7 +38,9 @@ public ByteArrayResource execute(User user) {
"codingTest", Schedule.toLocaleString(CODING_TEST),
"ncs", Schedule.toLocaleString(NCS),
"depthInterview", Schedule.toLocaleString(DEPTH_INTERVIEW),
"physicalExamination", Schedule.toLocaleString(PHYSICAL_EXAMINATION)
"physicalExamination", Schedule.toLocaleString(PHYSICAL_EXAMINATION),
"announcementOfSecondPass", Schedule.toLocaleString(ANNOUNCEMENT_OF_SECOND_PASS),
"identificationPictureUri", fileService.getPresignedUrl(FolderConstant.IDENTIFICATION_PICTURE, user.getUuid().toString()).getDownloadUrl()
);
String html = processTemplateService.execute(Templates.ADMISSION_TICKET, formMap);
ByteArrayOutputStream outputStream = generatePdfService.execute(html);
Expand Down
17 changes: 8 additions & 9 deletions src/main/java/com/bamdoliro/maru/shared/constants/Schedule.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,21 @@

import lombok.experimental.UtilityClass;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Locale;

@UtilityClass
public class Schedule {

public static final LocalDateTime START = LocalDateTime.of(2023, 10, 16, 9, 0);
public static final LocalDateTime END = LocalDateTime.of(2023, 10, 19, 17, 0);
public static final LocalDateTime ANNOUNCEMENT_OF_FIRST_PASS = LocalDateTime.of(2023, 10, 23, 15, 0);
public static final LocalDateTime ANNOUNCEMENT_OF_SECOND_PASS = LocalDateTime.of(2023, 11, 2, 15, 0);
public static final LocalDateTime CODING_TEST = LocalDateTime.of(2023, 10, 27, 9, 30);
public static final LocalDateTime NCS = LocalDateTime.of(2023, 10, 27, 11, 0);
public static final LocalDateTime DEPTH_INTERVIEW = LocalDateTime.of(2023, 10, 27, 13, 0);
public static final LocalDateTime PHYSICAL_EXAMINATION = LocalDateTime.of(2023, 10, 27, 13, 0);
public static final LocalDateTime START = LocalDateTime.of(2024, 10, 14, 9, 0);
public static final LocalDateTime END = LocalDateTime.of(2024, 10, 17, 17, 0);
public static final LocalDateTime ANNOUNCEMENT_OF_FIRST_PASS = LocalDateTime.of(2024, 10, 21, 15, 0);
public static final LocalDateTime ANNOUNCEMENT_OF_SECOND_PASS = LocalDateTime.of(2024, 10, 31, 15, 0);
public static final LocalDateTime CODING_TEST = LocalDateTime.of(2024, 10, 25, 9, 30);
public static final LocalDateTime NCS = LocalDateTime.of(2024, 10, 25, 11, 0);
public static final LocalDateTime DEPTH_INTERVIEW = LocalDateTime.of(2024, 10, 25, 13, 0);
public static final LocalDateTime PHYSICAL_EXAMINATION = LocalDateTime.of(2024, 10, 25, 15, 0);
public static final String SELECT_FIRST_PASS_CRON = "0 0 1 20 10 ?";

public static int getAdmissionYear() {
Expand Down
7 changes: 6 additions & 1 deletion src/main/resources/templates/admission-ticket.html
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
<tr>
<td class="ba center" style="width: 33%" rowspan="6">
<img
th:src="${form.applicant.identificationPictureUri}"
th:src="${identificationPictureUri}"
alt="증명사진"/>
</td>
<th scope="row" class="ba" style="width:28%;">수험번호</th>
Expand Down Expand Up @@ -192,6 +192,11 @@
<td class="ba" th:text="${physicalExamination}"></td>
<td class="ba">검사장</td>
</tr>
<tr>
<td class="ba">합격발표일</td>
<td class="ba" th:text="${announcementOfSecondPass}"></td>
<td class="ba">본교 홈페이지</td>
</tr>
</table>
<div class="red more">
<p>※ 코딩테스트는 '마이스터인재전형' 지원자만 실시합니다.</p>
Expand Down

0 comments on commit b88338b

Please sign in to comment.