Skip to content

[hotfix] 기록장 조회시 isbn 반환 / 마감임박,인기방 조회시 recruitCount 반환#138

Merged
buzz0331 merged 2 commits intodevelopfrom
hotfix/#137-return-isbn-and-recruitCount
Aug 5, 2025
Merged

[hotfix] 기록장 조회시 isbn 반환 / 마감임박,인기방 조회시 recruitCount 반환#138
buzz0331 merged 2 commits intodevelopfrom
hotfix/#137-return-isbn-and-recruitCount

Conversation

@buzz0331
Copy link
Contributor

@buzz0331 buzz0331 commented Aug 5, 2025

#️⃣ 연관된 이슈

closes #137

📝 작업 내용

  • 피드 작성시 화면 조회 api 통합을 위해 기록장 -> 피드 작성 화면으로 넘어갈때 책 상세정보를 받아오기 위해 기록장 조회에서 isbn을 반환합니다.
  • 마감임박/인기방 조회시 최대 방 인원수를 의미하는 recruitCount를 반환합니다. (@rbqks529 님의 요청)

📸 스크린샷

💬 리뷰 요구사항

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

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

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

Summary by CodeRabbit

  • 신규 기능

    • 검색 결과에 ISBN 정보가 추가되었습니다.
    • 인기 마감 임박 방 목록 및 관련 데이터에 최대 모집 인원(recruitCount) 정보가 표시됩니다.
  • 버그 수정

    • 최대 모집 인원(recruitCount)이 0보다 큰 값만 허용되도록 검증이 추가되었습니다.

@buzz0331 buzz0331 self-assigned this Aug 5, 2025
@coderabbitai
Copy link

coderabbitai bot commented Aug 5, 2025

Walkthrough

기록장 조회 응답에 ISBN 필드가 추가되고, 책 전체 페이지수 및 총평 작성 가능 여부 조회 응답에 recruitCount 필드가 포함되었습니다. 관련 DTO, 서비스, 레코드, 쿼리, 검증 로직 등이 해당 필드를 지원하도록 수정되었습니다.

Changes

Cohort / File(s) Change Summary
기록장 조회 응답 ISBN 추가
src/main/java/konkuk/thip/record/adapter/in/web/response/RecordSearchResponse.java, src/main/java/konkuk/thip/record/application/service/RecordSearchService.java
RecordSearchResponse에 isbn 필드 추가 및 서비스에서 해당 값 반환하도록 수정
방 조회 recruitCount 추가
src/main/java/konkuk/thip/room/adapter/in/web/response/RoomGetDeadlinePopularResponse.java, src/main/java/konkuk/thip/room/adapter/out/persistence/repository/RoomQueryRepositoryImpl.java, src/main/java/konkuk/thip/room/application/port/out/dto/RoomQueryDto.java
RoomDto, RoomQueryDto에 recruitCount 필드 추가, 쿼리에서 recruitCount 조회 및 반환, RoomQueryDto에 recruitCount > 0 검증 추가

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant RecordSearchService
    participant Book

    Client->>RecordSearchService: 기록장 조회 요청
    RecordSearchService->>Book: Book 정보 조회
    RecordSearchService-->>Client: RecordSearchResponse (isbn 포함)
Loading
sequenceDiagram
    participant Client
    participant RoomQueryRepositoryImpl
    participant DB

    Client->>RoomQueryRepositoryImpl: 방 리스트/상세 조회 요청
    RoomQueryRepositoryImpl->>DB: recruitCount 포함 쿼리 실행
    RoomQueryRepositoryImpl-->>Client: RoomQueryDto (recruitCount 포함)
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Assessment against linked issues

