Skip to content

Conversation

@HyemIin
Copy link
Member

@HyemIin HyemIin commented Jun 24, 2025

작업 요약

  • reservation 도메인 생성
  • global예외핸들러 디렉터리 구조조정
  • 북마크 커스텀 예외 생성

Issue Link

#55

문제점 및 어려움

해결 방안

Reference

Summary by CodeRabbit

  • 신규 기능

    • 예약 생성 및 예약 목록 조회를 위한 예약 컨트롤러가 추가되었습니다.
    • 예약 관련 요청 및 응답을 위한 DTO 클래스가 도입되었습니다.
    • 예약 엔티티, 상태(enum), 저장소, 서비스가 새롭게 추가되어 예약 관리가 가능합니다.
    • 북마크 및 사용자 정보 관련 새로운 예외 클래스가 추가되었습니다.
  • 버그 수정

    • 사용자 회원가입 시 소셜 타입이 LOCAL로 변경되었습니다.
  • 개선 사항

    • 예약, 북마크, 사용자 정보 관련 오류에 대해 더 구체적인 예외 및 에러 메시지가 제공됩니다.
    • 글로벌 예외 처리기가 예약 및 북마크 관련 예외를 세분화하여 처리하도록 확장되었습니다.
    • 지원하는 소셜 타입이 KAKAO와 LOCAL로 변경되었습니다.

- reservation 도메인 생성
- global예외핸들러 디렉터리 구조조정
- 북마크 커스텀 예외 생성
@HyemIin HyemIin self-assigned this Jun 24, 2025
@coderabbitai
Copy link

coderabbitai bot commented Jun 24, 2025

Walkthrough

이번 변경 사항은 예약(Reservation) 기능의 신규 도메인 전체 도입과, 북마크(BookMark) 및 유저(User) 관련 예외 처리 체계의 고도화에 초점을 맞추고 있습니다. 예약 엔티티, DTO, 컨트롤러, 서비스, 레포지토리가 새로 추가되었으며, 예외 메시지와 핸들러가 세분화되고, 소셜 타입에 LOCAL이 도입되었습니다.

Changes

