匹配评分 加简历id

This commit is contained in:
zk
2026-07-10 11:26:08 +08:00
parent 410ab09561
commit 65d711ec25
3 changed files with 15 additions and 8 deletions
+9 -5
View File
@@ -26,11 +26,15 @@ class JobAgentChatService:
def __init__(self, session: AsyncSession):
self.session = session
async def score_match(self, user_id: int, customize_resume_id: int, job_id: int) -> int:
"""岗位匹配评分:查定制简历 + 岗位 → 序列化简历 → 调AI评分,返回 0-100 整数"""
cr = await customize_resume_store.get_by_id(user_id, customize_resume_id)
if cr is None:
raise ValueError("定制简历不存在")
async def score_match(self, user_id: int, job_id: int, customize_resume_id: int | None = None, resume_id: int | None = None) -> int:
"""岗位匹配评分:查定制简历或原始简历 + 岗位 → 序列化简历 → 调AI评分,返回 0-100 整数"""
if customize_resume_id:
cr = await customize_resume_store.get_by_id(user_id, customize_resume_id)
if cr is None:
raise ValueError("定制简历不存在")
else:
detail = await load_resume_detail(self.session, resume_id, user_id)
cr = customize_resume_store.build_from_detail(detail)
job = await self._get_job(job_id)
resume_text = self._build_resume_text_from_cr(cr)
skill_tags = "".join(job.skill_tags) if job.skill_tags else ""