Objective (Issues) Addressed Explanation
기록장 조회시 isbn 반환 (#137)
책 전체 페이지수 및 총평 작성 가능 여부 조회시 recruitCount 반환 (#137)

Possibly related PRs

Suggested labels

🧸 현준

Poem

🐰
기록장엔 ISBN이 쏙,
방 정보엔 recruitCount도 톡!
토끼는 코드를 살피며
꼼꼼히 리뷰를 하죠,
오늘도 변화 가득한
서버의 봄날을 맞이해요!
📚✨

Note

⚡️ Unit Test Generation is now available in beta!

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

✨ 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/#137-return-isbn-and-recruitCount

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

Support

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

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.

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

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.

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 (2)
src/main/java/konkuk/thip/record/application/service/RecordSearchService.java (1)

106-112: ISBN 필드가 null 인 경우의 처리 여부 확인 필요

book.getIsbn() 이 DB에 따라 null 이 될 가능성이 있으면, 프론트에 그대로 null 이 내려가거나 직렬화 과정에서 누락될 수 있습니다.
API 컨벤션상 빈 문자열/기본값을 내려주거나 400 에러를 반환해야 하는지 확인해 주세요.

-            .isbn(book.getIsbn())
+            .isbn(
+                Optional.ofNullable(book.getIsbn())
+                        .orElse("")
+            )
src/main/java/konkuk/thip/record/adapter/in/web/response/RecordSearchResponse.java (1)

10-13: 신규 필드 추가에 따른 호환성·문서 업데이트 확인

isbn 필드가 추가되면서 Canonical Constructor 시그니처가 변경되었습니다.
기존에 생성자를 직접 호출하던 코드, 테스트, OpenAPI/Swagger 문서가 깨지지 않는지 확인 바랍니다.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e17a50a and 96d437e.

📒 Files selected for processing (5)
  • src/main/java/konkuk/thip/record/adapter/in/web/response/RecordSearchResponse.java (1 hunks)
  • src/main/java/konkuk/thip/record/application/service/RecordSearchService.java (1 hunks)
  • src/main/java/konkuk/thip/room/adapter/in/web/response/RoomGetDeadlinePopularResponse.java (1 hunks)
  • src/main/java/konkuk/thip/room/adapter/out/persistence/repository/RoomQueryRepositoryImpl.java (3 hunks)
  • src/main/java/konkuk/thip/room/application/port/out/dto/RoomQueryDto.java (2 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: buzz0331
PR: THIP-TextHip/THIP-Server#78
File: src/main/java/konkuk/thip/user/application/port/out/FollowingQueryPort.java:3-3
Timestamp: 2025-07-14T18:22:56.538Z
Learning: THIP 프로젝트에서는 Query API(조회 API)에 한해서는 application 계층에서 adapter.in.web.response 패키지의 response DTO를 직접 참조하는 것을 허용함. 이는 CQRS 아키텍처에서 읽기 전용 작업의 효율성을 위한 팀 컨벤션임.
📚 Learning: thip 프로젝트에서는 cqrs port 분리 시 다음 컨벤션을 따름: commandport에는 findbyxxx를 통해 도메인 엔티티를 찾아오는 메서드를 추가하고, querypo...
Learnt from: seongjunnoh
PR: THIP-TextHip/THIP-Server#43
File: src/main/java/konkuk/thip/book/application/port/out/BookCommandPort.java:0-0
Timestamp: 2025-07-03T03:05:05.031Z
Learning: THIP 프로젝트에서는 CQRS Port 분리 시 다음 컨벤션을 따름: CommandPort에는 findByXXX를 통해 도메인 엔티티를 찾아오는 메서드를 추가하고, QueryPort에는 조회 API의 response에 해당하는 데이터들을 DB로부터 조회하는 메서드를 추가함.

Applied to files:

  • src/main/java/konkuk/thip/room/adapter/out/persistence/repository/RoomQueryRepositoryImpl.java
⏰ 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 (6)
src/main/java/konkuk/thip/room/adapter/in/web/response/RoomGetDeadlinePopularResponse.java (1)

13-13: 필드 추가가 올바르게 구현되었습니다.

recruitCount 필드가 적절한 위치에 추가되었고, 주석도 명확합니다.

src/main/java/konkuk/thip/room/application/port/out/dto/RoomQueryDto.java (2)

14-14: 필드 추가가 적절합니다.

recruitCount 필드가 올바른 위치에 추가되었습니다.


24-24: 검증 로직이 올바르게 구현되었습니다.

recruitCount는 0보다 커야 한다는 비즈니스 규칙이 적절히 검증되고 있습니다.

src/main/java/konkuk/thip/room/adapter/out/persistence/repository/RoomQueryRepositoryImpl.java (3)

346-346: QueryDSL 프로젝션에 recruitCount 필드가 올바르게 추가되었습니다.

마감임박 방 조회 쿼리에 recruitCount 필드가 일관되게 포함되었습니다.


366-366: QueryDSL 프로젝션에 recruitCount 필드가 올바르게 추가되었습니다.

인기방 조회 쿼리에 recruitCount 필드가 일관되게 포함되었습니다.


430-430: 공통 쿼리 메서드에 recruitCount 필드가 올바르게 추가되었습니다.

fetchMyRooms 메서드의 QueryDSL 프로젝션에 recruitCount 필드가 일관되게 포함되어 모든 사용자 참여 방 조회 경로에서 해당 데이터가 반환됩니다.

@buzz0331 buzz0331 merged commit db722f4 into develop Aug 5, 2025
2 checks passed
@buzz0331 buzz0331 deleted the hotfix/#137-return-isbn-and-recruitCount branch August 5, 2025 05:29
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-194] [hotfix] 기록장 조회시 isbn 반환 / 책 전체 페이지수 및 총평 작성 가능 여부 조회시 recruitCount 반환

2 participants