Skip to content

Conversation

@leegwichan
Copy link
Member

@leegwichan leegwichan commented Jul 29, 2025

✨ 개요

  • 스토리 상세 조회 API에 회원 정보 추가

🧾 관련 이슈

closed #121

🔍 참고 사항 (선택)

DEV 톡방 참고해주세요!

Summary by CodeRabbit

  • 신규 기능

    • 스토리 상세 조회 시 응답에 회원 ID와 닉네임 정보가 추가되었습니다.
  • 테스트

    • 스토리 상세 조회 API 테스트 및 문서화에 회원 ID와 닉네임 필드에 대한 검증이 추가되었습니다.

@coderabbitai
Copy link

coderabbitai bot commented Jul 29, 2025

Walkthrough

스토리 상세 조회 API의 응답에 회원 정보(memberId, memberNickname)가 추가되었습니다. 서비스 로직, 응답 DTO, 컨트롤러 테스트, 문서화 테스트 모두 해당 필드를 반영하도록 수정되었습니다.

Changes

Cohort / File(s) Change Summary
StoryResponse DTO 확장
src/main/java/eatda/controller/story/StoryResponse.java
StoryResponse 레코드에 memberId(long), memberNickname(String) 필드 추가
스토리 서비스 로직 수정
src/main/java/eatda/service/story/StoryService.java
getStory 메서드에서 StoryResponse 생성 시 회원 ID, 닉네임 포함하도록 파라미터 추가
컨트롤러 단위 테스트 보강
src/test/java/eatda/controller/story/StoryControllerTest.java
테스트용 StoryResponse 및 응답 검증에 신규 필드 포함
API 문서화 테스트 보강
src/test/java/eatda/document/story/StoryDocumentTest.java
문서화 및 응답 예시에 신규 필드 포함, 필드 설명 추가

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant Controller
    participant StoryService
    participant Repository

    Client->>Controller: GET /story/{id}
    Controller->>StoryService: getStory(storyId)
    StoryService->>Repository: findStoryById(storyId)
    Repository-->>StoryService: Story + Member 정보 반환
    StoryService-->>Controller: StoryResponse(스토리 + 회원정보)
    Controller-->>Client: StoryResponse(스토리 + 회원정보)
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Assessment against linked issues

Objective Addressed Explanation
스토리 상세 조회 API에 회원 정보(memberId, memberNickname) 추가 (#121)

Possibly related PRs

Suggested labels

fix

Poem

🐰
스토리 속 주인공, 이제는 누굴까?
회원 정보도 척척, 응답에 담았네!
닉네임과 아이디, 함께 춤추며
테스트와 문서도 모두 새 옷 입었지.
토끼는 기뻐, API가 더 친절해졌으니!
🥕

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1318cfe and 5771817.

📒 Files selected for processing (4)
  • src/main/java/eatda/controller/story/StoryResponse.java (1 hunks)
  • src/main/java/eatda/service/story/StoryService.java (1 hunks)
  • src/test/java/eatda/controller/story/StoryControllerTest.java (2 hunks)
  • src/test/java/eatda/document/story/StoryDocumentTest.java (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: test
🔇 Additional comments (4)
src/main/java/eatda/controller/story/StoryResponse.java (1)

11-12: 깔끔한 구현입니다!

회원 정보 필드들이 적절한 타입으로 올바르게 추가되었습니다. 레코드 끝에 필드를 배치한 것도 생성자 매개변수 순서의 하위 호환성을 유지하는 좋은 접근입니다.

src/test/java/eatda/controller/story/StoryControllerTest.java (1)

99-101: 테스트 커버리지가 완벽합니다!

새로운 회원 정보 필드들에 대한 모킹과 검증이 올바르게 추가되었습니다. 테스트 데이터와 어설션이 모두 일관성 있게 업데이트되었습니다.

Also applies to: 120-121

src/main/java/eatda/service/story/StoryService.java (1)

104-106: Story 엔티티의 Member 관계 매핑 null 안전성 확인

서비스에서 story.getMember()를 호출할 때 NullPointerException이 발생하지 않도록 아래 사항을 점검해주세요:

  • src/main/java/eatda/domain/story/Story.java
    • Member 관계에 @ManyToOne(optional = false) 또는 @JoinColumn(nullable = false) 어노테이션이 적용되어 있는지
  • Lombok @Builder 사용 시 member 필드가 항상 초기화되도록 설계되었는지

필요하다면 매핑 어노테이션을 보강하거나 빌더 로직을 수정하여 member가 절대 null이 될 수 없도록 보장해주세요.

src/test/java/eatda/document/story/StoryDocumentTest.java (1)

167-169: API 문서화가 완벽하게 업데이트되었습니다!

새로운 회원 정보 필드들에 대한 명확한 설명이 추가되었고, 테스트 데이터도 일관성 있게 업데이트되었습니다. API 문서의 완성도가 높습니다.

Also applies to: 182-184

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/PRODUCT-213

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.
    • Explain this complex logic.
    • 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. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • 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 src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

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

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai 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.

Documentation and Community

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

@sonarqubecloud
Copy link

Copy link
Member

@lvalentine6 lvalentine6 left a comment

Choose a reason for hiding this comment

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

이번 PR도 고생하셨습니다! 🦖
빠르게 수정사항 반영하셨군요! 👍🏻

@leegwichan leegwichan merged commit 4eb4fdb into develop Jul 29, 2025
7 checks passed
@leegwichan leegwichan deleted the fix/PRODUCT-213 branch July 29, 2025 13:51
@github-actions
Copy link

🎉 This PR is included in version 1.4.0-develop.33 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@github-actions
Copy link

🎉 This PR is included in version 1.5.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[PRODUCT-213] [Fix] 스토리 상세 조회 API에 회원 정보 추가

3 participants