Skip to content

[SOU-636] 근처기념품 조회 시 찜 여부 null 오반환 수정#268

Merged
bum0w0 merged 2 commits into
developfrom
fix/SOU-636-fix-null-wishlist
Jun 13, 2026
Merged

[SOU-636] 근처기념품 조회 시 찜 여부 null 오반환 수정#268
bum0w0 merged 2 commits into
developfrom
fix/SOU-636-fix-null-wishlist

Conversation

@bum0w0

@bum0w0 bum0w0 commented Jun 13, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

릴리스 노트

  • Bug Fixes

    • 비로그인 사용자의 근처 기념품 조회 시 위시리스트 상태 표시 개선
    • 사용자 인증 정보 검증 로직 강화
  • Tests

    • 기념품 서비스의 주요 기능에 대한 포괄적인 단위 테스트 추가 (조회, 생성, 수정, 삭제 등)

bum0w0 added 2 commits June 13, 2026 21:51
- 찜한 기념품이 없는 로그인 유저도 emptySet으로 처리되어 isWishlisted가 false 대신 null로 반환되던 문제 수정
- SouvenirService: 비로그인 시 wishlistedIds를 emptySet → null로 변경
- SouvenirNearbyResponse: isEmpty() 체크 → null 체크로 변경하여
  비로그인(null)과 찜 0개 로그인 유저(false)를 올바르게 구분
@coderabbitai

coderabbitai Bot commented Jun 13, 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: 90b15a62-e881-47e4-ab9a-719693d40546

📥 Commits

Reviewing files that changed from the base of the PR and between eeb1e1a and 01f9c80.

📒 Files selected for processing (4)
  • src/main/java/com/souzip/domain/recommend/general/service/GeneralRecommendationService.java
  • src/main/java/com/souzip/domain/souvenir/dto/SouvenirNearbyResponse.java
  • src/main/java/com/souzip/domain/souvenir/service/SouvenirService.java
  • src/test/java/com/souzip/domain/souvenir/service/SouvenirServiceTest.java

Walkthrough

사용자 인증 검증 강화 및 위시리스트 상태 표현 정규화. GeneralRecommendationService의 토큰 파싱에서 userId를 데이터베이스 조회로 검증하고, SouvenirService의 비로그인 케이스에서 null을 전달하며, SouvenirNearbyResponse의 empty 컬렉션을 null이 아닌 false로 반환하도록 통일함. SouvenirServiceTest로 주요 동작을 검증함.

Changes

사용자 인증 및 위시리스트 처리

Layer / File(s) Summary
GeneralRecommendationService의 토큰 기반 userId 검증
src/main/java/com/souzip/domain/recommend/general/service/GeneralRecommendationService.java
parseUserIdFromToken이 JWT에서 추출한 userId를 userRepository.findById()로 조회해 실제 존재하는 사용자만 인정함. User 및 UserRepository import와 의존성 필드 추가.
근처 기념품 조회 시 위시리스트 null/empty 정규화
src/main/java/com/souzip/domain/souvenir/service/SouvenirService.java, src/main/java/com/souzip/domain/souvenir/dto/SouvenirNearbyResponse.java
getNearbySouvenirs는 비로그인 시 Collections.emptySet() 대신 null을 전달하고, SouvenirNearbyResponse.fromObjectArraywishlistedIds null 판정을 empty 체크 대신 null 체크로 변경해 empty 컬렉션에서 false를 반환함.
SouvenirService 통합 테스트 추가
src/test/java/com/souzip/domain/souvenir/service/SouvenirServiceTest.java
getNearbySouvenirs, getSouvenir, deleteSouvenir, createSouvenirV2, updateSouvenirV2 메서드를 JUnit5 + Mockito로 검증. 비로그인/로그인, 소유자 여부, 성공/예외 시나리오 포함.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • souzip/souzip-api#264: SouvenirServiceGeneralRecommendationService에서 userId 파싱과 위시리스트 조회 메서드를 함께 수정해 찜 여부 계산 로직을 정합성 있게 조정함.
  • souzip/souzip-api#253: GeneralRecommendationService와 위시리스트 관련 SouvenirService 호출에서 userId 추출 및 전달 방식을 일관되게 조정함.
  • souzip/souzip-api#250: SouvenirService 및 SouvenirNearbyResponse에서 wishlistedIds가 empty일 때 isWishlisted 처리와 전달값을 일관되게 변경함.

Suggested labels

bug, test

✨ 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 fix/SOU-636-fix-null-wishlist

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 d596585 into develop Jun 13, 2026
1 of 2 checks 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.

1 participant