Repository navigation
✨ Feat: (사용자) 홈 - 면접관/안내자로 배정된 전체 타임슬롯 스케줄 조회 - #175
Merged
Merged
Conversation
요약사용자의 역할에 따라 필터링된 면접 일정을 조회하는 새로운 엔드포인트 추가 및 이를 지원하는 DTO, 서비스, 저장소, 어셈블러 컴포넌트를 도입했습니다. 변경 사항
시퀀스 다이어그램sequenceDiagram
actor User
participant Client
participant InterviewController
participant InterviewService
participant InterviewScheduleAssembler
participant TimeSlotRepository
participant TimeSlotUserRepository
User->>Client: GET /me/schedules?role=INTERVIEWER
Client->>InterviewController: getMyInterviewSchedule(user, role)
InterviewController->>InterviewService: getMyInterviewSchedule(user, role)
InterviewService->>TimeSlotUserRepository: findMyTimeSlotIds(userId, role)
TimeSlotUserRepository-->>InterviewService: List<Long> timeSlotIds
InterviewService->>TimeSlotRepository: findAllByIdIn(timeSlotIds)
TimeSlotRepository-->>InterviewService: List<TimeSlot> slots
InterviewService->>InterviewScheduleAssembler: loadTimeSlotUsersGrouped(timeSlotIds)
InterviewScheduleAssembler->>TimeSlotUserRepository: findAllByTimeSlotIdInWithUser(timeSlotIds)
TimeSlotUserRepository-->>InterviewScheduleAssembler: List<TimeSlotUser> users
InterviewScheduleAssembler-->>InterviewService: Map<Long, List<TimeSlotUser>>
InterviewService->>InterviewScheduleAssembler: buildScheduleCards(slots, tsUsersBySlotId)
InterviewScheduleAssembler-->>InterviewService: List<ScheduleCard>
InterviewService->>InterviewScheduleAssembler: groupCardsByDate(slots, cards)
InterviewScheduleAssembler-->>InterviewService: List<DateGroup>
InterviewService-->>InterviewController: Schedule DTO
InterviewController-->>Client: SuccessResponse<Schedule>
Client-->>User: 사용자 면접 일정 반환
예상 코드 리뷰 노력🎯 4 (복잡함) | ⏱️ ~50분 관련 가능성 있는 PR
추천 리뷰어
시를 담은 축하 메시지
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
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.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In
`@src/main/java/KUSITMS/WITHUS/domain/interview/timeslot/dto/TimeSlotResponseDTO.java`:
- Around line 53-64: The ScheduleCard.from factory calls
slot.getInterview().getId() without a null check, risking an NPE; update
TimeSlotResponseDTO.ScheduleCard.from to defensively handle a null interview
(e.g., compute interviewId = slot.getInterview() != null ?
slot.getInterview().getId() : null) before constructing the ScheduleCard,
mirroring the null-check pattern used in Detail.from for organizationRole so the
DTO can be created safely when slot.getInterview() is null.
In
`@src/main/java/KUSITMS/WITHUS/domain/interview/timeslotUser/repository/TimeSlotUserJpaRepository.java`:
- Around line 13-20: The JPQL IN query in
TimeSlotUserJpaRepository.findAllByTimeSlotIdInWithUser can fail when given an
empty timeSlotIds list; add a safe wrapper (e.g., default method
findAllByTimeSlotIdInWithUserSafe) on the TimeSlotUserJpaRepository that returns
Collections.emptyList() if timeSlotIds is null or empty, otherwise delegates to
findAllByTimeSlotIdInWithUser(timeSlotIds), so callers can use the safe method
and avoid the Hibernate "in ()" error.
🧹 Nitpick comments (1)
src/main/java/KUSITMS/WITHUS/domain/interview/timeslot/dto/TimeSlotResponseDTO.java (1)
43-52:ScheduleCard레코드에@Schema어노테이션 누락
Detail레코드의 필드들은 모두@Schema어노테이션이 적용되어 있지만,ScheduleCard레코드의 필드들에는 누락되어 있습니다. API 문서화의 일관성을 위해 추가를 고려해 주세요.📝 `@Schema` 어노테이션 추가 제안
public record ScheduleCard( - Long timeSlotId, - Long interviewId, - String roomName, + `@Schema`(description = "타임슬롯 ID") Long timeSlotId, + `@Schema`(description = "인터뷰 ID") Long interviewId, + `@Schema`(description = "면접실 이름") String roomName, `@TimeFormat` LocalTime startTime, `@TimeFormat` LocalTime endTime, - List<ApplicationResponseDTO.Applicant> applicants, - List<UserResponseDTO.Summary> interviewers, - List<UserResponseDTO.Summary> assistants + `@Schema`(description = "배정된 지원자 목록") List<ApplicationResponseDTO.Applicant> applicants, + `@Schema`(description = "면접관 목록") List<UserResponseDTO.Summary> interviewers, + `@Schema`(description = "안내자 목록") List<UserResponseDTO.Summary> assistants ) {
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
✨ Related Issue
📌 Task Details
💬 Review Requirements (Optional)
Summary by CodeRabbit
릴리스 노트
✏️ Tip: You can customize this high-level summary in your review settings.