Skip to content

Conversation

@yongjun0511
Copy link
Collaborator

No description provided.

JjungminLee and others added 4 commits August 10, 2025 09:44
* feat: /user/v2/my api추가

* feat: 단과대, 학과 조회 API추가

* feat: 유저 탈퇴 로직 -> 닉네임 파라미터 받게 변경

* refactor: gemini 리뷰에 맞춰 변경
* feat: 학과 등록시 학과 id  파라미터로 전달하게끔 변경

* refactor: /users/department 학과, 단과대 추가

* feat: /user/mypage 단과대, 학과정보 추가

* refactor: 현재 날짜에 해당하는 제휴들만 조회되게 변경

* refactor: 유저의 학과별, 단과대별 제휴 로직 변경

* refactor: gemini 코드리뷰 바탕으로 수정
fix: 에러 헨들러에서 500대 에러만 보내도록 수정
@yongjun0511 yongjun0511 self-assigned this Sep 1, 2025
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.

Summary of Changes

Hello @yongjun0511, 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은 v2.0.3 릴리즈를 위한 것으로, 주로 제휴 및 사용자 학과 관련 기능 개선에 중점을 둡니다. 제휴 데이터의 정확한 기간별 필터링, 사용자 및 학과 정보 DTO의 확장, 그리고 단과대 및 학과 조회를 위한 새로운 API 엔드포인트 추가가 포함됩니다. 또한, JWT 토큰 유효 기간을 연장하고 Slack 알림 로직을 개선하여 시스템 안정성과 사용자 경험을 향상시켰습니다.

Highlights

  • Partnership 엔티티 유효 기간 필터링 강화: Partnership 엔티티의 @where 절이 시작일과 종료일을 모두 고려하여 현재 유효한 제휴만 조회하도록 수정되었습니다.
  • 제휴 조회 로직 개선: PartnershipRepository의 쿼리가 PartnershipRestaurant을 직접 반환하도록 변경되었으며, 유효 기간 필터링 로직이 포함되어 관련 제휴 데이터 검색 효율성이 향상되었습니다.
  • 사용자 및 학과 정보 DTO 확장 및 개선: DepartmentResponse와 MyPageResponse DTO가 학과 및 단과대 ID와 이름을 포함하도록 확장되었고, UpdateDepartmentRequest는 학과 ID를 사용하도록 변경되었습니다.
  • 새로운 API 엔드포인트 추가: 사용자 리뷰 조회(V2), 단과대 조회, 단과대에 따른 학과 조회 기능을 위한 새로운 API 엔드포인트가 UserController에 추가되었습니다.
  • JWT 토큰 유효 기간 연장: 개발 및 로컬 환경에서 JWT 액세스 및 리프레시 토큰의 유효 기간이 대폭 연장되었습니다.
  • 에러 핸들링 개선: GlobalExceptionHandler에서 Slack 알림이 5xx 서버 오류에 대해서만 전송되도록 조건이 추가되어 불필요한 알림을 줄였습니다.
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

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 issue 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

v2.0.3 릴리즈를 위한 변경 사항들을 검토했습니다. 전반적으로 제휴(Partnership) 관련 로직에서 만료된 제휴를 필터링하도록 쿼리를 개선하고, 사용자 정보 및 학과/단과대 조회 관련 API를 추가/개선하는 내용이 포함되어 있습니다. 코드 변경 사항들은 대부분 긍정적이며, 몇 가지 개선점을 제안했습니다.

주요 피드백은 다음과 같습니다:

  • Swagger API 문서의 응답 명세가 실제 구현과 다른 부분을 수정하여 명확성을 높일 것을 제안합니다.
  • UserService에서 리소스를 찾지 못했을 때 반환하는 예외 타입을 좀 더 의미에 맞게 변경하는 것을 제안합니다.
  • 사용되지 않는 것으로 보이는 리포지토리 메소드에 대한 확인을 요청합니다.

자세한 내용은 각 파일의 인라인 코멘트를 참고해주세요.

@Operation(summary = "단과대 조회", description = "숭실대학교 단과대학 들을 조회하는 API입니다.(토큰 불필요)")
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "단과대 리스트 조회 성공"),
@ApiResponse(responseCode = "404", description = "존재하지 않는 단과대", content = @Content(schema = @Schema(implementation = BaseResponse.class)))

Choose a reason for hiding this comment

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

medium

Swagger 문서의 getColleges API 응답 코드가 실제 구현과 다릅니다. userService.getCollegeList()collegeRepository.findAll()을 호출하며, 결과가 없으면 빈 리스트를 반환하고 예외를 던지지 않습니다. 따라서 404 응답은 발생하지 않습니다. 혼동을 피하기 위해 404 관련 @ApiResponse를 제거하는 것이 좋습니다.


@Operation(summary = "단과대에 따른 학과 조회", description = "단과대학을 입력하면 단과대에 속한 숭실대학교 학과를 조회하는 API입니다.(토큰 불필요)")
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "단과대 리스트 조회 성공"),

Choose a reason for hiding this comment

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

medium

Swagger 문서의 getDepartments API 응답 명세가 충분하지 않습니다. userService.getDepartmentList(collegeId)는 존재하지 않는 collegeId에 대해 BaseException을 발생시킵니다. 이 경우 400 또는 404 오류가 발생할 수 있으므로, 해당 오류 응답을 @ApiResponses에 추가하여 API 사용자가 오류 상황을 명확히 인지할 수 있도록 해야 합니다.

            @ApiResponse(responseCode = "200", description = "단과대 리스트 조회 성공"),
            @ApiResponse(responseCode = "400", description = "존재하지 않는 단과대 ID", content = @Content(schema = @Schema(implementation = BaseResponse.class)))


Optional<User> findByProviderId(String providerId);

Optional<User> findByNickname(String nickname);

Choose a reason for hiding this comment

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

medium

새로 추가된 findByNickname 메소드가 코드베이스에서 사용되지 않고 있습니다. 사용되지 않는 코드는 혼란을 야기하고 유지보수성을 떨어뜨릴 수 있습니다. 이 메소드가 향후 사용될 계획이 없다면 제거하는 것을 고려해 보세요.


public List<GetDepartmentResponse> getDepartmentList(Long collegeId) {
College college = collegeRepository.findById(collegeId)
.orElseThrow(() -> new BaseException(VALIDATION_ERROR));

Choose a reason for hiding this comment

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

medium

collegeId로 단과대를 찾지 못했을 때 VALIDATION_ERROR (400 Bad Request)를 반환하고 있습니다. 이는 클라이언트의 잘못된 '입력 값'보다는 '존재하지 않는 리소스'를 요청한 경우에 더 가깝습니다. 의미적으로 더 명확한 NOT_FOUND_COLLEGE (404 Not Found)를 사용하는 것이 RESTful API 설계 원칙에 더 부합합니다. (NOT_FOUND_COLLEGE static import가 필요할 수 있습니다.)

Suggested change
.orElseThrow(() -> new BaseException(VALIDATION_ERROR));
.orElseThrow(() -> new BaseException(NOT_FOUND_COLLEGE));

@yongjun0511 yongjun0511 merged commit 12a3f21 into main Sep 2, 2025
1 check 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.

3 participants