Conversation
Summary of ChangesHello @lingard1234, 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
Changelog
Activity
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.
Code Review
This PR correctly addresses the scrap accessibility issue by changing the repository used for validation. However, there is some duplication in the getMyProfileCard method's check for profile card existence, which can be improved for code clarity and consistent error handling.
| // 프로필 카드 정보가 없는 경우 예외 처리 | ||
| if (!userMatchingDetailRepository.existsByUserIdAndIsDeprecatedFalse(userId)) { | ||
| throw new CustomException(UserErrorCode.PROFILE_CARD_NOT_FOUND); |
There was a problem hiding this comment.
This if condition is a redundant check. The userMatchingDetailRepository.findByUserIdAndIsDeprecatedFalse(userId).orElseThrow(...) call immediately below already handles the case where UserMatchingDetail does not exist. Removing this duplicate logic will make the code more concise. If the intention is to throw a PROFILE_CARD_NOT_FOUND exception, consider changing the exception code in the orElseThrow part from USER_MATCHING_DETAIL_NOT_FOUND to PROFILE_CARD_NOT_FOUND.
References
- Avoid implementing overly defensive or complex logic for scenarios that are explicitly prevented by system specifications or API contracts. A simpler implementation is sufficient if the input format is guaranteed. This rule promotes simpler implementations by removing redundant checks.
# Conflicts: # src/main/java/com/example/RealMatch/user/presentation/code/UserErrorCode.java
Summary
내 프로필카드 내 찜 접근 불가하도록 변경
예외 처리 레포지터리를 잘못함
Changes
UserService, UserDetailRepository
Type of Change
Related Issues
Fixes #341
참고 사항