Skip to content

Conversation

@pp8817
Copy link
Member

@pp8817 pp8817 commented Jan 8, 2026

ISSUE #134

// User / Student 연동 관련 (포털 연동 충돌)
DUPLICATED_STUDENT_CODE("S04", "이미 포털 연동된 학생 정보가 존재합니다.", HttpStatus.CONFLICT),

// 복수전공 관련
DUAL_MAJOR_COURSE_TYPE_MISSING("D01", "복수전공 이수 구분 정보가 존재하지 않아 처리할 수 없습니다.", HttpStatus.UNPROCESSABLE_ENTITY),

// 편입생 관련
TRANSFER_STUDENT_UNSUPPORTED("T13", "편입생 학적 정보는 현재 지원되지 않습니다.", HttpStatus.UNPROCESSABLE_ENTITY),

// 졸업 요건 관련
GRADUATION_REQUIREMENTS_DATA_NOT_FOUND("G02", "사용자에게 맞는 졸업 요건 데이터가 존재하지 않습니다.", HttpStatus.NOT_FOUND)

참고 사항

P1: 꼭 반영해주세요 (Request changes)
P2: 적극적으로 고려해주세요 (Request changes)
P3: 웬만하면 반영해 주세요 (Comment)
P4: 반영해도 좋고 넘어가도 좋습니다 (Approve)
P5: 그냥 사소한 의견입니다 (Approve)

🔗 Related Issue

@pp8817 pp8817 requested a review from hoooonshub January 8, 2026 15:25
@pp8817 pp8817 self-assigned this Jan 8, 2026
@pp8817 pp8817 added the ✨ Feature 기능 개발 label Jan 8, 2026
@gemini-code-assist
Copy link

Summary of Changes

Hello @pp8817, 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은 포털 연동 및 졸업 요건 조회 과정에서 발생할 수 있는 다양한 학생 관련 시나리오에 대한 오류 처리 로직을 개선하고 확장합니다. 특히, 소셜 로그인 시 학번 중복, 복수전공 학생 처리, 편입생 졸업 요건 미지원, 그리고 졸업 요건 데이터 부재와 같은 특정 상황에 대한 명확한 예외 처리를 도입하여 시스템의 안정성과 사용자 경험을 향상시키는 데 중점을 두었습니다.

Highlights

  • 새로운 오류 코드 추가 및 재정렬: 소셜 로그인 중복, 복수전공, 편입생, 졸업 요건 관련 예외 처리를 위한 새로운 오류 코드(S04, D01, T13, G02)가 추가되었으며, 기존 오류 코드들이 가독성 향상을 위해 재정렬되었습니다.
  • 포털 연동 서비스 예외 처리 강화: InitializePortalConnectionService 및 RefreshPortalConnectionService에 복수전공 학생 및 이미 연동된 학번(학생 정보)에 대한 예외 처리 로직이 추가되어 데이터 무결성을 강화했습니다.
  • 졸업 요건 조회 시 편입생 예외 처리: GraduationService에 편입생에 대한 졸업 요건 조회 시 현재 지원되지 않는다는 예외 처리 로직이 추가되었습니다. 이는 향후 편입생 졸업 요건 지원을 위한 기반을 마련합니다.
  • 학생 엔티티에 편입생 여부 확인 메서드 추가: Student 엔티티에 학번과 입학년도를 기반으로 편입생 여부를 판단하는 isTransferStudent() 메서드가 추가되었습니다.
  • API 문서 업데이트: SuwonScrapeControllerDocs 및 GraduationControllerDocs에 새로 추가된 오류 코드에 대한 API 응답 문서가 업데이트되어 클라이언트 개발자가 예상 가능한 오류를 명확히 알 수 있도록 했습니다.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

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

This pull request introduces several enhancements and error handling improvements across the application. Key changes include updating API documentation for portal-related endpoints (login, startScraping) to reflect new error codes such as DUAL_MAJOR_COURSE_TYPE_MISSING, DUPLICATED_STUDENT_CODE, and TRANSFER_STUDENT_UNSUPPORTED. The InitializePortalConnectionService and RefreshPortalConnectionService now include checks for unsupported dual majors and duplicate student codes, with refined exception handling for DataIntegrityViolationException and generic Exception types. The GraduationService and GraduationQueryRepository were updated to handle and reject transfer students, and a new isTransferStudent() method was added to the Student entity to identify transfer students based on student code and admission year. Additionally, the ErrorCode enum was reorganized and expanded with new common, server, student, and dual major related error codes. Review comments suggest refactoring the isTransferStudent() method to use an existing stored field for consistency, consolidating duplicate @ApiResponse annotations for the same HTTP status code in API documentation, removing a redundant catch (CommonException e) block, and improving the robustness of the isStudentCodeUniqueViolation check by avoiding string-based error message parsing. The reviewer also noted that the TRANSFER_STUDENT_UNSUPPORTED error code is inconsistently placed within the 'Token related' group and should be moved to a more appropriate category.

Comment on lines +144 to +157
public boolean isTransferStudent() {
if (this.studentCode == null || this.academicInfo == null || this.academicInfo.getAdmissionYear() == null) {
return false;
}

if (this.studentCode.length() < 2) {
return false;
}

String codePrefix = this.studentCode.substring(0, 2); // 학번 앞 2자리
String yearSuffix = String.valueOf(this.academicInfo.getAdmissionYear()).substring(2); // 입학년도 뒤 2자리

return !codePrefix.equals(yearSuffix);
}

Choose a reason for hiding this comment

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

high

새로 추가된 isTransferStudent() 메서드는 학번과 입학년도를 비교하여 편입생 여부를 동적으로 계산하고 있습니다. 하지만 Student 엔티티의 academicInfo 필드에는 이미 isTransferStudent라는 boolean 필드가 존재하며, 포털 데이터로부터 이 값을 받아와 저장하고 있습니다.

동일한 정보에 대해 두 가지 출처(저장된 값, 계산된 값)가 존재하면 데이터 불일치가 발생할 수 있고 혼란을 야기할 수 있습니다. 예를 들어, 학번 부여 규칙이 변경되면 이 메서드는 잘못된 결과를 반환할 수 있습니다.

따라서 이 메서드는 이미 저장된 academicInfo.getIsTransferStudent() 값을 직접 반환하도록 수정하는 것이 좋습니다. 이렇게 하면 데이터의 일관성을 보장하고 코드를 단순화할 수 있습니다.

    public boolean isTransferStudent() {
        return this.academicInfo != null && this.academicInfo.getIsTransferStudent() != null && this.academicInfo.getIsTransferStudent();
    }

Copy link
Member Author

Choose a reason for hiding this comment

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

데이터 확인 결과 편입생인 경우에도 student.is_transfer_student 값이 FALSE로 처리되고 있음.
현재 방식 유지 -> 크롤링 데이터가 문제인지, 처리를 잘못하고 있는지 확인 필요

@pp8817 pp8817 merged commit a5e04ea into main Jan 11, 2026
1 check passed
@pp8817 pp8817 deleted the feat/134 branch January 13, 2026 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ Feature 기능 개발

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants