make case catalog read-only

This commit is contained in:
刘金宝
2026-06-04 17:50:22 +08:00
parent b46e43aadc
commit 7f1803f9fa
15 changed files with 35 additions and 1268 deletions
-24
View File
@@ -50,27 +50,3 @@ class CaseDetailResponse(BaseModel):
has_knowledge_points: bool
has_quiz: bool
order_item_types: list[str]
class CaseDeletePreviewResponse(BaseModel):
"""病例删除预览:返回删除该病例会影响的业务数据数量。"""
case_id: int
case_title: str
can_delete: bool
affected: dict[str, int]
class CaseDeleteRequest(BaseModel):
"""病例删除请求:前端必须显式确认,并默认同时删除该病例训练数据。"""
confirm: bool = False
delete_training_data: bool = True
class CaseDeleteResponse(BaseModel):
"""病例删除结果:返回已删除的各表记录数量。"""
deleted: bool
case_id: int
deleted_counts: dict[str, int]
-36
View File
@@ -1,36 +0,0 @@
from pydantic import BaseModel, Field
class CaseSqlPreviewCase(BaseModel):
"""病例 SQL 预览病例:展示导入文件中识别到的病例摘要。"""
id: int
title: str
case_type: str
difficulty: str
class CaseSqlImportPreviewResponse(BaseModel):
"""病例 SQL 预检响应:只展示解析结果,不写入数据库。"""
file_name: str
encoding: str | None = None
tables: dict[str, int] = Field(default_factory=dict)
can_import: bool = False
warnings: list[str] = Field(default_factory=list)
errors: list[str] = Field(default_factory=list)
preview_cases: list[CaseSqlPreviewCase] = Field(default_factory=list)
class CaseSqlImportApplyResponse(BaseModel):
"""病例 SQL 导入响应:展示实际写库结果。"""
imported: bool
file_name: str
encoding: str
inserted_or_updated_cases: int
imported_traditional_cases: int
imported_teaching_cases: int
imported_scoring_rules: int
generated_exam_items: int
warnings: list[str] = Field(default_factory=list)