Skip to content

Conversation

@seung-in-Yoo
Copy link
Member

@seung-in-Yoo seung-in-Yoo commented Jul 13, 2025

#️⃣ 연관된 이슈

#30

📝 작업 내용

  • 웨이블존 상세 조회 API (GET /api/v1/wayble-zones/{waybleZoneId}) 구현

  • 웨이블존 상세 정보, 편의시설, 운영시간, 이미지 목록 포함

  • 운영시간은 요일별로 분류 후, DTO에 open/close 시간 포함

  • FacilityDto가 웨이블존 목록 조회, 상세 조회 두 부분에서 중복으로 사용하기 때문에 공통 사용을 위해 common -> dto로 추가

  • WaybleZoneService에서 시설 및 이미지가 존재하지 않는다면 null-safe 로직 처리

📸 스크린샷 (선택)

응답성공

웨이블존상세조회성공

응답실패

웨이블존상세조회실패

💬 리뷰 요구사항 (선택)

Summary by CodeRabbit

  • 신규 기능

    • 특정 웨이블존의 상세 정보를 조회할 수 있는 엔드포인트가 추가되었습니다. 상세 정보에는 운영 시간, 시설 정보, 사진 등이 포함됩니다.
  • 버그 수정

    • 웨이블존 목록 응답에서 시설 정보 타입이 일관되게 개선되었습니다.
  • 문서화

    • 웨이블존 관련 API 엔드포인트에 대한 Swagger 문서가 추가되어, 응답 및 파라미터 정보가 명확하게 제공됩니다.

@seung-in-Yoo seung-in-Yoo self-assigned this Jul 13, 2025
@seung-in-Yoo seung-in-Yoo added 💡 feature 기능 구현 및 개발 🔧 refactor 코드 리팩토링 labels Jul 13, 2025
@coderabbitai
Copy link

coderabbitai bot commented Jul 13, 2025

Walkthrough

WaybleZone 상세 조회 API가 새롭게 추가되어, 컨트롤러, 서비스, DTO 계층에 각각 상세 정보를 반환하는 기능이 구현되었습니다. 또한 시설 정보 DTO가 공통 패키지로 분리되어 관련 DTO들이 이를 참조하도록 리팩토링되었습니다.

Changes

파일/경로 변경 요약
.../common/dto/FacilityDto.java 시설 정보용 FacilityDto record 신설, @builder 적용
.../wayblezone/dto/WaybleZoneDetailResponseDto.java WaybleZone 상세 응답 DTO 및 BusinessHourDto record 신설
.../wayblezone/dto/WaybleZoneListResponseDto.java 내부 FacilityDto 삭제, 공통 FacilityDto import로 교체
.../wayblezone/controller/WaybleZoneController.java 상세 조회 엔드포인트 및 Swagger 문서화, 상세 메서드 추가
.../wayblezone/service/WaybleZoneService.java 상세 조회 서비스 메서드 추가, 예외 처리 및 DTO 조립 로직 구현

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant Controller as WaybleZoneController
    participant Service as WaybleZoneService
    participant Repo as WaybleZoneRepository

    Client->>Controller: GET /wayblezone/{waybleZoneId}
    Controller->>Service: getWaybleZoneDetail(waybleZoneId)
    Service->>Repo: findById(waybleZoneId)
    Repo-->>Service: WaybleZone 엔티티 반환/없으면 예외
    Service->>Service: 시설/이미지/영업시간 데이터 조립
    Service-->>Controller: WaybleZoneDetailResponseDto 반환
    Controller-->>Client: 상세 정보 응답 반환
Loading

Possibly related issues

Possibly related PRs

Suggested reviewers

  • KiSeungMin

Poem

🐰
새로운 길을 밝혀주는 상세 API,
시설 정보도 한곳에 모아두니,
토끼는 기뻐 깡충깡충 뛰어요!
영업시간, 사진, 모든 정보 한눈에,
WaybleZone 탐험이 더 쉬워졌죠!

✨ Finishing Touches
  • 📝 Generate Docstrings

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 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: 1

🔭 Outside diff range comments (1)
src/main/java/com/wayble/server/wayblezone/service/WaybleZoneService.java (1)

52-60: 중복 코드를 공통 메서드로 추출하세요.

