Skip to content

Conversation

@chominju02
Copy link
Contributor

✨ 구현한 기능

  • timetable

📢 논의하고 싶은 내용

🎸 기타

@coderabbitai
Copy link

coderabbitai bot commented Oct 13, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch develop

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist
Copy link

Summary of Changes

Hello @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은 사용자가 시험 시간표를 PDF 파일로 조회하고 다운로드할 수 있는 새로운 기능을 도입합니다. 핵심적으로 백엔드 서비스, Apache PDFBox를 활용한 PDF 생성 로직, 그리고 관련 시험 및 사용자 정보를 가져오기 위한 새로운 데이터베이스 쿼리가 포함됩니다. 또한, 특정 과목명의 표시 방식을 개선하고 기존 크론 잡의 실행 스케줄을 조정했습니다.

Highlights

  • 새로운 시간표 기능 추가: 사용자가 시험 시간표를 PDF 파일로 생성하고 다운로드할 수 있는 새로운 기능이 구현되었습니다. 이 기능은 TimeTableService, GenerateTimeTableProcessor, TimeTableController 및 관련 DTO와 프로젝션을 포함합니다.
  • PDF 생성 로직 도입: GenerateTimeTableProcessor는 Apache PDFBox 라이브러리를 사용하여 PDF 시간표를 생성합니다. 템플릿 PDF와 한국어 폰트(NotoSansKR-Regular.ttf)를 로드하여 시험 정보를 채워 넣습니다.
  • 과목명 표시 개선: 기존 시험표 처리기와 새로운 시간표 서비스 모두에서 Subject.SOCIETY_AND_CULTURE 과목의 표시 이름을 "사회·문화"로 특별히 처리하도록 변경되었습니다.
  • 새로운 데이터베이스 쿼리 추가: ExamApplicationJpaRepositoryexamDate를 기준으로 회원 및 파트너 시간표 정보를 조회하는 findMemberTimeTablefindPartnerTimeTable 메서드가 추가되었습니다.
  • 화이트리스트 업데이트: 새로운 시간표 기능의 /api/v1/time-table GET 엔드포인트가 시스템 화이트리스트에 추가되어 접근이 허용됩니다.
  • 크론 잡 스케줄 변경: ExamNumberGenerationJobRound1의 크론 표현식이 0 0 10 13 10 ?에서 0 30 19 13 10 ?으로 업데이트되었습니다.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

이 PR은 시간표를 PDF 파일로 생성하는 새로운 기능을 도입합니다. 구현에는 새로운 서비스, 컨트롤러, PDF 생성 프로세서가 포함되어 있습니다. 전반적으로 변경 사항은 좋아 보이지만, 주로 코드 중복, JPQL 쿼리 명확성, 예외 처리와 관련하여 몇 가지 개선할 점이 있습니다. 이러한 점에 대해 구체적인 의견을 남겼습니다.

Comment on lines +31 to 41
List<String> subjects = examSubjectJpaRepository.findByExamApplicationId(examApplicationId)
.stream()
.map(ExamSubjectJpaEntity::getSubject)
.sorted(Comparator.comparingInt(Subject::ordinal))
.map(Subject::getSubjectName)
.map(subject -> {
if (subject == Subject.SOCIETY_AND_CULTURE) {
return "사회·문화";
}
return subject.getSubjectName();
})
.toList();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

과목 목록을 가져와 포맷팅하는 이 로직은 GetPartnerExamTicketInfoProcessor와 새로 추가된 TimeTableService에도 중복되어 있습니다. 코드 중복을 피하고 유지보수성을 높이기 위해 이 로직을 중앙에서 관리하는 유틸리티 메서드나 서비스로 분리하는 것이 좋습니다.

Comment on lines +47 to 57
List<String> subjects = examSubjectJpaRepository.findByExamApplicationId(examApplicationId)
.stream()
.map(ExamSubjectJpaEntity::getSubject)
.sorted(Comparator.comparingInt(Subject::ordinal))
.map(Subject::getSubjectName)
.map(subject -> {
if (subject == Subject.SOCIETY_AND_CULTURE) {
return "사회·문화";
}
return subject.getSubjectName();
})
.toList();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

과목 목록을 가져와 포맷팅하는 이 로직은 GetMemberExamTicketInfoProcessor와 새로 추가된 TimeTableService에도 중복되어 있습니다. 중복을 줄이고 향후 변경을 용이하게 하기 위해 이 로직을 공통 유틸리티로 리팩토링해야 합니다.

Comment on lines +67 to +79
private List<String> getSubjects(Long examApplicationId) {
return examSubjectJpaRepository.findByExamApplicationId(examApplicationId)
.stream()
.map(ExamSubjectJpaEntity::getSubject)
.sorted(Comparator.comparingInt(Subject::ordinal))
.map(subject -> {
if (subject == Subject.SOCIETY_AND_CULTURE) {
return "사회·문화";
}
return subject.getSubjectName();
})
.toList();
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

getSubjects 메서드의 로직은 GetMemberExamTicketInfoProcessorGetPartnerExamTicketInfoProcessor에도 중복되어 있습니다. 코드 중복은 유지보수를 어렵게 만들 수 있으므로, 이 로직을 별도의 유틸리티 클래스나 공통 서비스로 추출하여 재사용하는 것을 고려해 보세요. 예를 들어, Subject 이름을 포맷팅하는 책임을 가진 컴포넌트를 만들 수 있습니다.

Comment on lines +130 to +132
} catch (Exception e) {
throw new RuntimeException("Generate time-table PDF failed", e);
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

catch (Exception e)를 사용하여 모든 예외를 잡는 것은 잠재적인 버그를 숨길 수 있습니다. PDFBox 작업에서 주로 발생하는 IOException과 같이 더 구체적인 예외를 처리하는 것이 좋습니다. 이렇게 하면 코드의 안정성이 향상되고 오류의 원인을 더 쉽게 파악할 수 있습니다.

Suggested change
} catch (Exception e) {
throw new RuntimeException("Generate time-table PDF failed", e);
}
} catch (java.io.IOException e) {
throw new RuntimeException("Generate time-table PDF failed", e);
}

Comment on lines +138 to +140
} catch (Exception e) {
throw new RuntimeException("Resource not found: " + classpath, e);
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

readAll 메서드에서도 catch (Exception e)를 사용하고 있습니다. 리소스 로딩 시에는 IOException이 발생할 가능성이 높으므로, 이를 명시적으로 처리하는 것이 좋습니다. 예외를 RuntimeException으로 다시 던지더라도, 더 구체적인 예외를 잡는 것이 코드의 의도를 명확하게 합니다.

Suggested change
} catch (Exception e) {
throw new RuntimeException("Resource not found: " + classpath, e);
}
} catch (java.io.IOException e) {
throw new RuntimeException("Resource not found: " + classpath, e);
}

Comment on lines +151 to +153
} catch (Exception e) {
throw new RuntimeException("Failed to draw text", e);
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

drawText 메서드에서도 광범위한 Exception을 잡고 있습니다. PDPageContentStream의 텍스트 관련 작업은 IOException을 던질 수 있으므로, 이를 구체적으로 처리하는 것이 좋습니다. 이는 예외 처리의 정밀도를 높여줍니다.

Suggested change
} catch (Exception e) {
throw new RuntimeException("Failed to draw text", e);
}
} catch (java.io.IOException e) {
throw new RuntimeException("Failed to draw text", e);
}

Comment on lines +312 to +315
LEFT JOIN PaymentJpaEntity p on p.examApplicationId = ea.id
LEFT JOIN ExamJpaEntity e on ea.examId = e.id
LEFT JOIN UserJpaEntity u on ea.userId = u.id
LEFT JOIN ProfileJpaEntity pr on pr.userId = u.id

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

PaymentJpaEntityExamJpaEntity에 대해 LEFT JOIN을 사용하고 있지만, WHERE 절의 p.paymentStatus = 'DONE'e.examDate = :examDate 조건 때문에 사실상 INNER JOIN처럼 동작합니다. JOIN으로 명시적으로 변경하면 쿼리의 의도가 더 명확해지고, 데이터베이스 옵티마이저가 더 효율적인 실행 계획을 세우는 데 도움이 될 수 있습니다.

Suggested change
LEFT JOIN PaymentJpaEntity p on p.examApplicationId = ea.id
LEFT JOIN ExamJpaEntity e on ea.examId = e.id
LEFT JOIN UserJpaEntity u on ea.userId = u.id
LEFT JOIN ProfileJpaEntity pr on pr.userId = u.id
JOIN PaymentJpaEntity p on p.examApplicationId = ea.id
JOIN ExamJpaEntity e on ea.examId = e.id
LEFT JOIN UserJpaEntity u on ea.userId = u.id
LEFT JOIN ProfileJpaEntity pr on pr.userId = u.id

Comment on lines +12 to +24
public static TimeTableInfoResponse of(
String examNumber,
String userName,
List<String> subjects,
String schoolName
) {
return new TimeTableInfoResponse(
examNumber,
userName,
subjects,
schoolName
);
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

record는 자동으로 public 생성자를 제공하므로, 단순히 생성자를 호출하는 정적 팩토리 메서드 of는 불필요합니다. 특별한 로직이 없다면 이 메서드를 제거하고 new TimeTableInfoResponse(...)를 직접 사용하여 코드를 간결하게 만들 수 있습니다.

@chominju02 chominju02 merged commit 987524b into prod Oct 13, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants