-
Notifications
You must be signed in to change notification settings - Fork 0
[CMAT-57] feat: 프론트 RecruitKeyword 상세화 #38
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이번 변경 사항은 ChatGptService, RecruitKeyword enum, RecruitQueryService 세 클래스에 걸쳐 기능 확장을 위한 수정 작업입니다. ChatGptService에서는 직무(Job)를 고려하여 GPT 요청 포맷 상수와 getRecruitKeyword 메서드 시그니처가 업데이트되었으며, RecruitKeyword enum에서는 백엔드 관련 제외 키워드 목록이 확장되고 프론트엔드 관련 신규 enum 상수가 추가되었습니다. RecruitQueryService에서는 특정 직무(PM, Designer)의 경우 GPT 요청을 우회하여 로직을 단순화하는 조건이 추가되었습니다. Changes
Sequence Diagram(s)sequenceDiagram
participant M as Member
participant RQS as RecruitQueryService
participant CTS as ChatGptService
M->>RQS: 요청 (chatGptRequestContent, job)
alt 직무가 PM 또는 Designer인 경우
RQS->>M: 직접 RecruitKeyword 반환
else
RQS->>CTS: getRecruitKeyword(chatGptRequestContent, job)
CTS-->>RQS: RecruitKeyword 응답
end
Suggested reviewers
Poem
✨ 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
🔭 Outside diff range comments (1)
src/main/java/UMC/career_mate/domain/recruit/enums/RecruitKeyword.java (1)
133-141: 프로필 직무에 따른 RecruitKeyword 매핑을 업데이트해 주세요.
getRecruitKeywordFromProfileJob메서드가 새로 추가된 프론트엔드 변형(React, iOS, Android)을 처리하지 않습니다. 이로 인해 해당 직무를 가진 사용자의 경우 RuntimeException이 발생할 수 있습니다.다음과 같이 수정을 제안합니다:
public static RecruitKeyword getRecruitKeywordFromProfileJob(Job job) { return switch (job.getName()) { case "백엔드 개발자" -> BACKEND; - case "프론트엔드 개발자" -> FRONTEND; + case "프론트엔드 개발자" -> FRONTEND; + case "React 개발자" -> FRONTEND_REACT; + case "iOS 개발자" -> FRONTEND_IOS; + case "Android 개발자" -> FRONTEND_ANDROID; case "PM(Product/Project Manager)" -> PM; case "Designer" -> DESIGNER; default -> throw new RuntimeException("추가 필요한 직무" + job.getName()); }; }
🧹 Nitpick comments (1)
src/main/java/UMC/career_mate/domain/recruit/service/RecruitQueryService.java (1)
171-173: 직무명을 상수로 정의하는 것이 좋습니다.문자열 리터럴을 직접 비교하는 것은 오타나 변경에 취약할 수 있습니다.
다음과 같이 상수로 정의하는 것을 제안합니다:
+private static final String JOB_PM = "PM(Product/Project Manager)"; +private static final String JOB_DESIGNER = "Designer"; -if (job.getName().equals("PM(Product/Project Manager)") || job.getName().equals("Designer")) { +if (job.getName().equals(JOB_PM) || job.getName().equals(JOB_DESIGNER)) {
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
src/main/java/UMC/career_mate/domain/chatgpt/service/ChatGptService.java(5 hunks)src/main/java/UMC/career_mate/domain/recruit/enums/RecruitKeyword.java(4 hunks)src/main/java/UMC/career_mate/domain/recruit/service/RecruitQueryService.java(2 hunks)
🔇 Additional comments (3)
src/main/java/UMC/career_mate/domain/recruit/enums/RecruitKeyword.java (1)
28-28: 백엔드 제외 키워드 목록 업데이트가 적절합니다.백엔드 변형들(SPRING, NODE, DJANGO)의 제외 키워드 목록에 "C#"을 추가한 것이 일관성 있게 적용되었습니다.
Also applies to: 39-39, 50-51
src/main/java/UMC/career_mate/domain/chatgpt/service/ChatGptService.java (1)
77-87: 구현이 깔끔하고 명확합니다!직무 정보를 활용하여 적절한 GPT 요청 포맷을 선택하는 로직이 잘 구현되어 있습니다.
src/main/java/UMC/career_mate/domain/recruit/service/RecruitQueryService.java (1)
200-200: 메서드 호출이 적절하게 업데이트되었습니다!
member.getJob()을 파라미터로 전달하여 ChatGptService의 변경된 메서드 시그니처와 잘 통합되었습니다.
| FRONTEND_REACT { | ||
| @Override | ||
| public List<String> getIncludeKeywordList() { | ||
| return List.of("react"); | ||
| } | ||
|
|
||
| @Override | ||
| public List<String> getExcludeKeywordList() { | ||
| return null; | ||
| } | ||
| }, | ||
| FRONTEND_IOS { | ||
| @Override | ||
| public List<String> getIncludeKeywordList() { | ||
| return List.of("ios"); | ||
| } | ||
|
|
||
| @Override | ||
| public List<String> getExcludeKeywordList() { | ||
| return null; | ||
| } | ||
| }, | ||
| FRONTEND_ANDROID { | ||
| @Override | ||
| public List<String> getIncludeKeywordList() { | ||
| return List.of("android"); | ||
| } | ||
|
|
||
| @Override | ||
| public List<String> getExcludeKeywordList() { | ||
| return null; | ||
| } | ||
| }, |
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
프론트엔드 키워드 목록을 보완해 주세요.
각 프론트엔드 기술 스택별 키워드가 너무 단순합니다. 다음과 같은 개선이 필요합니다:
- 일반적인 변형을 포함해야 합니다:
- React: "React.js", "ReactJS", "리액트"
- iOS: "Swift", "iOS 개발", "아이폰", "애플"
- Android: "안드로이드", "코틀린", "Java"
예시 코드:
FRONTEND_REACT {
@Override
public List<String> getIncludeKeywordList() {
- return List.of("react");
+ return List.of("react", "React.js", "ReactJS", "리액트");
}
}📝 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.
| FRONTEND_REACT { | |
| @Override | |
| public List<String> getIncludeKeywordList() { | |
| return List.of("react"); | |
| } | |
| @Override | |
| public List<String> getExcludeKeywordList() { | |
| return null; | |
| } | |
| }, | |
| FRONTEND_IOS { | |
| @Override | |
| public List<String> getIncludeKeywordList() { | |
| return List.of("ios"); | |
| } | |
| @Override | |
| public List<String> getExcludeKeywordList() { | |
| return null; | |
| } | |
| }, | |
| FRONTEND_ANDROID { | |
| @Override | |
| public List<String> getIncludeKeywordList() { | |
| return List.of("android"); | |
| } | |
| @Override | |
| public List<String> getExcludeKeywordList() { | |
| return null; | |
| } | |
| }, | |
| FRONTEND_REACT { | |
| @Override | |
| public List<String> getIncludeKeywordList() { | |
| - return List.of("react"); | |
| + return List.of("react", "React.js", "ReactJS", "리액트"); | |
| } | |
| @Override | |
| public List<String> getExcludeKeywordList() { | |
| return null; | |
| } | |
| }, | |
| FRONTEND_IOS { | |
| @Override | |
| public List<String> getIncludeKeywordList() { | |
| return List.of("ios"); | |
| } | |
| @Override | |
| public List<String> getExcludeKeywordList() { | |
| return null; | |
| } | |
| }, | |
| FRONTEND_ANDROID { | |
| @Override | |
| public List<String> getIncludeKeywordList() { | |
| return List.of("android"); | |
| } | |
| @Override | |
| public List<String> getExcludeKeywordList() { | |
| return null; | |
| } | |
| }, |
| private static final Map<String, String> formatMap = Map.ofEntries( | ||
| Map.entry("백엔드 개발자", GPT_REQUEST_FORMAT_POSTFIX_FOR_RECRUIT_KEYWORD_BACKEND), | ||
| Map.entry("프론트엔드 개발자", GPT_REQUEST_FORMAT_POSTFIX_FOR_RECRUIT_KEYWORD_FRONTEND) | ||
| ); |
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.
알 수 없는 직무 유형에 대한 예외 처리가 필요합니다.
formatMap에 정의되지 않은 직무 유형이 전달될 경우 NullPointerException이 발생할 수 있습니다.
다음과 같이 수정하는 것을 제안합니다:
private static final Map<String, String> formatMap = Map.ofEntries(
Map.entry("백엔드 개발자", GPT_REQUEST_FORMAT_POSTFIX_FOR_RECRUIT_KEYWORD_BACKEND),
- Map.entry("프론트엔드 개발자", GPT_REQUEST_FORMAT_POSTFIX_FOR_RECRUIT_KEYWORD_FRONTEND)
+ Map.entry("프론트엔드 개발자", GPT_REQUEST_FORMAT_POSTFIX_FOR_RECRUIT_KEYWORD_FRONTEND),
+ Map.entry("default", GPT_REQUEST_FORMAT_POSTFIX_FOR_RECRUIT_KEYWORD_BACKEND) // 기본값 설정
);
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
이번 업데이트에서는 다양한 직무별 맞춤 키워드 매칭 기능이 강화되어, 사용자 프로필을 기반으로 보다 정교한 결과를 제공합니다. 프론트엔드와 백엔드 직군에 대해 구체적인 필터링 기준이 반영되었으며, PM과 디자이너 직무에 대해서는 신속한 처리 로직이 적용되었습니다.