FacilityDto 빌드 로직이 기존 메서드와 중복됩니다. 이를 별도 메서드로 추출하여 코드 중복을 제거하는 것이 좋겠습니다.

+private FacilityDto buildFacilityDto(WaybleZoneFacility f) {
+    return FacilityDto.builder()
+            .hasSlope(f.isHasSlope())
+            .hasNoDoorStep(f.isHasNoDoorStep())
+            .hasElevator(f.isHasElevator())
+            .hasTableSeat(f.isHasTableSeat())
+            .hasDisabledToilet(f.isHasDisabledToilet())
+            .floorInfo(f.getFloorInfo())
+            .build();
+}

그리고 두 메서드에서 이 공통 메서드를 사용하도록 변경하세요.

Also applies to: 96-103

🧹 Nitpick comments (4)
src/main/java/com/wayble/server/wayblezone/service/WaybleZoneService.java (1)

64-106: 성능 최적화를 위해 fetch join 사용을 고려하세요.

현재 구현에서는 연관된 엔티티들(images, operatingHours)을 지연 로딩으로 가져오므로 N+1 쿼리 문제가 발생할 수 있습니다.

Repository에 fetch join을 사용하는 메서드를 추가하는 것을 고려해보세요:

@Query("SELECT w FROM WaybleZone w " +
       "LEFT JOIN FETCH w.waybleZoneImageList " +
       "LEFT JOIN FETCH w.operatingHours " +
       "WHERE w.id = :id")
Optional<WaybleZone> findByIdWithDetails(@Param("id") Long id);
src/main/java/com/wayble/server/wayblezone/controller/WaybleZoneController.java (2)

27-38: API 문서화가 잘 되어 있습니다.

OpenAPI 어노테이션을 통한 상세한 API 문서화가 잘 구현되었습니다. 다만 향후 국제화를 고려한다면 설명 텍스트를 메시지 프로퍼티로 분리하는 것을 고려해보세요.


48-51: 일관성을 위해 ApiResponses 어노테이션 스타일을 통일하세요.

기존 메서드는 @ApiResponses(value = {}) 형태를, 새 메서드는 @ApiResponses({}) 형태를 사용합니다. 일관성을 위해 스타일을 통일하는 것이 좋겠습니다.

src/main/java/com/wayble/server/wayblezone/dto/WaybleZoneDetailResponseDto.java (1)

24-27: BusinessHourDto의 타입 고려사항

open, close 필드가 String 타입으로 정의되어 있는데, 이는 유연성을 제공하지만 타입 안전성은 떨어집니다. 현재 구현이 요구사항에 맞다면 문제없지만, 향후 시간 연산이 필요하다면 LocalTime 사용을 고려해보세요.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 2b11abe and b5ff9ef.

📒 Files selected for processing (5)
  • src/main/java/com/wayble/server/common/dto/FacilityDto.java (1 hunks)
  • src/main/java/com/wayble/server/wayblezone/controller/WaybleZoneController.java (2 hunks)
  • src/main/java/com/wayble/server/wayblezone/dto/WaybleZoneDetailResponseDto.java (1 hunks)
  • src/main/java/com/wayble/server/wayblezone/dto/WaybleZoneListResponseDto.java (2 hunks)
  • src/main/java/com/wayble/server/wayblezone/service/WaybleZoneService.java (2 hunks)
🔇 Additional comments (5)
src/main/java/com/wayble/server/wayblezone/dto/WaybleZoneListResponseDto.java (1)

3-3: 리팩토링이 잘 적용되었습니다.

FacilityDto를 공통 패키지로 분리하여 코드 중복을 제거한 것이 좋은 개선입니다. 이를 통해 일관성 있는 시설 정보 표현이 가능해졌습니다.

src/main/java/com/wayble/server/common/dto/FacilityDto.java (1)

5-13: 잘 설계된 공통 DTO입니다.

Record와 @builder 조합으로 불변 객체를 만들어 안전한 설계가 되었습니다. 시설 관련 필드명들도 명확하여 가독성이 좋습니다.

src/main/java/com/wayble/server/wayblezone/service/WaybleZoneService.java (1)

75-84: 운영시간 맵 생성 로직이 우아합니다.

