Skip to content

Conversation

@7ijin01
Copy link
Member

@7ijin01 7ijin01 commented Sep 4, 2025

📌 PR 개요

  • 관광지 선호 등록 전 이미 등록했는지 여부 확인

✅ 변경사항

  • 선호 여부 확인 api 개발

🔍 체크리스트

  • PR 제목은 명확한가요?
  • 관련 이슈가 있다면 연결했나요?
  • 로컬 테스트는 통과했나요?
  • 코드에 불필요한 부분은 없나요?

📎 관련 이슈

Closes #77


💬 기타 참고사항

Summary by CodeRabbit

  • 신규 기능
    • 인증 사용자 기준으로 특정 관광지가 즐겨찾기에 등록되어 있는지 즉시 확인하는 API가 추가되었습니다.
    • tourSpotId 쿼리 파라미터를 받아 불리언 결과를 표준 응답 형식으로 반환합니다.
  • 문서
    • 해당 API에 대한 문서를 추가하고 예시 응답을 보강했습니다.
    • 성공(200), 인증 실패(401), 서버 오류(500) 경우의 예시가 포함되어 있습니다.

@7ijin01 7ijin01 linked an issue Sep 4, 2025 that may be closed by this pull request
@coderabbitai
Copy link

coderabbitai bot commented Sep 4, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

마이페이지에 즐겨찾기(관광지) 여부를 확인하는 신규 GET 엔드포인트(/mypage/preferences/check)를 추가하고, 이에 대한 문서화와 서비스 로직(존재 여부 조회)을 추가했습니다. 기존 기능은 변경되지 않았습니다.

Changes

Cohort / File(s) Summary
API 문서 추가
src/main/java/com/opendata/docs/MyPageControllerDocs.java
관광지 즐겨찾기 여부 확인 메서드(CheckTourSpot) 문서화 추가. 200/401/500 응답 스펙과 예시, 파라미터(tourSpotId) 및 인증 사용자 명시. 반환: ResponseEntity<ApiResponse<Boolean>>.
컨트롤러 엔드포인트
src/main/java/com/opendata/domain/mypage/controller/MypageController.java
GET /mypage/preferences/check 추가. @RequestParam Long tourSpotId, @AuthenticationPrincipal CustomUserDetails 수신, 서비스 isPreferenceTourSpot 호출 결과를 ApiResponse<Boolean>으로 200 OK 반환.
서비스 로직
src/main/java/com/opendata/domain/mypage/service/MypageService.java
public boolean isPreferenceTourSpot(CustomUserDetails, Long) 추가. 인증 정보에서 userId 추출 후 tourSpotComponentRepository.existsByUserIdAndTourSpotId(userId, tourSpotId) 위임.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    participant C as Client
    participant MC as MypageController
    participant MS as MypageService
    participant R as TourSpotComponentRepository

    C->>MC: GET /mypage/preferences/check<br/>?tourSpotId
    MC->>MS: isPreferenceTourSpot(customUser, tourSpotId)
    MS->>R: existsByUserIdAndTourSpotId(userId, tourSpotId)
    R-->>MS: Boolean (exists)
    MS-->>MC: Boolean
    MC-->>C: 200 OK<br/>ApiResponse<Boolean>
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related issues

Poem

작은 발끝 콩콩, 즐겨찾기 확인해요!
별처럼 반짝—있나요, 없나요?
GET 한 번 톡, 응답은 솔직하게 Boolean!
깡총깡총 토끼는 미소로 OK를 전해요.
오늘도 취향 수호, /preferences/check 고고! 🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 7882430 and 572211f.

📒 Files selected for processing (3)
  • src/main/java/com/opendata/docs/MyPageControllerDocs.java (1 hunks)
  • src/main/java/com/opendata/domain/mypage/controller/MypageController.java (1 hunks)
  • src/main/java/com/opendata/domain/mypage/service/MypageService.java (2 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/#77-preference-check

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@7ijin01 7ijin01 merged commit 48764a1 into main Sep 4, 2025
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.

[feat] 관광지 선호 등록 가능 여부 확인 api

2 participants