Skip to content

[SOU-635] 찜 여부가 제대로 반환되지 않는 문제 수정#264

Merged
bum0w0 merged 1 commit into
developfrom
feat/SOU-635-wishlist-bug
Jun 7, 2026
Merged

[SOU-635] 찜 여부가 제대로 반환되지 않는 문제 수정#264
bum0w0 merged 1 commit into
developfrom
feat/SOU-635-wishlist-bug

Conversation

@bum0w0

@bum0w0 bum0w0 commented Jun 7, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

Bug Fixes

  • 위시리스트 데이터 조회 로직을 개선하여 추천 기능의 정확성 향상
  • 사용자 식별 방식을 통일하여 위시리스트 상태 반영의 일관성 개선
  • 사용자 데이터 조회 최적화로 서비스 안정성 강화

@coderabbitai

coderabbitai Bot commented Jun 7, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f86dcd5c-7059-4bf0-a8d6-c6d61f5b6600

📥 Commits

Reviewing files that changed from the base of the PR and between aeae676 and 645c00f.

📒 Files selected for processing (5)
  • src/main/java/com/souzip/domain/recommend/ai/service/AiRecommendationService.java
  • src/main/java/com/souzip/domain/recommend/general/service/GeneralRecommendationService.java
  • src/main/java/com/souzip/domain/souvenir/service/SouvenirService.java
  • src/main/java/com/souzip/domain/user/service/UserService.java
  • src/main/java/com/souzip/domain/wishlist/repository/WishlistRepository.java

개요

WishlistRepository의 사용자 ID 기반 조회 메서드 계약을 정렬하고, SouvenirService의 토큰 파싱을 String에서 Long으로 전환한 후, 전체 서비스 계층에서 업데이트된 메서드 호출로 일관성을 맞춥니다.

변경사항

Wishlist 조회 메서드 통합

레이어 / 파일(들) 요약
WishlistRepository 계약 확장
src/main/java/com/souzip/domain/wishlist/repository/WishlistRepository.java
유저 ID와 소우베니어 ID 조합 확인을 위한 existsByUserIdAndSouvenirId(Long, Long) 메서드를 추가하고, Long 기반 findSouvenirIdsByUserId(Long)과 String 기반 findSouvenirIdsByUserUserId(String) 두 가지 조회 메서드 변형을 제공합니다.
SouvenirService 토큰 파싱 및 조회 로직 변경
src/main/java/com/souzip/domain/souvenir/service/SouvenirService.java
JWT 토큰에서 사용자 ID를 Long으로 직접 파싱하는 parseUserIdFromTokenAsLong 메서드를 도입하고, 기존 문자열 기반 extractUserId를 이를 래핑하도록 변경합니다. getNearbySouvenirsgetSouvenir에서 업데이트된 파싱을 사용하여 사용자 UUID를 조회하고 위시리스트/소유 여부를 판정합니다.
추천 서비스의 조회 메서드 업데이트
src/main/java/com/souzip/domain/recommend/ai/service/AiRecommendationService.java, src/main/java/com/souzip/domain/recommend/general/service/GeneralRecommendationService.java
getCategoryRecommendationsForUser, mapToRecommendedSouvenirs, getRecentSouvenirRecommendations, getTopCountriesWithTop10Souvenirs, toDto 메서드에서 findSouvenirIdsByUserUserId로 변경하여 위시리스트 플래그 계산의 데이터 입력을 갱신합니다.
UserService 조회 메서드 업데이트
src/main/java/com/souzip/domain/user/service/UserService.java
getMySouvenirs에서 위시리스트 소베니어 ID 조회 메서드를 findSouvenirIdsByUserUserId로 변경합니다.

예상 코드 리뷰 노력

🎯 3 (중간) | ⏱️ ~25분

관련 PR

  • souzip/souzip-api#250: 추천 응답에 wishlistCount와 isWishlisted를 추가한 위시리스트 메타데이터 enrichment 흐름과 동일한 맥락에서 조회 메서드를 조정합니다.
  • souzip/souzip-api#253: WishlistRepository의 사용자 ID 타입 변경과 모든 서비스 호출 사이트의 동일한 수정이 직접 연계되어 있습니다.

제안된 레이블

bug

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/SOU-635-wishlist-bug

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.

@bum0w0 bum0w0 merged commit 49a23ca into develop Jun 7, 2026
1 of 2 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 645c00f808

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

String userId = extractUserId(authorizationHeader);
Set<Long> wishlistedIds = userId != null
? wishlistRepository.findSouvenirIdsByUserId(userId)
? wishlistRepository.findSouvenirIdsByUserUserId(userId)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge general 추천의 찜 조회 ID를 UUID와 맞추세요

medium: 이 경로의 extractUserId()JwtTokenProvider.getUserIdFromToken()에서 나온 DB PK Long을 문자열로 바꾸지만, 새로 호출하는 findSouvenirIdsByUserUserId()w.user.userId(UUID)를 조회합니다. 인증 사용자가 /api/countries/souvenirs를 호출해도 numeric ID로 UUID 컬럼을 검색해 항상 빈 Set이 되어 isWishlisted가 false/null처럼 내려가므로, 여기와 toDto()의 동일한 호출은 UserRepository로 UUID를 찾거나 새로 추가한 Long 기반 findSouvenirIdsByUserId(Long)를 사용해야 합니다.

Useful? React with 👍 / 👎.

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.

1 participant