Skip to content

[Hotfix] 방 조회 관련 api들 공개방 반환/ isPublic 반환 필드 추가#259

Merged
hd0rable merged 2 commits intodevelopfrom
hotfix/#258-isPublic-response-fix
Aug 18, 2025
Merged

[Hotfix] 방 조회 관련 api들 공개방 반환/ isPublic 반환 필드 추가#259
hd0rable merged 2 commits intodevelopfrom
hotfix/#258-isPublic-response-fix

Conversation

@hd0rable
Copy link
Member

@hd0rable hd0rable commented Aug 18, 2025

#️⃣ 연관된 이슈

closes #258

📝 작업 내용

  • @heeeeyong 님의 요청에따라 특정 책으로 모집중인 방 조회시 isPublic 반환 필드를 추가하였습니다
  • 이런 모임방은 어때요? 추천시에 공개방만 추천하도록 수정하였습니다

📸 스크린샷

💬 리뷰 요구사항

리뷰어가 특별히 봐주었으면 하는 부분이 있다면 작성해주세요

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

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

Summary by CodeRabbit

  • 신기능
    • 모집방 카드에 ‘공개’ 여부가 표시되어 방 성격을 한눈에 확인할 수 있습니다.
    • 카테고리 기반의 ‘다른 모집방’ 목록에서는 공개방만 노출되어 탐색 정확도가 향상되었습니다.
    • 책(ISBN) 기준으로 조회되는 방 목록에도 공개 여부가 함께 표시됩니다.
    • 공개/비공개 상태가 명확히 드러나 사용자는 참여 의사를 보다 쉽게 결정할 수 있습니다.

@coderabbitai
Copy link

coderabbitai bot commented Aug 18, 2025

Walkthrough

특정 책의 모집중인 방 조회 응답 DTO에 isPublic 필드를 추가하고, 저장소 조회에서 isPublic 값을 프로젝션해 전달합니다. 카테고리 기반 다른 모집중인 방 조회에는 공개방(isPublic=true) 필터가 추가되었습니다.

Changes

Cohort / File(s) Summary
Response DTO 확장
src/main/java/konkuk/thip/book/adapter/in/web/response/BookRecruitingRoomsResponse.java
내부 record BookRecruitingRoomDto에 boolean isPublic 필드 추가 및 생성자/액세서 확장. 기존 필드는 변경 없음.
저장소 조회 및 프로젝션 수정
src/main/java/konkuk/thip/room/adapter/out/persistence/repository/RoomQueryRepositoryImpl.java
- findRoomsByIsbnOrderByStartDateAsc: QRoomQueryDto 프로젝션에 room.isPublic 추가, 커서용 DateExpression 인자 경로 사용.
- findOtherRecruitingRoomsByCategoryOrderByStartDateAsc: where 절에 room.isPublic.isTrue() 조건 추가(공개방만).

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant Controller
  participant Repository
  participant DB

  Client->>Controller: 특정 책 모집중 방 조회 요청
  Controller->>Repository: findRoomsByIsbnOrderByStartDateAsc(isbn, cursor)
  Repository->>DB: SELECT ... , is_public, start_date ...
  DB-->>Repository: Rows (incl. is_public)
  Repository-->>Controller: DTOs with isPublic
  Controller-->>Client: BookRecruitingRoomsResponse (isPublic 포함)

Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20–30 minutes

Assessment against linked issues

Objective Addressed Explanation
특정 책으로 모집중인 방 조회 시 isPublic 값을 응답에 포함 (#258)
해당 조회 경로에서 isPublic 값을 저장소/프로젝션 계층까지 전달 (#258)

Assessment against linked issues: Out-of-scope changes

Code Change Explanation
공개방만 조회하도록 where 절에 room.isPublic.isTrue() 추가 (src/main/java/konkuk/thip/room/adapter/out/persistence/repository/RoomQueryRepositoryImpl.java: findOtherRecruitingRoomsByCategoryOrderByStartDateAsc) 링크된 이슈는 “특정 책으로 모집중인 방 조회”의 응답에 isPublic 포함이 목적이며, 카테고리 기반 다른 모집중 방 조회의 필터링 변경은 범위에 명시되지 않음.

Possibly related PRs

Suggested reviewers

  • buzz0331
  • seongjunnoh

Poem

깡총깡총, 책방 문 활짝 열렸네
공개방 깃발, isPublic이 말하네
DTO 주머니에 새별 하나 담아서
쿼리 길 따라 빛을 실어 보내네
오늘도 코드밭에 바람 솔솔, 핫픽스 완료! 🐇✨

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/#258-isPublic-response-fix

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.

.and(room.startDate.after(LocalDate.now())) // 모집 마감 시각 > 현재 시각
.and(room.roomId.ne(roomId)) // 현재 방 제외
.and(room.roomId.ne(roomId))// 현재 방 제외
.and(room.isPublic.isTrue()) // 공개방 만
Copy link
Collaborator

Choose a reason for hiding this comment

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

감사합니다

Copy link
Member Author

Choose a reason for hiding this comment

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

어깜작아 넼ㅋㅋㅋ

@github-actions
Copy link

Test Results

411 tests   411 ✅  33s ⏱️
123 suites    0 💤
123 files      0 ❌

Results for commit 13c4fe7.

@hd0rable hd0rable merged commit 7967e04 into develop Aug 18, 2025
3 of 4 checks passed
@hd0rable hd0rable deleted the hotfix/#258-isPublic-response-fix branch August 18, 2025 17:38
Copy link

@coderabbitai coderabbitai bot left a comment

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 (1)
src/main/java/konkuk/thip/room/adapter/out/persistence/repository/RoomQueryRepositoryImpl.java (1)

187-189: 추천 쿼리의 공개방 필터 추가는 적절. ACTIVE 상태 조건도 포함하는 것을 권장

현재 where 절에 공개방 필터가 추가되었지만, 다른 모집중 조회들과 달리 상태(StatusType.ACTIVE) 조건이 없습니다. 비활성/삭제 방이 추천에 섞일 여지가 있어 일관성 차원에서 ACTIVE 조건 추가를 권장합니다.

아래 패치를 고려해 주세요.

@@
-                        room.categoryJpaEntity.value.eq(category)
-                                .and(room.startDate.after(LocalDate.now()))     // 모집 마감 시각 > 현재 시각
-                                .and(room.roomId.ne(roomId))// 현재 방 제외
-                                .and(room.isPublic.isTrue()) // 공개방 만
+                        room.categoryJpaEntity.value.eq(category)
+                                .and(room.startDate.after(LocalDate.now()))     // 모집 마감 시각 > 현재 시각
+                                .and(room.status.eq(StatusType.ACTIVE))         // 활성 방만
+                                .and(room.roomId.ne(roomId))                    // 현재 방 제외
+                                .and(room.isPublic.isTrue())                    // 공개방만

의도적으로 비활성 방도 포함하려는 경우라면 현재 구현 유지가 맞는지 확인 부탁드립니다.

📜 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 1d71900 and 13c4fe7.

📒 Files selected for processing (2)
  • src/main/java/konkuk/thip/book/adapter/in/web/response/BookRecruitingRoomsResponse.java (1 hunks)
  • src/main/java/konkuk/thip/room/adapter/out/persistence/repository/RoomQueryRepositoryImpl.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: build
🔇 Additional comments (2)
src/main/java/konkuk/thip/book/adapter/in/web/response/BookRecruitingRoomsResponse.java (1)

21-22: JSON 프로퍼티 매핑 명시 필요 및 DTO 생성 지점 확인

  • BookRecruitingRoomDto record의 boolean 컴포넌트명 isPublic이 Jackson 버전에 따라 드물게 public으로 인식되는 이슈가 있어, @JsonProperty("isPublic")로 명시적 고정을 권장합니다.
  • 레포 전역에서 BookRecruitingRoomDto( 생성자 호출(6→7 인자) 검토 결과, 정의부 외에는 호출 지점이 발견되지 않았습니다. Controller/Service 또는 매퍼 코드에서 실제로 레코드를 생성·매핑하는 부분이 있다면, 인자 개수와 순서가 올바르게 반영됐는지 반드시 확인하세요.
@@ src/main/java/konkuk/thip/book/adapter/in/web/response/BookRecruitingRoomsResponse.java
-            String deadlineEndDate,
-            boolean isPublic
+            String deadlineEndDate,
+            @com.fasterxml.jackson.annotation.JsonProperty("isPublic") boolean isPublic

(선택) import 추가:

import com.fasterxml.jackson.annotation.JsonProperty;
  • 매핑 로직이 Stream API, MapStruct 등 별도 매퍼를 통해 구현돼 있다면, 해당 코드 역시 함께 점검해 주세요.
  • 가능하다면 관련 단위 테스트를 작성해 JSON 직렬화/역직렬화 결과가 기대대로 나오는지 검증하시는 것을 추천드립니다.
src/main/java/konkuk/thip/room/adapter/out/persistence/repository/RoomQueryRepositoryImpl.java (1)

417-419: RoomQueryDto 생성자 및 최종 응답 매핑에서 isPublic null-safe 처리 검증 필요

  • RoomQueryDto 클래스 생성자 시그니처에 isPublic 매개변수(타입 Boolean 또는 boolean) 선언 여부 확인
  • Boolean일 경우 null 언박싱 시 NPE 방지를 위한 기본값(false) 처리 로직 적용 여부 점검
  • BookRecruitingRoomsResponse.BookRecruitingRoomDto 레코드에 isPublic 필드 포함 여부 확인
  • 서비스/컨트롤러 등 매핑 코드에서 RoomQueryDto → BookRecruitingRoomDto 변환 시 null-safe 처리 적용 검증

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-306] [hotfix] 특정 책으로 모집중인 방 조회 isPublic response 반환

2 participants