파일/경로 그룹 변경 요약
.../bookmark/exception/BookmarkOwnerMismatchException.java
.../bookmark/exception/DuplicateBookmarkException.java
.../user/exception/MissingUserInfoException.java
북마크 및 유저 관련 커스텀 예외 클래스 3종 신규 추가
.../bookmark/service/BookmarkService.java 기존 IllegalArgumentException 대신 커스텀 예외로 대체
.../global/exception/ErrorMessage.java 패키지 변경 및 예약/북마크/유저 에러 메시지 3종 추가
.../global/exception/ErrorResponse.java
.../global/exception/GlobalExceptionHandler.java
패키지 변경 및 신규 예외 핸들러 3종 추가, 관련 import 정비
.../global/security/exception/*.java ErrorMessage import 경로 변경(5개 파일)
.../reservation/controller/ReservationController.java 예약 컨트롤러 신규 추가, 예약 생성 및 조회 엔드포인트 구현
.../reservation/dto/ReservationCreateRequestDto.java
.../reservation/dto/ReservationCreateResponseDto.java
.../reservation/dto/ReservationGetResponseDto.java
예약 관련 요청/응답 DTO 3종 신규 추가
.../reservation/entity/Reservation.java
.../reservation/entity/ReservationStatus.java
예약 엔티티 및 상태 enum 신규 추가
.../reservation/repository/ReservationRepository.java 예약 레포지토리(JpaRepository 상속) 신규 추가, 스토어ID로 예약 목록 조회 메서드 포함
.../reservation/service/ReservationService.java 예약 서비스 신규 추가, 예약 생성/조회 로직 구현
.../user/dto/ManagerSignupRequestDto.java toEntity() 내 SocialType을 KAKAO → LOCAL로 변경
.../user/entity/SocialType.java SocialType enum에서 NAVER, GOOGLE 제거, LOCAL 추가

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant ReservationController
    participant ReservationService
    participant StoreRepository
    participant UserRepository
    participant ReservationRepository

    Client->>ReservationController: POST /reservations/create/{storeId}
    ReservationController->>ReservationService: create(storeId, user, dto)
    ReservationService->>StoreRepository: findById(storeId)
    ReservationService->>UserRepository: findById(userId)
    ReservationService->>ReservationRepository: save(reservation)
    ReservationService-->>ReservationController: ReservationCreateResponseDto
    ReservationController-->>Client: 201 Created + ApiUtils.success(response)
Loading
sequenceDiagram
    participant Client
    participant ReservationController
    participant ReservationService
    participant ReservationRepository

    Client->>ReservationController: GET /reservations/admin/{storeId}
    ReservationController->>ReservationService: getReservationListByStoreId(storeId)
    ReservationService->>ReservationRepository: findAllByStore_StoreId(storeId)
    ReservationService-->>ReservationController: List<ReservationGetResponseDto>
    ReservationController-->>Client: 200 OK + ApiUtils.success(list)
Loading

Possibly related PRs

  • GTable/NoWait_BE#23: BookmarkService의 CRUD 및 커스텀 예외 도입과 직접적으로 연관된 PR입니다. 북마크 서비스의 예외 처리와 이번 PR의 예외 클래스 추가가 코드 레벨에서 밀접하게 연결됩니다.

Poem

🍽️
예약의 길이 활짝 열렸네,
북마크 예외도 이름표 달고,
LOCAL 유저도 당당히 등장!
새 엔티티와 DTO,
예외 핸들러도 든든히,
오늘도 코드밭에
평화와 질서가 내리네.


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between f2286f9 and 26f1f89.

📒 Files selected for processing (4)
  • src/main/java/com/example/gtable/global/security/exception/BusinessException.java (1 hunks)
  • src/main/java/com/example/gtable/global/security/exception/RefreshTokenNotFoundException.java (1 hunks)
  • src/main/java/com/example/gtable/global/security/exception/ResourceNotFoundException.java (1 hunks)
  • src/main/java/com/example/gtable/global/security/exception/TokenBadRequestException.java (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (4)
  • src/main/java/com/example/gtable/global/security/exception/BusinessException.java
  • src/main/java/com/example/gtable/global/security/exception/ResourceNotFoundException.java
  • src/main/java/com/example/gtable/global/security/exception/TokenBadRequestException.java
  • src/main/java/com/example/gtable/global/security/exception/RefreshTokenNotFoundException.java
✨ 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: 4

🧹 Nitpick comments (5)
src/main/java/com/example/gtable/reservation/entity/ReservationStatus.java (1)

4-4: 코드 포맷팅을 개선해주세요.

enum 값들 사이에 공백이 누락되어 있어 가독성이 떨어집니다. 각 값 사이에 적절한 공백을 추가해주시면 좋겠습니다.

-	WAITING,CALLING, CONFIRMED, CANCELLED
+	WAITING, CALLING, CONFIRMED, CANCELLED
src/main/java/com/example/gtable/reservation/entity/Reservation.java (1)

29-30: 타임스탬프 자동 관리를 고려해보세요.

requestedAt 필드를 수동으로 관리하는 것보다는 JPA의 @PrePersist를 사용하여 자동으로 설정하는 것이 더 안전하고 일관성 있는 방법입니다.

다음과 같이 개선할 수 있습니다:

 	@Column(name = "requested_at", nullable = false)
 	private LocalDateTime requestedAt;
+
+	@PrePersist
+	protected void onCreate() {
+		requestedAt = LocalDateTime.now();
+	}

또는 Auditing 기능을 활용하여 @CreatedDate 어노테이션을 사용하는 방법도 있습니다.

src/main/java/com/example/gtable/reservation/dto/ReservationGetResponseDto.java (1)

5-6: 사용되지 않는 import 문들을 제거해주세요.

현재 코드에서 BookmarkGetResponseBookmark 클래스를 import하고 있지만, 실제로는 사용되지 않고 있습니다. 코드의 가독성과 유지보수성을 위해 불필요한 import 문들을 제거해주시면 좋겠습니다.

-import com.example.gtable.bookmark.dto.BookmarkGetResponse;
-import com.example.gtable.bookmark.entity.Bookmark;
src/main/java/com/example/gtable/reservation/controller/ReservationController.java (1)

61-72: 주석 처리된 코드에 대한 정리가 필요합니다.

향후 구현 예정인 것으로 보이는 PATCH와 DELETE 메서드들이 주석 처리되어 있습니다. 이런 코드들은 다음 중 하나의 방법으로 처리해주시면 좋겠습니다:

  1. TODO 주석을 추가하여 향후 구현 계획을 명시
  2. 당장 구현하지 않을 예정이라면 완전히 제거
  3. 구현이 예정되어 있다면 별도 이슈로 관리

이렇게 개선해보시는 것은 어떨까요:

-	// @PatchMapping("/{id}/status")
-	// public ReservationDto.Response updateStatus(
-	// 	@PathVariable Long id,
-	// 	@RequestParam Reservation.Status status
-	// ) {
-	// 	return reservationService.updateStatus(id, status);
-	// }
-	//
-	// @DeleteMapping("/{id}")
-	// public void delete(@PathVariable Long id) {
-	// 	reservationService.delete(id);
-	// }
+	// TODO: 예약 상태 업데이트 및 삭제 기능 구현 예정 (이슈 #XX)
src/main/java/com/example/gtable/global/exception/ErrorMessage.java (1)

17-23: 새로운 에러 메시지 상수들이 적절하게 정의되었습니다.

사용자와 북마크 관련 에러 메시지들이 명확하고 일관된 패턴으로 추가되었습니다. 각 도메인별로 적절한 에러 코드(user001, bookmark001, bookmark002)가 할당되어 있어 추후 에러 추적에도 도움이 될 것 같습니다.

다만 NOT_OWN_BOOKMARK의 메시지가 "권한이 없습니다."로 되어 있는데, 좀 더 구체적으로 "본인의 북마크가 아닙니다." 또는 "해당 북마크에 대한 권한이 없습니다."와 같이 표현하면 사용자가 더 명확하게 이해할 수 있을 것 같습니다.

-	NOT_OWN_BOOKMARK("권한이 없습니다.", "bookmark002");
+	NOT_OWN_BOOKMARK("해당 북마크에 대한 권한이 없습니다.", "bookmark002");
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 5020916 and 5359ddc.

📒 Files selected for processing (22)
  • src/main/java/com/example/gtable/bookmark/exception/BookmarkOwnerMismatchException.java (1 hunks)
  • src/main/java/com/example/gtable/bookmark/exception/DuplicateBookmarkException.java (1 hunks)
  • src/main/java/com/example/gtable/bookmark/service/BookmarkService.java (4 hunks)
  • src/main/java/com/example/gtable/global/exception/ErrorMessage.java (2 hunks)
  • src/main/java/com/example/gtable/global/exception/ErrorResponse.java (1 hunks)
  • src/main/java/com/example/gtable/global/exception/GlobalExceptionHandler.java (3 hunks)
  • src/main/java/com/example/gtable/global/security/exception/BusinessException.java (1 hunks)
  • src/main/java/com/example/gtable/global/security/exception/RefreshTokenNotFoundException.java (1 hunks)
  • src/main/java/com/example/gtable/global/security/exception/ResourceNotFoundException.java (1 hunks)
  • src/main/java/com/example/gtable/global/security/exception/TokenBadRequestException.java (1 hunks)
  • src/main/java/com/example/gtable/global/security/exception/UnauthorizedException.java (1 hunks)
  • src/main/java/com/example/gtable/reservation/controller/ReservationController.java (1 hunks)
  • src/main/java/com/example/gtable/reservation/dto/ReservationCreateRequestDto.java (1 hunks)
  • src/main/java/com/example/gtable/reservation/dto/ReservationCreateResponseDto.java (1 hunks)
  • src/main/java/com/example/gtable/reservation/dto/ReservationGetResponseDto.java (1 hunks)
  • src/main/java/com/example/gtable/reservation/entity/Reservation.java (1 hunks)
  • src/main/java/com/example/gtable/reservation/entity/ReservationStatus.java (1 hunks)
  • src/main/java/com/example/gtable/reservation/repository/ReservationRepository.java (1 hunks)
  • src/main/java/com/example/gtable/reservation/service/ReservationService.java (1 hunks)
  • src/main/java/com/example/gtable/user/dto/ManagerSignupRequestDto.java (1 hunks)
  • src/main/java/com/example/gtable/user/entity/SocialType.java (1 hunks)
  • src/main/java/com/example/gtable/user/exception/MissingUserInfoException.java (1 hunks)
🔇 Additional comments (28)
src/main/java/com/example/gtable/reservation/dto/ReservationCreateRequestDto.java (1)

6-10: 깔끔한 DTO 구현입니다!

Lombok 어노테이션을 적절히 사용하여 간결하게 구현되었습니다. Integer 타입 사용으로 validation 처리도 용이할 것 같네요.

src/main/java/com/example/gtable/reservation/repository/ReservationRepository.java (1)

9-11: Spring Data JPA 패턴을 잘 따른 구현입니다.

JpaRepository를 적절히 확장하고, 프로퍼티 네비게이션을 사용한 커스텀 쿼리 메서드도 올바르게 정의되었습니다. Store와의 연관관계를 통한 조회가 잘 구현되었네요.

src/main/java/com/example/gtable/reservation/dto/ReservationCreateResponseDto.java (1)

7-15: 응답 DTO가 잘 설계되었습니다.

필요한 모든 필드를 포함하고 있으며, status를 String 타입으로 처리하여 계층 간 결합도를 낮춘 것이 좋은 설계입니다. Lombok 어노테이션도 적절히 활용되었네요.

src/main/java/com/example/gtable/reservation/entity/Reservation.java (1)

9-39: 전반적으로 잘 구현된 엔티티입니다.

JPA 어노테이션과 Lombok을 적절히 사용하여 깔끔하게 구현되었습니다. 연관관계 설정도 올바르게 되어있고, 지연 로딩 설정도 적절합니다. 위에서 언급한 사소한 개선사항들만 반영하면 더욱 완성도 높은 코드가 될 것 같습니다.

src/main/java/com/example/gtable/reservation/dto/ReservationGetResponseDto.java (1)

22-31: fromEntity 메서드 구현이 잘 되어있습니다.

예약 엔티티를 DTO로 변환하는 로직이 명확하고 적절합니다. 각 필드의 매핑도 정확하게 이루어져 있어 안전한 데이터 전송이 가능할 것 같습니다.

src/main/java/com/example/gtable/reservation/service/ReservationService.java (1)

56-63: 조회 메서드 구현이 깔끔합니다.

@Transactional(readOnly = true) 어노테이션을 적절히 사용하여 읽기 전용 트랜잭션으로 설정하신 점과, 스트림 API를 활용한 DTO 변환 로직이 매우 좋습니다. 성능과 가독성 모두 고려된 구현이네요.

src/main/java/com/example/gtable/reservation/controller/ReservationController.java (2)

22-28: API 문서화와 컨트롤러 구조가 훌륭합니다.

Swagger 어노테이션을 통한 API 문서화가 잘 되어있고, @RequiredArgsConstructor를 사용한 의존성 주입 방식도 깔끔합니다. REST API의 표준을 잘 따르고 있어 보입니다.


30-45: 예약 생성 엔드포인트가 잘 구현되었습니다.

HTTP 상태 코드 201(Created)를 적절히 사용하고, ApiUtils.success()를 통한 일관된 응답 래핑이 좋습니다. 인증된 사용자 정보를 @AuthenticationPrincipal로 받아오는 방식도 적절합니다.

src/main/java/com/example/gtable/global/exception/ErrorMessage.java (1)

1-1: 패키지 구조 개선이 잘 되었습니다.

예외 처리 관련 클래스들을 global.exception 패키지로 통합하여 더 명확한 구조를 만드신 점이 좋습니다.

src/main/java/com/example/gtable/global/exception/ErrorResponse.java (1)

1-1: 패키지 이동이 올바르게 처리되었습니다.

ErrorResponse 클래스의 패키지 이동이 깔끔하게 처리되었으며, 기존 기능에는 변화가 없어 안전한 리팩토링입니다.

src/main/java/com/example/gtable/global/security/exception/BusinessException.java (1)

3-3: 임포트 업데이트가 적절하게 처리되었습니다.

ErrorMessage 클래스의 패키지 이동에 따른 임포트 경로 수정이 정확하게 반영되었습니다. 기존 기능은 그대로 유지하면서 새로운 패키지 구조에 맞게 잘 적응하셨네요.

src/main/java/com/example/gtable/global/security/exception/UnauthorizedException.java (1)

3-3: 일관된 임포트 업데이트입니다.

다른 예외 클래스들과 마찬가지로 ErrorMessage 클래스의 새로운 패키지 경로로 임포트가 정확하게 업데이트되었습니다. 전체 리팩토링 과정에서 일관성을 잘 유지하고 계시네요.

src/main/java/com/example/gtable/global/security/exception/ResourceNotFoundException.java (1)

3-3: 리팩토링 완료가 체계적으로 이루어졌습니다.

마지막 예외 클래스까지 ErrorMessage 임포트 업데이트가 완료되어, 전체 예외 처리 체계의 패키지 구조 개선이 일관되게 마무리되었습니다.

이번 리팩토링을 통해:

  • 예외 처리 관련 클래스들이 global.exception 패키지로 통합되어 더 명확한 구조가 되었고
  • 새로운 도메인별 에러 메시지가 체계적으로 추가되었으며
  • 기존 기능은 그대로 유지하면서 구조만 개선된 안전한 변경

전반적으로 매우 깔끔하고 체계적인 리팩토링 작업이었습니다.

src/main/java/com/example/gtable/global/security/exception/TokenBadRequestException.java (1)

3-3: ErrorMessage 중앙화 적용이 잘 되었습니다!

전역 예외 처리 구조 개선의 일환으로 ErrorMessage를 중앙 집중식으로 관리하도록 하는 변경사항이 적절하게 적용되었습니다. 코드의 일관성과 유지보수성이 향상될 것으로 보입니다.

src/main/java/com/example/gtable/global/security/exception/RefreshTokenNotFoundException.java (1)

3-3: ErrorMessage 중앙화 패턴이 일관되게 적용되었습니다!

다른 보안 예외 클래스들과 동일한 방식으로 ErrorMessage import가 추가되어 코드베이스 전반의 일관성이 유지되고 있습니다.

src/main/java/com/example/gtable/user/entity/SocialType.java (1)

4-4: SocialType enum 변경사항의 영향범위를 확인해주세요

NAVER와 GOOGLE 소셜 로그인 타입을 제거하고 LOCAL을 추가하는 것은 중요한 변경사항입니다. 기존 데이터베이스에 저장된 사용자 데이터나 다른 코드에서 이 enum을 참조하는 부분들이 올바르게 동작하는지 확인이 필요합니다.

다음 스크립트를 실행하여 SocialType 사용 현황을 확인해주세요:

#!/bin/bash
# SocialType enum 사용 현황을 확인합니다
echo "=== SocialType 사용 현황 검색 ==="
rg -A 3 -B 3 "SocialType\.(NAVER|GOOGLE)" --type java

echo -e "\n=== SocialType enum 전체 사용 현황 ==="
rg -A 2 -B 2 "SocialType\." --type java
src/main/java/com/example/gtable/user/dto/ManagerSignupRequestDto.java (1)

39-39: SocialType 변경이 매니저 회원가입 로직에 적절하게 반영되었습니다

매니저 회원가입 시 SocialType.LOCAL을 사용하도록 변경된 것이 SocialType enum 변경사항과 일치하며, 매니저가 로컬 계정으로 가입하는 것은 비즈니스 로직상 합리적으로 보입니다.

다만, 이 변경사항이 의도된 것인지 한 번 더 확인해 보시기 바랍니다. 기존에 KAKAO로 설정되어 있던 이유가 있었다면 해당 사항도 고려해주세요.

src/main/java/com/example/gtable/bookmark/exception/BookmarkOwnerMismatchException.java (1)

1-9: 잘 구현된 예외 클래스입니다!

북마크 소유자 불일치 상황을 위한 전용 예외 클래스가 잘 구현되었습니다. 중앙화된 ErrorMessage 열거형을 사용하여 에러 메시지를 관리하는 것이 좋은 설계 방식입니다.

src/main/java/com/example/gtable/bookmark/exception/DuplicateBookmarkException.java (1)

1-9: 일관성 있는 예외 클래스 구현입니다!

중복 북마크 생성 시도를 처리하기 위한 전용 예외 클래스가 다른 예외 클래스들과 일관된 패턴으로 구현되었습니다. 중앙화된 에러 메시지 관리 방식이 훌륭합니다.

src/main/java/com/example/gtable/bookmark/service/BookmarkService.java (5)

11-12: 새로운 예외 클래스 import가 깔끔합니다!

북마크 관련 전용 예외 클래스들을 import하여 더 구체적인 예외 처리가 가능해졌습니다.


18-18: 사용자 관련 예외 클래스 추가가 좋습니다!

MissingUserInfoException을 import하여 사용자 정보 관련 에러 처리를 개선했습니다.


39-39: 중복 북마크 처리 개선이 훌륭합니다!

기존의 일반적인 IllegalArgumentException 대신 DuplicateBookmarkException을 사용하여 중복 북마크 상황을 더 명확하게 처리하고 있습니다.


66-66: 소유자 불일치 처리가 개선되었습니다!

북마크 소유자가 다른 경우 BookmarkOwnerMismatchException을 사용하여 더 구체적인 에러 정보를 제공하고 있습니다.


78-78: 사용자 정보 검증 개선이 좋습니다!

MissingUserInfoException을 사용하여 사용자 정보 부족 상황을 더 명확하게 처리하고 있습니다.

src/main/java/com/example/gtable/global/exception/GlobalExceptionHandler.java (4)

1-1: 패키지 구조 개선이 좋습니다!

전역 예외 처리기의 패키지가 com.example.gtable.global.exception으로 이동하여 더 명확하고 논리적인 구조가 되었습니다.


21-26: 새로운 예외 클래스들의 import가 적절합니다!

북마크 관련 예외와 사용자 관련 예외 클래스들을 import하여 더 구체적인 예외 처리가 가능해졌습니다.


102-107: 중복 북마크 예외 핸들러가 잘 구현되었습니다!

DuplicateBookmarkException에 대한 핸들러가 적절한 HTTP 상태 코드(400)와 함께 잘 구현되었습니다.


109-114: 북마크 소유자 불일치 예외 핸들러가 적절합니다!

BookmarkOwnerMismatchException에 대한 핸들러가 적절한 HTTP 상태 코드(400)와 에러 코드와 함께 잘 구현되었습니다.

Comment on lines +5 to +9
public class MissingUserInfoException extends RuntimeException {
public MissingUserInfoException() {
super(ErrorMessage.MISSING_USER.getMessage());
}
}
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

예외 클래스 구현 패턴의 일관성을 확인해주세요

새로운 예외 클래스가 잘 구현되었지만, 다른 예외 클래스들과 패턴이 약간 다릅니다.

다른 보안 예외들에서는 super(ErrorMessage.CONSTANT)를 사용하는 반면, 여기서는 super(ErrorMessage.MISSING_USER.getMessage())를 사용하고 있습니다.

일관성을 위해 다음 중 하나의 패턴으로 통일하는 것을 권장드립니다:

  1. super(ErrorMessage.MISSING_USER) (다른 예외들과 동일)
  2. 또는 모든 예외에서 .getMessage() 사용
public class MissingUserInfoException extends RuntimeException {
	public MissingUserInfoException() {
-		super(ErrorMessage.MISSING_USER.getMessage());
+		super(ErrorMessage.MISSING_USER);
	}
}

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In src/main/java/com/example/gtable/user/exception/MissingUserInfoException.java
lines 5 to 9, the constructor calls super with
ErrorMessage.MISSING_USER.getMessage(), which is inconsistent with other
exception classes that use super(ErrorMessage.CONSTANT). To fix this, change the
constructor to call super with ErrorMessage.MISSING_USER directly, matching the
pattern used in other security exceptions for consistency.

- 예외처리 중복 코드 수정
- reservation 엔티티 내 partysize 추가
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: 2

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 5359ddc and f2286f9.

📒 Files selected for processing (8)
  • src/main/java/com/example/gtable/global/exception/GlobalExceptionHandler.java (3 hunks)
  • src/main/java/com/example/gtable/global/security/exception/BusinessException.java (1 hunks)
  • src/main/java/com/example/gtable/global/security/exception/RefreshTokenNotFoundException.java (1 hunks)
  • src/main/java/com/example/gtable/global/security/exception/ResourceNotFoundException.java (1 hunks)
  • src/main/java/com/example/gtable/global/security/exception/TokenBadRequestException.java (1 hunks)
  • src/main/java/com/example/gtable/reservation/dto/ReservationCreateResponseDto.java (1 hunks)
  • src/main/java/com/example/gtable/reservation/entity/Reservation.java (1 hunks)
  • src/main/java/com/example/gtable/reservation/service/ReservationService.java (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (6)
  • src/main/java/com/example/gtable/global/security/exception/TokenBadRequestException.java
  • src/main/java/com/example/gtable/global/security/exception/RefreshTokenNotFoundException.java
  • src/main/java/com/example/gtable/reservation/dto/ReservationCreateResponseDto.java
  • src/main/java/com/example/gtable/reservation/entity/Reservation.java
  • src/main/java/com/example/gtable/reservation/service/ReservationService.java
  • src/main/java/com/example/gtable/global/exception/GlobalExceptionHandler.java

@HyemIin HyemIin merged commit 1cf53ef into develop Jun 24, 2025
1 check passed
@HyemIin HyemIin deleted the feature/#55-예약_기본CRUD branch June 24, 2025 05:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants