Skip to content

Conversation

@momuzzi
Copy link
Member

@momuzzi momuzzi commented Feb 9, 2025

#️⃣ 요약 설명

  1. RecruitKeyword에서 프론트엔드에 대해 React, iOS, Android를 추가했습니다.
  2. PM, 디자이너인 경우 상세 직무를 나눌 필요가 없기 때문에, gpt 요청 로직 없이 프로필 Job으로 바로 RecruitKeyword 변환 값을 사용하도록 수정했습니다.
  3. gpt 요청 포맷 내용을 백엔드와 프론트엔드 두개로 분리했습니다.

📝 작업 내용

코드의 흐름이나 중요한 부분을 작성해주세요.

// 핵심 코드를 붙여넣기 해주세요

코드에 대한 간단한 설명 부탁드립니다.

동작 확인

간단한거라서 로컬 테스트로 확인했습니다~

기능을 실행했을 때 정상 동작하는지 여부를 확인하고 사진을 올려주세요

ex) 테스트 코드 작성후 성공 사진
ex) swagger 사진

💬 리뷰 요구사항(선택)

리뷰어가 특별히 봐주었으면 하는 부분이 있다면 작성해주세요

ex) 메서드 XXX의 이름을 더 잘 짓고 싶은데 혹시 좋은 명칭이 있을까요?

Summary by CodeRabbit

이번 업데이트에서는 다양한 직무별 맞춤 키워드 매칭 기능이 강화되어, 사용자 프로필을 기반으로 보다 정교한 결과를 제공합니다. 프론트엔드와 백엔드 직군에 대해 구체적인 필터링 기준이 반영되었으며, PM과 디자이너 직무에 대해서는 신속한 처리 로직이 적용되었습니다.

  • 새로운 기능
    • 다양한 직무(프론트엔드, 백엔드 등)에 맞춘 맞춤형 요청 형식과 키워드 매칭 기능 추가
  • 개선 사항
    • 키워드 필터링 기준 정교화로 일관되고 빠른 매칭 결과 제공
    • PM, 디자이너 직군에 대한 처리 로직 최적화

@momuzzi momuzzi self-assigned this Feb 9, 2025
@coderabbitai
Copy link

coderabbitai bot commented Feb 9, 2025

Walkthrough

이번 변경 사항은 ChatGptService, RecruitKeyword enum, RecruitQueryService 세 클래스에 걸쳐 기능 확장을 위한 수정 작업입니다. ChatGptService에서는 직무(Job)를 고려하여 GPT 요청 포맷 상수와 getRecruitKeyword 메서드 시그니처가 업데이트되었으며, RecruitKeyword enum에서는 백엔드 관련 제외 키워드 목록이 확장되고 프론트엔드 관련 신규 enum 상수가 추가되었습니다. RecruitQueryService에서는 특정 직무(PM, Designer)의 경우 GPT 요청을 우회하여 로직을 단순화하는 조건이 추가되었습니다.

Changes

파일 변경 사항
src/.../chatgpt/service/ChatGptService.java - GPT 요청 포맷 상수 명 변경 (GPT_REQUEST_FORMAT_POSTFIX_FOR_RECRUIT_KEYWORD → GPT_REQUEST_FORMAT_POSTFIX_FOR_RECRUIT_KEYWORD_BACKEND) 및 수정
- FRONTEND 전용 상수(GPT_REQUEST_FORMAT_POSTFIX_FOR_RECRUIT_KEYWORD_FRONTEND) 추가
- getRecruitKeyword 메서드에 Job 파라미터 추가 및 로직 업데이트
src/.../recruit/enums/RecruitKeyword.java - BACKEND_SPRING, BACKEND_NODE, BACKEND_DJANGO의 제외 키워드 목록에 "C#" 추가
- FRONTEND_REACT, FRONTEND_IOS, FRONTEND_ANDROID 신규 enum 상수 추가 (각각 getIncludeKeywordList 구현, getExcludeKeywordList 반환 null)
src/.../recruit/service/RecruitQueryService.java - calculateRecruitKeyword 메서드에 PM 및 Designer 직무의 경우 GPT 요청 우회 조건 추가
- chatGptService.getRecruitKeyword 호출 시 member.getJob() 파라미터 추가

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
Loading

Suggested reviewers

  • jpark0506
  • jjeongdong
  • KSLEE19

Poem

깡충깡충, 토끼가 노래해요,
코드를 달구며 한 걸음씩,
직무 따라 바뀌는 길 위에서,
변경의 바람 타고 꿈을 실어,
당근처럼 달콤한 코드의 향연!
🐰✨

✨ Finishing Touches
  • 📝 Generate Docstrings (Beta)

🪧 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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

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. (Beta)
  • @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: 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

📥 Commits

Reviewing files that changed from the base of the PR and between efb2650 and 65b95fe.

📒 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의 변경된 메서드 시그니처와 잘 통합되었습니다.

Comment on lines +65 to +97
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;
}
},
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

프론트엔드 키워드 목록을 보완해 주세요.

각 프론트엔드 기술 스택별 키워드가 너무 단순합니다. 다음과 같은 개선이 필요합니다:

  1. 일반적인 변형을 포함해야 합니다:
    • 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.

Suggested change
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;
}
},

Comment on lines +57 to +60
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)
);
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

알 수 없는 직무 유형에 대한 예외 처리가 필요합니다.

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)  // 기본값 설정
 );

Copy link
Member

@jjeongdong jjeongdong left a comment

Choose a reason for hiding this comment

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

LGTM~

@momuzzi momuzzi merged commit ccc3e9f into develop Feb 11, 2025
1 check passed
@momuzzi momuzzi deleted the feature/CMAT-57 branch February 12, 2025 13:53
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.

4 participants