Skip to content

Comments

[FIX] 내 프로필카드 내 찜 접근 불가하도록 변경 (#341)#342

Merged
lingard1234 merged 6 commits intodevfrom
fix/341-editexcp
Feb 9, 2026
Merged

[FIX] 내 프로필카드 내 찜 접근 불가하도록 변경 (#341)#342
lingard1234 merged 6 commits intodevfrom
fix/341-editexcp

Conversation

@lingard1234
Copy link
Contributor

Summary

내 프로필카드 내 찜 접근 불가하도록 변경
예외 처리 레포지터리를 잘못함

Changes

UserService, UserDetailRepository

Type of Change

  • Bug fix (기존 기능에 영향을 주지 않는 버그 수정)
  • New feature (기존 기능에 영향을 주지 않는 새로운 기능 추가)
  • Breaking change (기존 기능에 영향을 주는 수정)
  • Refactoring (기능 변경 없는 코드 개선)
  • Documentation (문서 수정)
  • Chore (빌드, 설정 등 기타 변경)
  • Release (develop → main 배포)

Related Issues

Fixes #341

참고 사항

@lingard1234 lingard1234 self-assigned this Feb 9, 2026
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @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

  • 프로필 카드 접근 로직 개선: 사용자 프로필 카드 조회 시, getMyProfileCard 메서드에 프로필 카드 존재 여부를 확인하는 로직이 추가되었습니다. 이제 유효하지 않은 프로필 카드 접근 시 PROFILE_CARD_NOT_FOUND 예외가 즉시 발생합니다.
  • 찜 접근 권한 로직 수정: getMyScrap 메서드에서 찜(스크랩) 조회 권한을 확인하는 로직이 변경되었습니다. 기존에는 matchCampaignHistoryRepository를 참조했으나, 이제 userMatchingDetailRepository를 사용하여 사용자의 활성 프로필 카드 존재 여부를 기준으로 찜 접근 권한을 판단합니다.
  • 새로운 레포지토리 메서드 추가: UserMatchingDetailRepository 인터페이스에 existsByUserIdAndIsDeprecatedFalse(Long userId) 메서드가 추가되었습니다. 이 메서드는 특정 사용자 ID에 해당하는 활성 프로필 카드 존재 여부를 효율적으로 확인할 수 있도록 지원합니다.
Changelog
  • src/main/java/com/example/RealMatch/user/application/service/UserService.java
    • getMyProfileCard 메서드에 프로필 카드 존재 여부 확인 로직 추가
    • getMyScrap 메서드의 찜 조회 권한 확인 로직에서 matchCampaignHistoryRepository 대신 userMatchingDetailRepository 사용하도록 수정
  • src/main/java/com/example/RealMatch/user/domain/repository/UserMatchingDetailRepository.java
    • existsByUserIdAndIsDeprecatedFalse(Long userId) 메서드 추가
Activity
  • 현재까지 이 PR에 대한 특정 활동(댓글, 리뷰 등)은 감지되지 않았습니다.
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
Contributor

@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 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.

Comment on lines 65 to 67
// 프로필 카드 정보가 없는 경우 예외 처리
if (!userMatchingDetailRepository.existsByUserIdAndIsDeprecatedFalse(userId)) {
throw new CustomException(UserErrorCode.PROFILE_CARD_NOT_FOUND);
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

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
  1. 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.

@lingard1234 lingard1234 merged commit d49a5e8 into dev Feb 9, 2026
1 check passed
@lingard1234 lingard1234 deleted the fix/341-editexcp branch February 9, 2026 17:27
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.

[FIX] 내 프로필카드 내 찜 접근 불가하도록 변경

1 participant