Files
111 998211c483 feat: 初始化考培练系统项目
- 从服务器拉取完整代码
- 按框架规范整理项目结构
- 配置 Drone CI 测试环境部署
- 包含后端(FastAPI)、前端(Vue3)、管理端

技术栈: Vue3 + TypeScript + FastAPI + MySQL
2026-01-24 19:33:28 +08:00

65 lines
1.8 KiB
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""
能力评估模型
用于存储智能工牌数据分析、练习报告等产生的能力评估结果
"""
from sqlalchemy import Column, Integer, String, DateTime, JSON, ForeignKey, Text
from sqlalchemy.sql import func
from sqlalchemy.orm import relationship
from app.models.base import Base
class AbilityAssessment(Base):
"""能力评估历史表"""
__tablename__ = "ability_assessments"
id = Column(Integer, primary_key=True, index=True, comment='主键ID')
user_id = Column(
Integer,
ForeignKey('users.id', ondelete='CASCADE'),
nullable=False,
comment='用户ID'
)
source_type = Column(
String(50),
nullable=False,
comment='数据来源: yanji_badge(智能工牌), practice_report(练习报告), manual(手动评估)'
)
source_id = Column(
String(100),
comment='来源记录ID如录音ID列表逗号分隔'
)
total_score = Column(
Integer,
comment='综合评分(0-100)'
)
ability_dimensions = Column(
JSON,
nullable=False,
comment='6个能力维度评分JSON数组'
)
recommended_courses = Column(
JSON,
comment='推荐课程列表JSON数组'
)
conversation_count = Column(
Integer,
comment='分析的对话数量'
)
analyzed_at = Column(
DateTime,
server_default=func.now(),
comment='分析时间'
)
created_at = Column(
DateTime,
server_default=func.now(),
comment='创建时间'
)
# 关系
# user = relationship("User", back_populates="ability_assessments")
def __repr__(self):
return f"<AbilityAssessment(id={self.id}, user_id={self.user_id}, total_score={self.total_score})>"