Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion boss_cli/commands/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -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", ""),
Expand All @@ -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()
Expand Down
1 change: 1 addition & 0 deletions boss_cli/index_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -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", ""),
Expand Down