Skip to content

[hotfix] 피드 단일 조회 response 수정#233

Merged
seongjunnoh merged 2 commits into
developfrom
hotfix/#232-feed-show-single-response
Aug 16, 2025
Merged

[hotfix] 피드 단일 조회 response 수정#233
seongjunnoh merged 2 commits into
developfrom
hotfix/#232-feed-show-single-response

Conversation

@seongjunnoh

@seongjunnoh seongjunnoh commented Aug 16, 2025

Copy link
Copy Markdown
Collaborator

#️⃣ 연관된 이슈

closes #232

📝 작업 내용

이슈 참고해주시면 됩니다

  • 방 검색 api 의 스웨거 description 오탈자 수정도 같이 하였습니다

📸 스크린샷

image

💬 리뷰 요구사항

📌 PR 진행 시 이러한 점들을 참고해 주세요

* P1 : 꼭 반영해 주세요 (Request Changes) - 이슈가 발생하거나 취약점이 발견되는 케이스 등
* P2 : 반영을 적극적으로 고려해 주시면 좋을 것 같아요 (Comment)
* P3 : 이런 방법도 있을 것 같아요~ 등의 사소한 의견입니다 (Chore)

Summary by CodeRabbit

  • 신기능

    • 피드 상세 및 사용자별 피드 조회 응답에 도서 제목(bookTitle) 필드가 추가되어 화면에서 책 제목을 확인할 수 있습니다.
  • 문서

    • 방 모집 검색 API 설명의 오탈자(“첵제목” → “책제목”)를 수정하여 안내 문구를 명확히 했습니다.

@seongjunnoh seongjunnoh linked an issue Aug 16, 2025 that may be closed by this pull request
2 tasks
@coderabbitai

coderabbitai Bot commented Aug 16, 2025

Copy link
Copy Markdown

Walkthrough

피드 상세 조회 응답 객체에 bookTitle 필드가 추가되었고, 매퍼에서 해당 필드를 Book.title로 매핑하도록 확장했다. 방 검색 API의 OpenAPI 설명 문구 오타를 수정했다. 로직 흐름이나 시그니처는 유지되며, 레코드/응답 필드만 확장되었다.

Changes

Cohort / File(s) Summary of Changes
Feed 응답 모델 확장
src/main/java/.../feed/adapter/in/web/response/FeedShowSingleResponse.java
bookTitle: String 필드 추가로 레코드 구성 요소 및 canonical 생성자 시그니처 확장
피드 매퍼 필드 매핑 추가
src/main/java/.../feed/application/mapper/FeedQueryMapper.java
Book.title -> bookTitle 매핑 추가: toFeedShowSingleResponse, toFeedShowByUserResponse.FeedDto
OpenAPI 문구 수정
src/main/java/.../room/adapter/in/web/RoomQueryController.java
설명 텍스트 오타 수정(“첵제목” → “책제목”), 로직 변경 없음

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant Controller as FeedQueryController
  participant Service as FeedService
  participant Mapper as FeedQueryMapper
  participant Repo as Feed/Book Repos

  Client->>Controller: GET /feeds/{id}
  Controller->>Service: findFeedDetail(id, userId)
  Service->>Repo: fetch Feed, User, Book
  Repo-->>Service: Feed, User, Book
  Service->>Mapper: toFeedShowSingleResponse(Feed, User, Book, isSaved, isLiked, userId)
  Mapper-->>Service: FeedShowSingleResponse(bookTitle 포함)
  Service-->>Controller: Response DTO
  Controller-->>Client: 200 OK (bookTitle 포함)
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Assessment against linked issues

