"""MySQL: bg_job 表模型""" from datetime import datetime from typing import Optional from sqlalchemy import BigInteger, DateTime, Integer, JSON, String, Text from sqlalchemy.orm import Mapped, mapped_column from app.core.database import MysqlBase class Job(MysqlBase): """岗位表""" __tablename__ = "bg_job" id: Mapped[int] = mapped_column(BigInteger, primary_key=True, comment="主键ID(雪花)") title: Mapped[str] = mapped_column(String(255), nullable=False, comment="岗位名称") company_id: Mapped[int] = mapped_column(BigInteger, nullable=False, comment="关联公司ID") category_id: Mapped[int] = mapped_column(BigInteger, nullable=False, comment="岗位类型ID") employment_type: Mapped[int] = mapped_column(Integer, default=0, comment="0=全职 1=兼职") description: Mapped[Optional[str]] = mapped_column(Text, comment="岗位职责") requirement: Mapped[Optional[str]] = mapped_column(Text, comment="任职要求") bonus: Mapped[Optional[str]] = mapped_column(Text, comment="加分项") tags: Mapped[Optional[list]] = mapped_column(JSON, comment="岗位标签JSON数组") skill_tags: Mapped[Optional[list]] = mapped_column(JSON, comment="技能标签JSON数组") salary: Mapped[Optional[str]] = mapped_column(String(64), comment="薪资描述,如15-25K") education: Mapped[int] = mapped_column(Integer, default=0, comment="学历要求 0=不限 1=大专 2=本科 3=硕士 4=博士") min_experience: Mapped[int] = mapped_column(Integer, default=0, comment="最低工作年限,0=不要求") required_industry_id: Mapped[Optional[int]] = mapped_column(BigInteger, comment="要求的行业经验ID") required_major_ids: Mapped[Optional[list]] = mapped_column(JSON, comment="要求专业ID数组") major_sensitivity: Mapped[Optional[int]] = mapped_column(Integer, comment="专业敏感度 0=不限 1=优先 2=强制") source_url: Mapped[Optional[str]] = mapped_column(String(1024), comment="来源链接") source_id: Mapped[Optional[str]] = mapped_column(String(64), comment="爬虫原始数据ID,用于去重") content_hash: Mapped[Optional[str]] = mapped_column(String(64), comment="内容哈希,用于去重续命") recruit_category: Mapped[Optional[int]] = mapped_column(Integer, comment="招聘分类: 0=校招 1=实习 2=社招 3=其他") expire_at: Mapped[Optional[datetime]] = mapped_column(DateTime, comment="发布日期") status: Mapped[int] = mapped_column(Integer, default=0, comment="0=上架 1=下架 2=已失效") create_time: Mapped[datetime] = mapped_column(DateTime, nullable=False, comment="创建时间") update_time: Mapped[datetime] = mapped_column(DateTime, nullable=False, comment="更新时间")