From 7e60476175d88ec4e24a02f87ef78cf5d3210356 Mon Sep 17 00:00:00 2001 From: JiaoTianBo Date: Tue, 24 Mar 2026 18:17:28 +0800 Subject: [PATCH] =?UTF-8?q?feat(domain):=20=E6=B7=BB=E5=8A=A0ResumeParsed?= =?UTF-8?q?=E5=AF=B9=E8=B1=A1=E8=BD=AC=E5=AD=97=E5=85=B8=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E5=92=8C=E6=97=A5=E5=BF=97=E6=89=93=E5=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在ResumeParsed类中新增to_dict方法,将对象转换为字典 - 在account_sync_job.py中增加VIP等级、简历查看次数相关日志打印 - 从resume_process_job.py中删除简历查看次数判断及跳过逻辑,简化同步流程 --- src/main/python/cn/yinlihupo/ylhp_hr_2_0/domain/resume.py | 6 +++++- .../python/cn/yinlihupo/ylhp_hr_2_0/job/account_sync_job.py | 5 +++++ .../cn/yinlihupo/ylhp_hr_2_0/job/resume_process_job.py | 5 ----- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/main/python/cn/yinlihupo/ylhp_hr_2_0/domain/resume.py b/src/main/python/cn/yinlihupo/ylhp_hr_2_0/domain/resume.py index 1b58b54..0aabafd 100644 --- a/src/main/python/cn/yinlihupo/ylhp_hr_2_0/domain/resume.py +++ b/src/main/python/cn/yinlihupo/ylhp_hr_2_0/domain/resume.py @@ -1,5 +1,5 @@ """Resume entity definitions""" -from dataclasses import dataclass, field +from dataclasses import dataclass, field, asdict from datetime import datetime from typing import Optional, List, Dict, Any @@ -37,6 +37,10 @@ class ResumeParsed: # 原始解析数据 raw_data: Optional[Dict[str, Any]] = None + + def to_dict(self) -> Dict[str, Any]: + """将对象转换为字典""" + return asdict(self) @dataclass diff --git a/src/main/python/cn/yinlihupo/ylhp_hr_2_0/job/account_sync_job.py b/src/main/python/cn/yinlihupo/ylhp_hr_2_0/job/account_sync_job.py index bc08891..d25fb8b 100644 --- a/src/main/python/cn/yinlihupo/ylhp_hr_2_0/job/account_sync_job.py +++ b/src/main/python/cn/yinlihupo/ylhp_hr_2_0/job/account_sync_job.py @@ -238,6 +238,7 @@ class AccountSyncJob: # 解析VIP信息 if hasattr(data, 'vipLevel'): recruiter.privilege.vip_level = str(data.vipLevel) + print(f"[{datetime.now()}] 账号 {recruiter.name} VIP等级: {data.vipLevel}") elif isinstance(data, dict) and 'vipLevel' in data: recruiter.privilege.vip_level = str(data['vipLevel']) @@ -260,14 +261,18 @@ class AccountSyncJob: # 解析简历查看次数 if hasattr(data, 'remainCount'): + print(f"[{datetime.now()}] 账号 {recruiter.name} 剩余简历查看次数: {data.remainCount}") recruiter.privilege.resume_view_count = int(data.remainCount) elif isinstance(data, dict) and 'remainCount' in data: + print(f"[{datetime.now()}] 账号 {recruiter.name} 剩余简历查看次数: {data['remainCount']}") recruiter.privilege.resume_view_count = int(data['remainCount']) if hasattr(data, 'totalCount'): recruiter.privilege.resume_view_total = int(data.totalCount) + print(f"[{datetime.now()}] 账号 {recruiter.name} 总简历查看次数: {data.totalCount}") elif isinstance(data, dict) and 'totalCount' in data: recruiter.privilege.resume_view_total = int(data['totalCount']) + print(f"[{datetime.now()}] 账号 {recruiter.name} 总简历查看次数: {data['totalCount']}") except Exception as e: print(f"[{datetime.now()}] 解析权益数据失败: {e}") diff --git a/src/main/python/cn/yinlihupo/ylhp_hr_2_0/job/resume_process_job.py b/src/main/python/cn/yinlihupo/ylhp_hr_2_0/job/resume_process_job.py index 38b7275..92ce306 100644 --- a/src/main/python/cn/yinlihupo/ylhp_hr_2_0/job/resume_process_job.py +++ b/src/main/python/cn/yinlihupo/ylhp_hr_2_0/job/resume_process_job.py @@ -132,11 +132,6 @@ class ResumeProcessJob: print(f"[{datetime.now()}] 账号 {recruiter.name} 上次同步失败,跳过") continue - # 检查是否有查看次数(可选,有些平台可能不限制) - if recruiter.privilege and recruiter.privilege.resume_view_count == 0: - print(f"[{datetime.now()}] 账号 {recruiter.name} 简历查看次数已用完,跳过") - continue - eligible_recruiters.append(recruiter) return eligible_recruiters