Objective Addressed Explanation
response에 bookTitle 데이터 추가 (#232)

Assessment against linked issues: Out-of-scope changes

Code Change Explanation
OpenAPI 설명 오타 수정 “첵제목” → “책제목” (src/main/java/konkuk/thip/room/adapter/in/web/RoomQueryController.java: searchRecruitingRooms 설명) 링크된 이슈는 피드 상세 응답에 bookTitle 추가만 요구하며, 룸 검색 API 문구 수정은 범위 밖입니다.

Possibly related PRs

Suggested labels

👻 성준, 🔥 hotfix

Suggested reviewers

  • hd0rable
  • buzz0331

Poem

토끼가 폴짝, 새 책 냄새 솔솔
피드에 제목 한 줄, 반짝 별빛이 올-
맵퍼는 살며시 제목을 실어 나르고,
응답은 또렷이 책 이름을 안고,
버그는 안녕! 뜀박질로 마감 🎉📚🐇

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch hotfix/#232-feed-show-single-response

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

@github-actions

Copy link
Copy Markdown

Test Results

399 tests   399 ✅  31s ⏱️
119 suites    0 💤
119 files      0 ❌

Results for commit 9677020.

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

Actionable comments posted: 0

🧹 Nitpick comments (3)
src/main/java/konkuk/thip/room/adapter/in/web/RoomQueryController.java (2)

35-38: 오탈자 수정 좋습니다. 문구 일관성 소폭 제안 (P3)

설명 내 표현을 일관화(띄어쓰기/접속 조사)하면 가독성이 좋아집니다.

아래처럼 미세 수정 제안드립니다.

-            description = "검색어(= 방이름 or 책제목), 카테고리 와 매핑되는 모집중인 방을 검색합니다. 공개/비공개 방 모두 검색 가능합니다."
+            description = "검색어(= 방 이름 또는 책 제목), 카테고리와 매핑되는 모집중인 방을 검색합니다. 공개/비공개 방 모두 검색 가능합니다."

33-33: 필드 명명 일관성 제안: UseCase 캐멀 케이스 정렬 (P3)

다른 필드들과 동일한 캐멀 케이스를 맞추면 일관성이 좋아집니다. 런타임 영향은 없으며 Lombok(@requiredargsconstructor) + Spring 타입 주입 특성상 안전합니다.

아래와 같이 rename 제안드립니다.

-    private final RoomGetDeadlinePopularUseCase roomGetDeadlinePopularUsecase;
+    private final RoomGetDeadlinePopularUseCase roomGetDeadlinePopularUseCase;
...
-        return BaseResponse.ok(roomGetDeadlinePopularUsecase.getDeadlineAndPopularRoomList(category, userId));
+        return BaseResponse.ok(roomGetDeadlinePopularUseCase.getDeadlineAndPopularRoomList(category, userId));

Also applies to: 159-159

src/main/java/konkuk/thip/feed/application/mapper/FeedQueryMapper.java (1)

79-82: bookTitle 매핑 추가 좋습니다. null 안전성 여부 확인 (P2)

book 객체가 항상 존재한다는 전제라면 현재 구현으로 충분합니다. 혹시라도 book이 null일 수 있다면 NPE를 예방하는 표현식 매핑으로 바꾸는 것을 권장합니다.

아래와 같이 변경 시 null에 안전합니다.

-    @Mapping(target = "bookTitle", source = "book.title")
+    @Mapping(target = "bookTitle", expression = "java(book != null ? book.getTitle() : null)")

검증 스크립트(선택): 상세 조회에서 book이 null 가능성이 있는지, 혹은 쿼리/조인 상 항상 보장되는지 관련 서비스/리포지토리를 훑어볼 수 있습니다. 필요하시면 어떤 어댑터/리포지토리 파일을 살펴볼지 지목해주시면 스크립트 드리겠습니다.

📜 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 bf32aa8 and 9677020.

📒 Files selected for processing (3)
  • src/main/java/konkuk/thip/feed/adapter/in/web/response/FeedShowSingleResponse.java (1 hunks)
  • src/main/java/konkuk/thip/feed/application/mapper/FeedQueryMapper.java (2 hunks)
  • src/main/java/konkuk/thip/room/adapter/in/web/RoomQueryController.java (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: seongjunnoh
PR: THIP-TextHip/THIP-Server#113
File: src/main/java/konkuk/thip/recentSearch/adapter/out/persistence/RecentSearchCommandPersistenceAdapter.java:38-44
Timestamp: 2025-07-30T14:05:04.945Z
Learning: seongjunnoh는 코드 최적화 제안에 대해 구체적인 기술적 근거와 효율성 차이를 이해하고 싶어하며, 성능 개선 방식에 대한 상세한 설명을 선호한다.
Learnt from: seongjunnoh
PR: THIP-TextHip/THIP-Server#93
File: src/main/java/konkuk/thip/room/adapter/out/persistence/RoomQueryPersistenceAdapter.java:49-114
Timestamp: 2025-07-28T16:44:31.224Z
Learning: seongjunnoh는 코드 중복 문제에 대한 리팩토링 제안을 적극적으로 수용하고 함수형 인터페이스를 활용한 해결책을 선호한다.
Learnt from: seongjunnoh
PR: THIP-TextHip/THIP-Server#195
File: src/main/java/konkuk/thip/feed/application/mapper/FeedQueryMapper.java:0-0
Timestamp: 2025-08-13T05:22:32.287Z
Learning: seongjunnoh는 데이터 무결성과 중복 방지에 대한 고민이 깊으며, LinkedHashSet을 활용한 중복 제거와 순서 보장을 동시에 달성하는 솔루션을 선호한다.
Learnt from: seongjunnoh
PR: THIP-TextHip/THIP-Server#180
File: src/main/java/konkuk/thip/room/application/service/AttendanceCheckCreateService.java:22-40
Timestamp: 2025-08-14T09:15:31.332Z
Learning: seongjunnoh는 기술적 완벽성보다 실제 비즈니스 시나리오와 사용자 행동 패턴을 우선 고려하며, 발생 가능성이 낮은 엣지 케이스보다는 실용적인 구현을 선호한다.
Learnt from: seongjunnoh
PR: THIP-TextHip/THIP-Server#112
File: src/main/java/konkuk/thip/feed/adapter/out/persistence/repository/FeedQueryRepositoryImpl.java:272-272
Timestamp: 2025-07-30T10:44:34.115Z
Learning: seongjunnoh는 피드 커서 페이지네이션에서 LocalDateTime 단일 커서 방식을 선호하며, 복합 키 기반 커서보다 구현 단순성과 성능을 우선시한다.
🔇 Additional comments (2)
src/main/java/konkuk/thip/feed/adapter/in/web/response/FeedShowSingleResponse.java (1)

11-11: bookTitle 필드 추가 적절합니다 (P2: 클라이언트 영향 점검 권장)

  • 응답 스키마 비파괴적 확장으로 서버 로직에는 영향이 없습니다.
  • new FeedShowSingleResponse(...) 호출은 레포 전역에서 발견되지 않아, 대부분 MapStruct 매핑 경로만 사용 중임을 확인했습니다.
  • 다만 Strict JSON 스키마 검증이나 필드 순서에 의존하는 클라이언트가 있을 수 있으니, 릴리즈 노트 공유 및 클라이언트 테스트 진행을 권장드립니다.
src/main/java/konkuk/thip/feed/application/mapper/FeedQueryMapper.java (1)

55-61: 확인 완료: 모든 응답 DTO에 bookTitle 암시적 매핑 적용
FeedQueryDto에 bookTitle 필드가 정의되어 있고, MapStruct가 이름 기반 암시적 매핑을 지원하므로 FeedShowByUserResponse·FeedShowAllResponse·FeedShowMineResponse 등 모든 관련 DTO에 bookTitle이 정상 반영됩니다.

@seongjunnoh seongjunnoh merged commit 9d3a218 into develop Aug 16, 2025
4 checks passed
@seongjunnoh seongjunnoh deleted the hotfix/#232-feed-show-single-response branch August 16, 2025 07:13
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.

[THIP2025-285] [hotfix] 피드 상세 조회 api response 수정

1 participant