更新技能

This commit is contained in:
zk
2026-06-24 10:32:26 +08:00
parent 2f38c80207
commit 556302816b
4 changed files with 60 additions and 33 deletions
+8 -7
View File
@@ -79,19 +79,20 @@ class SkillGapService:
return self._gap_result(10.0, job, detail.resume, [])
# 4. 拼 AI 输入
resume_json = _build_resume_json(detail)
# 5. AI 分析
missing = await analyze_skill_gap(skill_tags, resume_json)
# 6. 计算匹配分
score = round((len(skill_tags) - len(missing)) / len(skill_tags) * 10, 1)
return self._gap_result(score, job, detail.resume, missing)
# 5. AI 分析(返回差距条目 [{keyword, title, description}]
gaps = await analyze_skill_gap(skill_tags, resume_json)
# 6. 计算匹配分(缺失技能 = 差距条目的 keyword)
missing_count = len(gaps)
score = round((len(skill_tags) - missing_count) / len(skill_tags) * 10, 1)
return self._gap_result(score, job, detail.resume, gaps)
@staticmethod
def _gap_result(score: float, job: Job, resume: UserResume, missing: list[str]) -> dict:
def _gap_result(score: float, job: Job, resume: UserResume, gaps: list[dict]) -> dict:
return {
"score": score,
"job": {"jobId": str(job.id), "title": job.title, "skillTags": job.skill_tags or []},
"resume": {"resumeId": str(resume.id), "resumeName": resume.resume_name or "", "targetPosition": resume.target_position or ""},
"missingSkills": missing,
"gaps": gaps,
}
# ===== 生成定制简历 =====