- 新增数据库表: growth_path_nodes, user_growth_path_progress, user_node_completions - 新增 Model: GrowthPathNode, UserGrowthPathProgress, UserNodeCompletion - 新增 Service: GrowthPathService(管理端CRUD、学员端进度追踪) - 新增 API: 学员端获取成长路径、管理端CRUD - 前端学员端从API动态加载成长路径数据 - 更新管理端API接口定义
This commit is contained in:
@@ -223,10 +223,20 @@ class GrowthPath(BaseModel, SoftDeleteMixin):
|
||||
target_role: Mapped[Optional[str]] = mapped_column(
|
||||
String(100), nullable=True, comment="目标角色"
|
||||
)
|
||||
|
||||
# 岗位关联
|
||||
position_id: Mapped[Optional[int]] = mapped_column(
|
||||
Integer, nullable=True, comment="关联岗位ID"
|
||||
)
|
||||
|
||||
# 路径配置
|
||||
# 路径配置(保留用于兼容,新版使用 nodes 关联表)
|
||||
courses: Mapped[Optional[List[dict]]] = mapped_column(
|
||||
JSON, nullable=True, comment="课程列表[{course_id, order, is_required}]"
|
||||
JSON, nullable=True, comment="课程列表[{course_id, order, is_required}](已废弃,使用nodes)"
|
||||
)
|
||||
|
||||
# 阶段配置
|
||||
stages: Mapped[Optional[List[dict]]] = mapped_column(
|
||||
JSON, nullable=True, comment="阶段配置[{name, description, order}]"
|
||||
)
|
||||
|
||||
# 预计时长
|
||||
@@ -241,6 +251,11 @@ class GrowthPath(BaseModel, SoftDeleteMixin):
|
||||
sort_order: Mapped[int] = mapped_column(
|
||||
Integer, default=0, nullable=False, comment="排序顺序"
|
||||
)
|
||||
|
||||
# 关联关系
|
||||
nodes: Mapped[List["GrowthPathNode"]] = relationship(
|
||||
"GrowthPathNode", back_populates="growth_path", cascade="all, delete-orphan"
|
||||
)
|
||||
|
||||
|
||||
class MaterialKnowledgePoint(BaseModel, SoftDeleteMixin):
|
||||
|
||||
Reference in New Issue
Block a user