-
Notifications
You must be signed in to change notification settings - Fork 0
[CMAT-58] feat: RecruitScrap 엔티티에 jobName 필드 추가 #39
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
Walkthrough이번 PR은 코드베이스 전반에 걸쳐 boolean 변수 및 필드의 명명 규칙을 일관되게 수정하는 작업과 RecruitScrap 관련 DTO 변환 로직을 개선하는 변경 사항을 포함합니다. RecruitConverter, RecommendRecruitsDTO, RecruitQueryService에서 isScraped라는 이름을 isScrapped로 변경하였으며, RecruitScrap 클래스에는 새로운 jobName 필드가 추가되었습니다. 또한 RecruitScrapConverter와 RecruitScrapQueryService에서 RecruitScrap 객체를 직접 활용하여 변환 과정을 단순화하였습니다. Changes
Sequence Diagram(s)sequenceDiagram
participant Q as RecruitScrapQueryService
participant C as RecruitScrapConverter
participant D as RecruitScrapResponseDTO Builder
Q->>C: findRecruitScrapList() 호출 (RecruitScrap 리스트 처리)
C->>D: toRecruitScrapResponseDTO(RecruitScrap) 호출
D-->>C: RecruitScrapResponseDTO 반환
C-->>Q: DTO 반환
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (5)
🔇 Additional comments (6)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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: 2
🧹 Nitpick comments (1)
src/main/java/UMC/career_mate/domain/recruitScrap/service/RecruitScrapQueryService.java (1)
28-28: 매핑 로직이 개선되었습니다!스트림 매핑 로직이 단순화되어 가독성과 유지보수성이 향상되었습니다. RecruitScrap 객체를 직접 사용하는 방식으로 변경함으로써 코드가 더욱 간결해졌습니다.
다음과 같은 추가 개선사항을 고려해보시면 좋을 것 같습니다:
- return recruitScrapList.stream() - .map(RecruitScrapConverter::toRecruitScrapResponseDTO) - .toList(); + return recruitScrapList.stream() + .map(RecruitScrapConverter::toRecruitScrapResponseDTO) + .toUnmodifiableList(); // 불변 리스트 반환으로 안전성 향상
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (7)
src/main/java/UMC/career_mate/domain/recruit/converter/RecruitConverter.java(1 hunks)src/main/java/UMC/career_mate/domain/recruit/dto/response/RecommendRecruitsDTO.java(1 hunks)src/main/java/UMC/career_mate/domain/recruit/service/RecruitQueryService.java(1 hunks)src/main/java/UMC/career_mate/domain/recruitScrap/RecruitScrap.java(1 hunks)src/main/java/UMC/career_mate/domain/recruitScrap/converter/RecruitScrapConverter.java(1 hunks)src/main/java/UMC/career_mate/domain/recruitScrap/dto/response/RecruitScrapResponseDTO.java(1 hunks)src/main/java/UMC/career_mate/domain/recruitScrap/service/RecruitScrapQueryService.java(1 hunks)
✅ Files skipped from review due to trivial changes (2)
- src/main/java/UMC/career_mate/domain/recruit/dto/response/RecommendRecruitsDTO.java
- src/main/java/UMC/career_mate/domain/recruit/service/RecruitQueryService.java
🔇 Additional comments (3)
src/main/java/UMC/career_mate/domain/recruitScrap/dto/response/RecruitScrapResponseDTO.java (1)
12-13: 필드 이름 변경 및 새로운 필드 추가가 적절히 이루어졌습니다.
isScraped에서isScrapped로의 이름 변경이 일관성 있게 적용되었으며,jobName필드가 적절히 추가되었습니다.src/main/java/UMC/career_mate/domain/recruitScrap/converter/RecruitScrapConverter.java (1)
20-28: DTO 변환 로직이 개선되었습니다.
RecruitScrap엔티티를 직접 사용하도록 변경되어 코드가 더 명확해졌습니다.src/main/java/UMC/career_mate/domain/recruit/converter/RecruitConverter.java (1)
63-70: 변수명 변경이 일관성 있게 적용되었습니다.
isScraped에서isScrapped로의 이름 변경이 메서드 시그니처와 구현부에 모두 적절히 반영되었습니다.
| @JoinColumn(name = "recruit_id") | ||
| private Recruit recruit; | ||
|
|
||
| private String jobName; |
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.
🛠️ Refactor suggestion
jobName 필드에 제약 조건 추가 필요
jobName 필드에 대한 길이 제한이나 null 허용 여부 등의 제약 조건이 명시되어 있지 않습니다.
다음과 같이 제약 조건을 추가하는 것을 권장합니다:
- private String jobName;
+ @Column(name = "job_name", nullable = false, length = 100)
+ private String jobName;📝 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.
| private String jobName; | |
| @Column(name = "job_name", nullable = false, length = 100) | |
| private String jobName; |
| return RecruitScrap.builder() | ||
| .member(member) | ||
| .recruit(recruit) | ||
| .jobName(member.getJob().getName()) |
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.
member.getJob()에 대한 null 체크 필요
member.getJob()이 null을 반환할 경우 NullPointerException이 발생할 수 있습니다.
다음과 같이 수정하는 것을 권장합니다:
- .jobName(member.getJob().getName())
+ .jobName(member.getJob() != null ? member.getJob().getName() : null)📝 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.
| .jobName(member.getJob().getName()) | |
| .jobName(member.getJob() != null ? member.getJob().getName() : null) |
jjeongdong
left a 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.
LGTM
#️⃣ 요약 설명
📝 작업 내용
// 핵심 코드를 붙여넣기 해주세요코드에 대한 간단한 설명 부탁드립니다.
동작 확인
💬 리뷰 요구사항(선택)
Summary by CodeRabbit
신규 기능
리팩터