v2.0.1更新

This commit is contained in:
2026-05-26 08:39:12 +08:00
parent cb0c367eb7
commit c575d711ee
34 changed files with 750 additions and 204 deletions

View File

@@ -68,6 +68,11 @@ class SubjectService:
@staticmethod
async def delete_subject(subject_id: int) -> Dict[str, Any]:
"""删除科目(软删除)"""
# 检查科目是否有关联数据
has_data = await SubjectModel.has_related_data(subject_id)
if has_data:
return {"success": False, "message": "该科目下已有作业数据,无法删除"}
result = await SubjectModel.delete(subject_id)
if result: