-
Notifications
You must be signed in to change notification settings - Fork 2
feat: 타임테이블 전체 조회 api, 타임 테이블 상세 조회 api 필드 추가 - #126 #127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
📝 WalkthroughSummary by CodeRabbit
Walkthrough타임테이블 응답 DTO에 필드가 추가되었고, TimetableService가 이벤트 조회를 포함하도록 흐름이 재구성되었습니다. TimetableResponse는 이벤트명 포함으로 시그니처가 변경되었고, TimetableDetailResponse는 시작/종료 일시 필드가 추가되었습니다. 서비스는 EventRetriever 주입 및 예외 매핑이 추가되었습니다. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor C as Client
participant S as TimetableService
participant ER as EventRetriever
participant TR as TimetableRetriever
participant AR as AreaRetriever
participant CR as CategoryRetriever
participant BR as BlockRetriever
C->>S: getEventTimetable(eventId)
rect rgb(240,248,255)
note over S: 중앙화된 조회 및 예외 매핑
S->>ER: findEvent(eventId)
ER-->>S: Event
S->>TR: findTimetableByEvent(eventId)
TR-->>S: Timetable
S->>AR: findAreas(timetableId)
AR-->>S: AreaList
S->>CR: findCategories(timetableId)
CR-->>S: CategoryList
S->>BR: findBlocks(timetableId)
BR-->>S: BlockList
end
S-->>C: TimetableResponse(eventName, startDate, endDate, areas, blocks)
alt 오류 발생
S-->>C: NotfoundTimetableException(ErrorCode: NOT_FOUND_* )
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests
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. Comment |
There was a problem hiding this 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
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/main/java/com/permitseoul/permitserver/domain/eventtimetable/timetable/api/service/TimetableService.java (1)
82-88: event.getName() null 가능성 — 수정 필요src/main/java/com/permitseoul/permitserver/domain/event/core/domain/Event.java에 name 필드에 @NotBlank/@NotNull/@column(nullable = false) 등 제약이 보이지 않습니다(현재는 final + @requiredargsconstructor만 있음). 따라서 TimetableService의 TimetableResponse.of(..., event.getName(), ...)에서 null이 그대로 노출될 수 있습니다.
조치(택1):
- 도메인에 제약 추가: src/main/java/com/permitseoul/permitserver/domain/event/core/domain/Event.java에 @notblank 또는 @nonnull + @column(nullable = false) 추가.
- 또는 서비스에서 null-safe 처리: src/main/java/com/permitseoul/permitserver/domain/eventtimetable/timetable/api/service/TimetableService.java에서 event.getName()이 null일 경우 기본값 사용 또는 예외 처리.
🧹 Nitpick comments (7)
src/main/java/com/permitseoul/permitserver/domain/eventtimetable/timetable/api/dto/TimetableResponse.java (2)
11-14: LocalDateTime 직렬화 타임존 고정 제안서버/배포 환경의 기본 TZ에 따라 직렬화 값이 달라질 수 있습니다. API 일관성을 위해 @jsonformat에 timezone을 명시하는 것을 권장합니다(예: Asia/Seoul).
- @JsonFormat(pattern = "yyyy.MM.dd HH:mm") + @JsonFormat(pattern = "yyyy.MM.dd HH:mm", timezone = "Asia/Seoul") LocalDateTime startDate, - @JsonFormat(pattern = "yyyy.MM.dd HH:mm") + @JsonFormat(pattern = "yyyy.MM.dd HH:mm", timezone = "Asia/Seoul") LocalDateTime endDate,
46-47: 불리언 응답 키 네이밍 통일 검토(isUserLiked vs isLiked)리스트 응답의
isUserLiked와 상세 응답의isLiked가 서로 달라 소비자 혼선을 유발할 수 있습니다. API 호환성을 고려해 즉시 변경이 어렵다면, 차기 버전에서 통일하거나 문서화에 명시하는 것을 권장합니다.src/main/java/com/permitseoul/permitserver/domain/eventtimetable/timetable/api/dto/TimetableDetailResponse.java (3)
16-19: LocalDateTime 직렬화 타임존 고정 제안리스트 응답과 동일하게 TZ 명시를 권장합니다.
- @JsonFormat(pattern = "yyyy.MM.dd HH:mm") + @JsonFormat(pattern = "yyyy.MM.dd HH:mm", timezone = "Asia/Seoul") LocalDateTime startDate, - @JsonFormat(pattern = "yyyy.MM.dd HH:mm") + @JsonFormat(pattern = "yyyy.MM.dd HH:mm", timezone = "Asia/Seoul") LocalDateTime endDate
28-29: 파라미터/필드 명 혼용(blockInfoRedirectUrl ↔ blockInfoUrl) 정리팩토리 파라미터는
blockInfoRedirectUrl, 필드는blockInfoUrl로 달라 가독성이 떨어집니다. 외부 계약을 바꾸지 않고 메서드 시그니처만 정리하는 것을 제안합니다.- final String blockInfoRedirectUrl, + final String blockInfoUrl, ... - blockInfoRedirectUrl, + blockInfoUrl,Also applies to: 39-39
11-11: 불리언 응답 키 네이밍 통일 검토(isLiked vs isUserLiked)동일 도메인 응답 간 키를 통일(예: 둘 다
isLiked또는userLiked)하는 편이 소비자 측면에서 예측 가능성이 높습니다. 문서에도 현 상태/향후 계획을 명시해 주세요.src/main/java/com/permitseoul/permitserver/domain/eventtimetable/timetable/api/service/TimetableService.java (2)
71-77: userId 미입력 시 불필요한 blockIds 계산 제거
userId == null이면blockIds는 사용되지 않습니다. 경로를 분기해 불필요한 리스트 생성을 피하세요.- final List<Long> blockIds = blockList.stream() - .map(TimetableBlock::getTimetableBlockId) - .toList(); - final Set<Long> likedBlockIds = (userId == null) - ? Set.of() - : new HashSet<>(timetableUserLikeRetriever.findLikedBlockIdsIn(userId, blockIds)); + final Set<Long> likedBlockIds; + if (userId == null) { + likedBlockIds = Set.of(); + } else { + final List<Long> blockIds = blockList.stream() + .map(TimetableBlock::getTimetableBlockId) + .toList(); + likedBlockIds = new HashSet<>(timetableUserLikeRetriever.findLikedBlockIdsIn(userId, blockIds)); + }
155-158: 카테고리 색상 미존재 시 에러 처리 적절색상 누락을 조기에 검출하는 현재 방식이 합리적입니다. 운영 가시성을 위해 WARN 로그를 추가해도 좋습니다.
로그 제안:
- 카테고리 ID, 블록 ID, 타임테이블 ID를 포함한 WARN 로그 출력
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
src/main/java/com/permitseoul/permitserver/domain/eventtimetable/timetable/api/dto/TimetableDetailResponse.java(4 hunks)src/main/java/com/permitseoul/permitserver/domain/eventtimetable/timetable/api/dto/TimetableResponse.java(2 hunks)src/main/java/com/permitseoul/permitserver/domain/eventtimetable/timetable/api/service/TimetableService.java(4 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/main/java/com/permitseoul/permitserver/domain/eventtimetable/timetable/api/service/TimetableService.java (1)
src/main/java/com/permitseoul/permitserver/domain/event/core/exception/EventNotfoundException.java (1)
EventNotfoundException(3-4)
🔇 Additional comments (4)
src/main/java/com/permitseoul/permitserver/domain/eventtimetable/timetable/api/dto/TimetableResponse.java (1)
10-10: 검증 결과 — TimetableResponse.of 호출 1건 확인; 인자 개수(5개) 추가 확인 필요src/main/java/com/permitseoul/permitserver/domain/eventtimetable/timetable/api/service/TimetableService.java에서 TimetableResponse.of 호출을 발견했으며 첫 인자로 event.getName()이 전달되고 있습니다. 제공된 스니펫만으로는 호출의 전체 인자 수(5개) 여부를 확정할 수 없어 전체 호출 라인 확인 필요.
src/main/java/com/permitseoul/permitserver/domain/eventtimetable/timetable/api/dto/TimetableDetailResponse.java (1)
16-19: 상세 응답에 시작/종료 일시 추가 — 적절합니다블록 단위의 시간 범위가 상세 응답에 포함된 점 좋습니다.
Also applies to: 29-30, 40-41
src/main/java/com/permitseoul/permitserver/domain/eventtimetable/timetable/api/service/TimetableService.java (2)
45-69: 이벤트/타임테이블/구성요소 일괄 조회 + 예외 매핑 — 깔끔합니다도메인별 NotFound를
NotfoundTimetableException/ErrorCode로 매핑한 흐름이 명료합니다. 유지보수 용이성이 좋아졌습니다.
123-126: 상세 응답 필드 연결 정상블록 시작/종료 시각 및 리다이렉트 URL 전달이 DTO 시그니처 변경과 일치합니다.
🔥Pull requests
⛳️ 작업한 브랜치
👷 작업한 내용
🚨 참고 사항