diff --git a/boss_cli/commands/search.py b/boss_cli/commands/search.py index 51160b1..9e6529d 100644 --- a/boss_cli/commands/search.py +++ b/boss_cli/commands/search.py @@ -327,10 +327,12 @@ def _collect(c: BossClient) -> list[dict]: else: # CSV buf = io.StringIO() - fieldnames = ["职位", "公司", "薪资", "经验", "学历", "城市", "地区", "技能", "securityId"] + fieldnames = ["职位", "公司", "薪资", "经验", "学历", "城市", "地区", "技能", "URL", "securityId"] writer = csv.DictWriter(buf, fieldnames=fieldnames, extrasaction="ignore") writer.writeheader() for job in all_jobs: + eid = job.get("encryptJobId", "") + url = f"https://www.zhipin.com/job_detail/{eid}.html" if eid else "" writer.writerow({ "职位": job.get("jobName", ""), "公司": job.get("brandName", ""), @@ -340,6 +342,7 @@ def _collect(c: BossClient) -> list[dict]: "城市": job.get("cityName", ""), "地区": job.get("areaDistrict", ""), "技能": ", ".join(job.get("skills", [])), + "URL": url, "securityId": job.get("securityId", ""), }) output_text = buf.getvalue() diff --git a/boss_cli/index_cache.py b/boss_cli/index_cache.py index ad6a1fb..6ef3eb3 100644 --- a/boss_cli/index_cache.py +++ b/boss_cli/index_cache.py @@ -35,6 +35,7 @@ def save_index(jobs: list[dict[str, Any]], source: str = "search") -> None: for job in jobs: entry = { "securityId": job.get("securityId", ""), + "encryptJobId": job.get("encryptJobId", ""), "jobName": job.get("jobName", ""), "brandName": job.get("brandName", ""), "salaryDesc": job.get("salaryDesc", ""),