LinkedHashMap을 사용하여 순서를 보장하고, DateTimeFormatter로 일관된 시간 포맷을 제공하는 것이 좋은 구현입니다.

src/main/java/com/wayble/server/wayblezone/controller/WaybleZoneController.java (1)

46-56: 상세 조회 엔드포인트가 올바르게 구현되었습니다.

RESTful한 URL 패턴과 적절한 검증, 문서화가 포함된 깔끔한 구현입니다.

src/main/java/com/wayble/server/wayblezone/dto/WaybleZoneDetailResponseDto.java (1)

9-22: 잘 설계된 응답 DTO입니다.

Record 타입과 빌더 패턴을 사용한 불변 객체 설계가 훌륭합니다. 공통 FacilityDto 재사용으로 일관성도 확보되었습니다.

Comment on lines +18 to +21
String imageUrl,
FacilityDto facilities,
Map<String, BusinessHourDto> businessHours,
List<String> photos
Copy link

@coderabbitai coderabbitai bot Jul 13, 2025

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

필드 네이밍의 명확성을 검토하세요.

imageUrlphotos 필드의 관계가 명확하지 않습니다. imageUrl이 대표 이미지이고 photos가 전체 이미지 목록이라면, mainImageUrl 등의 더 명확한 네이밍을 고려해보세요.

다음 스크립트로 사용 패턴을 확인해주세요:


🏁 Script executed:

#!/bin/bash
# imageUrl과 photos 필드 사용 패턴 확인
rg -A 5 -B 5 "imageUrl|photos" --type java

Length of output: 10064


필드 네이밍 명확성 검토
imageUrl이 첫 번째(대표) 이미지이고 photos가 전체 이미지 목록임이 확인되었습니다. 싱글 vs 플럴 구분으로도 식별은 되지만, 가독성과 명시성을 위해 아래와 같이 변경을 제안드립니다.

– 대상 파일
• src/main/java/com/wayble/server/wayblezone/dto/WaybleZoneDetailResponseDto.java
• src/main/java/com/wayble/server/wayblezone/dto/WaybleZoneListResponseDto.java

– 제안 변경사항

- String imageUrl,
+ String mainImageUrl,- List<String> photos
+ List<String> photoUrls

서비스 레이어에서 .imageUrl(imageUrl).mainImageUrl(imageUrl) ,
.photos(photoUrls).photoUrls(photoUrls) 로 빌더 호출부도 함께 수정해주세요.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
String imageUrl,
FacilityDto facilities,
Map<String, BusinessHourDto> businessHours,
List<String> photos
String mainImageUrl,
FacilityDto facilities,
Map<String, BusinessHourDto> businessHours,
List<String> photoUrls
🤖 Prompt for AI Agents
In
src/main/java/com/wayble/server/wayblezone/dto/WaybleZoneDetailResponseDto.java
around lines 18 to 21, rename the field 'imageUrl' to 'mainImageUrl' and
'photos' to 'photoUrls' to improve clarity and explicitness. Also, update all
corresponding builder method calls in the service layer from
'.imageUrl(imageUrl)' to '.mainImageUrl(imageUrl)' and from '.photos(photoUrls)'
to '.photoUrls(photoUrls)' to maintain consistency.

Copy link
Member Author

Choose a reason for hiding this comment

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

이거는 굳이 수정 안해도 될 것 같아서 만약 나중에 수정이 필요하다면 그때 수정할게

Copy link

Choose a reason for hiding this comment

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

@seung-in-Yoo 네, 알겠습니다! 현재 필드명으로 충분히 의미가 전달되고 있으니 나중에 필요할 때 변경하시는 것으로 하겠습니다. 👍

@seung-in-Yoo seung-in-Yoo linked an issue Jul 13, 2025 that may be closed by this pull request
11 tasks
@seung-in-Yoo seung-in-Yoo added the 🛠️ fix 기능 오류 및 코드 개선이 필요한 곳 수정 label Jul 13, 2025
@seung-in-Yoo seung-in-Yoo merged commit 5c870b0 into develop Jul 13, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💡 feature 기능 구현 및 개발 🛠️ fix 기능 오류 및 코드 개선이 필요한 곳 수정 🔧 refactor 코드 리팩토링

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feat] 웨이블존 목록 조회, 상세 조회 API 구현

2 participants