Skip to content

Refactor : 내 웨이팅 정보 조회 로직 리팩토링 #362

Merged
Jjiggu merged 7 commits intodevelopfrom
refactor#361-getMyWaiting
Feb 13, 2026
Merged

Refactor : 내 웨이팅 정보 조회 로직 리팩토링 #362
Jjiggu merged 7 commits intodevelopfrom
refactor#361-getMyWaiting

Conversation

@Jjiggu
Copy link
Contributor

@Jjiggu Jjiggu commented Feb 13, 2026

작업 요약

  • 내 웨이팅 정보 조회 로직 리팩토링

Issue Link

#361

문제점 및 어려움

추후 성능 개선 예정

해결 방안

Reference

Summary by CodeRabbit

릴리스 노트

  • 새로운 기능

    • 사용자의 대기 정보를 조회할 수 있는 새로운 API 엔드포인트 추가
  • 버그 수정

    • 중복 요청 처리 개선으로 동일한 대기 등록 방지
    • 진행 중인 요청에 대한 명확한 오류 메시지 제공 (HTTP 409)

@Jjiggu Jjiggu self-assigned this Feb 13, 2026
@Jjiggu Jjiggu added the refactor 리팩토링 label Feb 13, 2026
@Jjiggu Jjiggu merged commit c56eb39 into develop Feb 13, 2026
1 of 2 checks passed
@github-actions github-actions bot requested a review from HyemIin February 13, 2026 09:52
@coderabbitai
Copy link

coderabbitai bot commented Feb 13, 2026

Caution

Review failed

The pull request is closed.

Walkthrough

대기 작업의 멱등성 검증 및 진행 중 상태 처리를 도입합니다. 새로운 예외 처리, 멱등성 응답 및 대기 정보 DTO 생성, 멱등성 서비스 계층 리팩토링, 그리고 사용자 대기 정보 조회 API 엔드포인트를 구현합니다.

Changes

Cohort / File(s) Summary
Exception Handling
GlobalExceptionHandler.java, WorkInProgressException.java, ErrorMessage.java
WorkInProgressException 처리를 위한 새로운 예외 핸들러 메서드(HTTP 409)와 해당 예외 클래스를 추가하고, WORK_IN_PROGRESS 에러 메시지 상수를 정의합니다.
Idempotency Infrastructure
IdempotencyResponse.java, IdempotencyService.java, WaitingIdempotencyRepository.java
멱등성 검증 및 저장 로직을 위한 통합 서비스 계층을 도입합니다. 저장소 메서드를 리팩토링하여 IN-PROGRESS 상태를 지원하고, IdempotencyResponse로 표준화합니다.
Waiting Controller & DTO
WaitingController.java, GetMyWaitingInfoResponse.java
현재 사용자의 대기 정보 전체 목록을 반환하는 GET /v2/users/me/waitings 엔드포인트를 추가합니다.
Reservation Repository Layer
ReservationCustomRepository.java, ReservationCustomRepositoryImpl.java, ReservationRepository.java, GetMyWaitingBaseDto.java
QueryDSL을 사용하여 사용자 대기 정보를 조회하는 커스텀 저장소를 구현하고, 반환 DTO와 인터페이스를 추가합니다.
Waiting Service
WaitingService.java
멱등성 검증 로직을 새로운 IdempotencyService로 통합하고, 사용자 대기 정보 조회 메서드(getMyWaitingInfo)를 추가합니다.
Tests
WaitingServiceTest.java
멱등성 저장소 메서드 호출을 업데이트하고, IN-PROGRESS 상태 처리에 대한 테스트를 추가합니다.

Sequence Diagram

sequenceDiagram
    actor Client
    participant WaitingController
    participant IdempotencyService
    participant WaitingIdempotencyRepository as Redis<br/>IdempotencyRepository
    participant WaitingService
    participant Database

    Client->>WaitingController: POST /register with Idempotency-Key
    WaitingController->>IdempotencyService: validateIdempotency(request)
    IdempotencyService->>WaitingIdempotencyRepository: findByRegisterKey(key)
    
    alt Idempotency Key Found
        WaitingIdempotencyRepository-->>IdempotencyService: IdempotencyResponse
        IdempotencyService->>IdempotencyService: Check state
        
        alt State = IN-PROGRESS
            IdempotencyService-->>WaitingController: Throw WorkInProgressException
            WaitingController-->>Client: HTTP 409 Conflict
        else State = COMPLETED
            IdempotencyService-->>WaitingController: Return cached response
            WaitingController-->>Client: HTTP 200 with cached data
        end
    else No Key Found
        IdempotencyService->>IdempotencyService: Mark as IN-PROGRESS
        IdempotencyService->>WaitingIdempotencyRepository: saveIdempotencyInProgress(key)
        IdempotencyService-->>WaitingController: Continue processing
        
        WaitingController->>WaitingService: Process waiting request
        WaitingService->>Database: Fetch/create reservation
        Database-->>WaitingService: Result
        WaitingService-->>WaitingController: Response
        
        WaitingController->>IdempotencyService: saveIdempotencyResponse(key, response)
        IdempotencyService->>WaitingIdempotencyRepository: saveIdempotencyResponse(key, response)
        WaitingIdempotencyRepository->>WaitingIdempotencyRepository: Store with COMPLETED state
        
        WaitingController-->>Client: HTTP 200 with new data
    end
Loading

Estimated Code Review Effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly Related PRs

Suggested Reviewers

  • HyemIin
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor#361-getMyWaiting

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


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

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor 리팩토링

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant