-
Notifications
You must be signed in to change notification settings - Fork 0
refactor(user,reservationn): 빈값 해결 #61
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
The head ref may contain hidden characters: "feature/#60-\uC608\uC57D\uB9AC\uD329\uD1A0\uB9C1"
Conversation
Walkthrough이번 변경에서는 예약 생성 시 파티 인원 수를 Reservation 엔티티에 반영하도록 수정하였고, 매니저 회원가입 요청 DTO에 소셜 타입 필드를 추가하고 예시 값을 일부 변경하였습니다. 전체적으로 내부 로직 보완과 API 문서 예시 개선이 이루어졌습니다. Changes
Poem
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/main/java/com/example/gtable/reservation/service/ReservationService.java(1 hunks)src/main/java/com/example/gtable/user/dto/ManagerSignupRequestDto.java(1 hunks)
🔇 Additional comments (3)
src/main/java/com/example/gtable/reservation/service/ReservationService.java (1)
50-50: 예약 생성 시 파티 인원 수 설정이 올바르게 추가되었습니다!빈 값 문제를 해결하기 위한 중요한 개선사항입니다. 이제 예약 생성 시 요청 DTO에서 파티 인원 수를 올바르게 가져와서 Reservation 엔티티에 설정하고 있어, 데이터 일관성이 보장됩니다.
src/main/java/com/example/gtable/user/dto/ManagerSignupRequestDto.java (2)
26-26: 비밀번호 예시 값이 더 명확하게 업데이트되었네요.비밀번호 예시가 더 이해하기 쉽게 변경되어 좋습니다.
31-31: 닉네임 예시 값이 더 일반적으로 변경되었습니다."테스터"라는 예시가 더 직관적이고 이해하기 쉽네요.
| @NotBlank | ||
| @Schema(description = "로그인타입", example = "LOCAL") | ||
| private String socialType; |
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.
socialType 필드 추가는 좋은 개선이지만, toEntity() 메서드와의 일관성 문제가 있습니다.
socialType 필드를 DTO에 추가한 것은 유연성을 높이는 좋은 개선사항입니다. 하지만 43번 줄의 toEntity() 메서드에서는 여전히 SocialType.LOCAL을 하드코딩하고 있어, 새로 추가된 필드 값이 실제로 사용되지 않고 있습니다.
일관성을 위해 다음과 같이 수정해주세요:
public User toEntity() {
return User.builder()
.email(email)
.password(password)
.nickname(nickname)
- .socialType(SocialType.LOCAL)
+ .socialType(SocialType.valueOf(socialType))
.role(Role.MANAGER)
.build();
}또는 socialType 필드를 실제로 사용하지 않을 예정이라면, 필드를 제거하거나 용도를 명확히 해주시면 좋겠습니다.
📝 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.
| @NotBlank | |
| @Schema(description = "로그인타입", example = "LOCAL") | |
| private String socialType; | |
| public User toEntity() { | |
| return User.builder() | |
| .email(email) | |
| .password(password) | |
| .nickname(nickname) | |
| .socialType(SocialType.valueOf(socialType)) | |
| .role(Role.MANAGER) | |
| .build(); | |
| } |
🤖 Prompt for AI Agents
In src/main/java/com/example/gtable/user/dto/ManagerSignupRequestDto.java around
lines 34 to 36, the new socialType field is added but the toEntity() method at
line 43 still hardcodes SocialType.LOCAL, causing inconsistency. Update the
toEntity() method to use the socialType field's value instead of the hardcoded
constant, ensuring the DTO field is properly utilized. If socialType is not
intended for use, remove the field or clarify its purpose.
작업 요약
Issue Link
문제점 및 어려움
해결 방안
Reference
Summary by CodeRabbit
신규 기능
버그 수정
문서화