添加热招岗位
This commit is contained in:
@@ -14,6 +14,7 @@ EXTRACT_SYSTEM_PROMPT = """你是招聘公告信息提取专家。用户会给
|
||||
"company_intro": "公司简介",
|
||||
"target_audience": "面向对象",
|
||||
"major_require": "专业要求",
|
||||
"recruit_position": "招聘岗位",
|
||||
"remark": "备注",
|
||||
"written_exam": "有",
|
||||
"apply_start_time": "2026-07-01 00:00:00",
|
||||
@@ -40,6 +41,8 @@ EXTRACT_SYSTEM_PROMPT = """你是招聘公告信息提取专家。用户会给
|
||||
- company_intro:公司介绍段落,原文摘录,最多 300 字。公告中没有公司介绍时,可以根据你自己对该公司的了解补充一段简介;不了解该公司时填 null
|
||||
- target_audience:面向对象,如「2027届本硕博」「2026届及2027届毕业生」,最多 200 字
|
||||
- major_require:专业要求,如「计算机、电子信息、自动化等相关专业」,最多 200 字
|
||||
- recruit_position:本次招聘的具体岗位名称,多个岗位用「、」连接,如「后端开发工程师、算法工程师、产品经理」,
|
||||
最多 500 字。只填岗位名称本身,不要带岗位职责、任职要求、招聘人数等描述。岗位过多时保留最主要的若干个
|
||||
- remark:其他值得注意的补充信息,如薪资待遇、福利、流程安排、注意事项,最多 1000 字
|
||||
- written_exam:是否有笔试,只能填「有」「无」「未明确」三者之一
|
||||
- apply_start_time:投递开始时间,格式 yyyy-MM-dd HH:mm:ss
|
||||
|
||||
@@ -21,6 +21,7 @@ class RecruitAnnouncement(MysqlBase):
|
||||
company_intro: Mapped[Optional[str]] = mapped_column(Text, comment="公司简介")
|
||||
target_audience: Mapped[Optional[str]] = mapped_column(String(500), comment="面向对象,如2027届本硕博")
|
||||
major_require: Mapped[Optional[str]] = mapped_column(String(500), comment="专业要求")
|
||||
recruit_position: Mapped[Optional[str]] = mapped_column(String(1000), comment="招聘岗位")
|
||||
remark: Mapped[Optional[str]] = mapped_column(String(1000), comment="备注")
|
||||
written_exam: Mapped[Optional[str]] = mapped_column(String(16), comment="是否笔试:有 / 无 / 未明确")
|
||||
apply_start_time: Mapped[Optional[datetime]] = mapped_column(DateTime, comment="投递开始时间")
|
||||
|
||||
@@ -34,6 +34,13 @@ def _parse_datetime(value: str | None) -> datetime | None:
|
||||
return None
|
||||
|
||||
|
||||
def _truncate(value: object, limit: int) -> str | None:
|
||||
"""转成字符串并按上限截断,空值返回 None。"""
|
||||
if value is None or value == "":
|
||||
return None
|
||||
return str(value)[:limit]
|
||||
|
||||
|
||||
def _save_announcement(announcement_id: int, company_id: int, url: str, data: dict) -> None:
|
||||
"""保存公告主表和六张关联表,单事务提交。"""
|
||||
now = datetime.now()
|
||||
@@ -49,6 +56,7 @@ def _save_announcement(announcement_id: int, company_id: int, url: str, data: di
|
||||
company_intro=data.get("company_intro"),
|
||||
target_audience=data.get("target_audience"),
|
||||
major_require=data.get("major_require"),
|
||||
recruit_position=_truncate(data.get("recruit_position"), 1000),
|
||||
remark=data.get("remark"),
|
||||
written_exam=data.get("written_exam"),
|
||||
apply_start_time=_parse_datetime(data.get("apply_start_time")),
|
||||
|
||||
Reference in New Issue
Block a user