添加简历诊断功能

This commit is contained in:
zk
2026-04-07 20:15:43 +08:00
parent 602f226377
commit 8ffcb351a6
10 changed files with 1004 additions and 10 deletions
+32
View File
@@ -0,0 +1,32 @@
"""简历诊断问题表(bg_resume_diagnosis_issue"""
from datetime import datetime
from typing import Optional
from sqlalchemy import BigInteger, Integer, String, Text, DateTime, JSON
from sqlalchemy.orm import Mapped, mapped_column
from app.core.database import Base
class ResumeDiagnosisIssue(Base):
"""简历诊断问题表 bg_resume_diagnosis_issue"""
__tablename__ = "bg_resume_diagnosis_issue"
id: Mapped[int] = mapped_column(BigInteger, primary_key=True)
report_id: Mapped[int] = mapped_column(BigInteger, nullable=False, comment="关联report.id")
resume_id: Mapped[int] = mapped_column(BigInteger, nullable=False, comment="关联bg_user_resume.id")
user_id: Mapped[int] = mapped_column(BigInteger, nullable=False, comment="用户ID")
module_type: Mapped[str] = mapped_column(String(32), nullable=False, comment="模块类型: summary/education/work/internship/project/competition")
module_record_id: Mapped[int] = mapped_column(BigInteger, nullable=False, comment="模块记录IDsummary时为resume_id")
finding: Mapped[Optional[str]] = mapped_column(Text, nullable=True, comment="诊断发现")
importance: Mapped[Optional[str]] = mapped_column(Text, nullable=True, comment="为什么重要")
suggestion: Mapped[Optional[str]] = mapped_column(Text, nullable=True, comment="改进建议")
urgent_issues: Mapped[Optional[dict]] = mapped_column(JSON, nullable=True, comment='紧急修复子类型计数 {"typo": 0}')
important_issues: Mapped[Optional[dict]] = mapped_column(JSON, nullable=True, comment='重点优化子类型计数 {"no_result": 0, "no_quantify": 0, "weak_relevance": 0}')
expression_issues: Mapped[Optional[dict]] = mapped_column(JSON, nullable=True, comment='表达提升子类型计数 {"not_concise": 0, "format_inconsistent": 0}')
optimized_content: Mapped[Optional[list | str]] = mapped_column(JSON, nullable=True, comment="AI改写后的内容,子表模块与原description格式一致[{id,text}]保持原id只改写textsummary模块为纯文本字符串")
status: Mapped[int] = mapped_column(Integer, default=0, comment="0=待处理 1=已处理")
user_feedback: Mapped[int] = mapped_column(Integer, default=0, comment="0=未评价 1=符合 2=不符合")
create_time: Mapped[datetime] = mapped_column(DateTime, default=datetime.now, comment="创建时间")
update_time: Mapped[datetime] = mapped_column(DateTime, default=datetime.now, onupdate=datetime.now, comment="更新时间")
+25
View File
@@ -0,0 +1,25 @@
"""简历诊断报告表(bg_resume_diagnosis_report"""
from datetime import datetime
from typing import Optional
from sqlalchemy import BigInteger, Integer, String, Text, DateTime
from sqlalchemy.orm import Mapped, mapped_column
from app.core.database import Base
class ResumeDiagnosisReport(Base):
"""简历诊断报告表 bg_resume_diagnosis_report"""
__tablename__ = "bg_resume_diagnosis_report"
id: Mapped[int] = mapped_column(BigInteger, primary_key=True)
resume_id: Mapped[int] = mapped_column(BigInteger, nullable=False, comment="关联bg_user_resume.id")
user_id: Mapped[int] = mapped_column(BigInteger, nullable=False, comment="用户ID")
grade: Mapped[Optional[str]] = mapped_column(String(1), nullable=True, comment="评级 A/B/C/D")
summary: Mapped[Optional[str]] = mapped_column(Text, nullable=True, comment="AI生成的整体评价")
urgent_total: Mapped[int] = mapped_column(Integer, default=0, comment="紧急修复总数")
important_total: Mapped[int] = mapped_column(Integer, default=0, comment="重点优化总数")
expression_total: Mapped[int] = mapped_column(Integer, default=0, comment="表达提升总数")
create_time: Mapped[datetime] = mapped_column(DateTime, default=datetime.now, comment="创建时间")
update_time: Mapped[datetime] = mapped_column(DateTime, default=datetime.now, onupdate=datetime.now, comment="更新时间")