-
Notifications
You must be signed in to change notification settings - Fork 1
prod: 수험번호 및 수험표 #382
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
prod: 수험번호 및 수험표 #382
Conversation
Feat/ticket: 수험번호 및 수험표 발급 기능 구현
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary of ChangesHello @chominju02, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! 이 PR은 시험 관리 시스템에 대한 중요한 개선 사항을 도입합니다. 관리자가 CSV 파일을 사용하여 게스트 신청을 대량으로 처리할 수 있도록 하여 수동 데이터 입력의 필요성을 줄입니다. 또한, 응시자에게 고유한 수험번호를 자동으로 할당하는 새로운 메커니즘을 구현하고, 신청 정보를 기반으로 맞춤형 PDF 수험표를 생성하는 기능을 추가하여 사용자 경험과 관리 효율성을 향상시킵니다. 이러한 변경 사항은 전반적인 시험 신청 및 관리 프로세스를 간소화하는 데 중점을 둡니다. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
이번 PR은 수험번호 생성 및 수험표 발급 기능을 구현한 것으로 보입니다. CSV 파일을 통한 일괄 신청 데이터 가져오기, 수험번호 생성 로직, PDF 수험표 생성 등 핵심적인 기능들이 많이 추가되었습니다. 전반적으로 기능 구현의 방향은 좋으나, 몇 가지 개선점을 제안합니다. 특히 CSV 파싱 로직의 안정성, 설정값 하드코딩 문제, 예외 처리 및 로깅 방식에 대한 검토가 필요합니다. 또한, 현재 주석 처리되어 비활성화된 것으로 보이는 알림톡 발송 로직은 프로덕션 배포 전 반드시 확인이 필요합니다.
| // LunaNotifyRequest lunaRequest = createLunaNotifyRequest(request); | ||
| // | ||
| // webClient.post() | ||
| // .uri(properties.getApi().getBaseUrl()) | ||
| // .bodyValue(lunaRequest) | ||
| // .retrieve() | ||
| // .bodyToMono(String.class) | ||
| // .publishOn(Schedulers.boundedElastic()) | ||
| // .doOnSuccess(response -> log.debug("알림톡 응답 성공")) | ||
| // .doOnError(error -> log.error("알림톡 전송 실패", error)) | ||
| // .subscribe(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| success++; | ||
| } catch (Exception e) { | ||
| log.error("게스트 신청 CSV 행 {} 처리 실패: {}", lineNo, e.getMessage(), e); | ||
| throw new RuntimeException("CSV 일괄 처리 중 오류 발생"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| } | ||
|
|
||
| try { | ||
| String[] values = line.split(CSV_DELIMITER, -1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| results.add(ApplicationCsvInfo.of(values)); | ||
| } catch (Exception e) { | ||
| log.error("CSV 파싱 실패 (Line {}): {}", lineNumber, e.getMessage()); | ||
| throw new RuntimeException("CSV 파싱 오류"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| private final Map<LocalDate, Integer> roundCodeMap = Map.of( | ||
| LocalDate.of(2025, 10, 19), 1, | ||
| LocalDate.of(2025, 10, 26), 2, | ||
| LocalDate.of(2025, 11, 2), 3 | ||
| ); | ||
|
|
||
| private final Map<Area, Integer> areaCodeMap = Map.of( | ||
| Area.DAECHI, 1, | ||
| Area.MOKDONG, 2, | ||
| Area.NOWON, 3, | ||
| Area.DAEGU, 4 | ||
| ); | ||
|
|
||
| private final Map<String, Integer> schoolCodeMap = Map.of( | ||
| "대치중학교", 7, | ||
| "개원중학교", 6, | ||
| "문래중학교", 5, | ||
| "목운중학교", 4, | ||
| "신서중학교", 3, | ||
| "온곡중학교", 2, | ||
| "노변중학교", 1 | ||
| ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| try { | ||
| return LocalDate.parse(dateStr.trim()); | ||
| } catch (DateTimeParseException e) { | ||
| throw new IllegalArgumentException("날짜 형식이 올바르지 않습니다"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| private final ExamApplicationJpaRepository examApplicationJpaRepository; | ||
| private final ExamJpaRepository examJpaRepository; | ||
| private final ExamNumberCode examNumberCode; | ||
| private final int GAP_BETWEEN_CHECKED_AND_UNCHECKED = 25; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| private static final List<Subject> SOCIAL_SUBJECTS = List.of( | ||
| Subject.LIFE_AND_ETHICS, | ||
| Subject.WORLD_HISTORY, | ||
| Subject.ECONOMICS, | ||
| Subject.POLITICS_AND_LAW, | ||
| Subject.SOCIETY_AND_CULTURE, | ||
| Subject.ETHICS_AND_IDEOLOGY, | ||
| Subject.KOREAN_GEOGRAPHY, | ||
| Subject.WORLD_GEOGRAPHY, | ||
| Subject.EAST_ASIAN_HISTORY | ||
| ); | ||
|
|
||
| private static final List<Subject> SCIENCE_SUBJECTS = List.of( | ||
| Subject.PHYSICS_1, | ||
| Subject.CHEMISTRY_1, | ||
| Subject.BIOLOGY_1, | ||
| Subject.EARTH_SCIENCE_1, | ||
| Subject.PHYSICS_2, | ||
| Subject.CHEMISTRY_2, | ||
| Subject.BIOLOGY_2, | ||
| Subject.EARTH_SCIENCE_2 | ||
| ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| drawText(cs, font, 10, 198, 783, nz(request.examNumber())); | ||
| drawText(cs, font, 11, 174, 734, formatName(request.userName())); | ||
| drawText(cs, font, 10, 174, 667, formatBirth(request.birth())); | ||
|
|
||
| // 우측 | ||
| drawText(cs, font, 9, 481, 812, nz(request.examNumber())); | ||
| drawText(cs, font, 9, 481, 801, nz(request.userName())); | ||
| drawText(cs, font, 9, 481, 746, firstOrEmpty(request.subjects())); | ||
| drawText(cs, font, 9, 481, 736, lastOrEmpty(request.subjects())); | ||
| drawText(cs, font, 9, 481, 714, nz(request.schoolName())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| } catch (Exception e) { | ||
| return null; | ||
| } finally { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✨ 구현한 기능
📢 논의하고 싶은 내용
🎸 기타