[Update#1]支撑AI生成测试项-接口调整
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -13,9 +13,9 @@ class DeleteSchema(Schema):
|
||||
|
||||
# 测试步骤输出schema
|
||||
class CaseStepSchema(ModelSchema):
|
||||
class Config:
|
||||
class Meta:
|
||||
model = CaseStep
|
||||
model_fields = ["operation", 'expect', 'result', 'passed', 'case', 'id']
|
||||
fields = ["operation", 'expect', 'result', 'passed', 'case', 'id']
|
||||
|
||||
# 测试用例的步骤输出schema,输出isPassed和isExe转换后的
|
||||
class CaseStepWithTransitionSchema(ModelSchema):
|
||||
@@ -28,9 +28,9 @@ class CaseModelOutSchemaWithoutProblem(ModelSchema):
|
||||
testStep: List[CaseStepWithTransitionSchema]
|
||||
testType: str # 用例额外字段,用于测试类型FT的标识给前端
|
||||
|
||||
class Config:
|
||||
class Meta:
|
||||
model = Case
|
||||
model_exclude = ['project', 'round', 'dut', 'design', 'test', 'remark', 'sort']
|
||||
exclude = ['project', 'round', 'dut', 'design', 'test', 'remark', 'sort']
|
||||
|
||||
# 输出case:关联问题单
|
||||
class CaseModelOutSchemaOrigin(ModelSchema):
|
||||
@@ -39,9 +39,9 @@ class CaseModelOutSchemaOrigin(ModelSchema):
|
||||
# 新增:关联的问题单
|
||||
problem: Optional[ProblemModelOutSchema] = None
|
||||
|
||||
class Config:
|
||||
class Meta:
|
||||
model = Case
|
||||
model_exclude = ['project', 'round', 'dut', 'design', 'test', 'remark', 'sort']
|
||||
exclude = ['project', 'round', 'dut', 'design', 'test', 'remark', 'sort']
|
||||
|
||||
# 输出case:关联问题单
|
||||
class CaseModelOutSchema(ModelSchema):
|
||||
@@ -52,9 +52,9 @@ class CaseModelOutSchema(ModelSchema):
|
||||
# 2025年5月10日新增上级字段
|
||||
test: Optional[TestDemandModelOutSchemaOrigin] = None
|
||||
|
||||
class Config:
|
||||
class Meta:
|
||||
model = Case
|
||||
model_exclude = ['project', 'round', 'dut', 'design', 'test', 'remark', 'sort']
|
||||
exclude = ['project', 'round', 'dut', 'design', 'test', 'remark', 'sort']
|
||||
|
||||
# 查询测试项
|
||||
class CaseFilterSchema(Schema):
|
||||
@@ -93,9 +93,9 @@ class CaseTreeInputSchema(Schema):
|
||||
class CaseCreateOutSchema(ModelSchema):
|
||||
level: Union[str, int]
|
||||
|
||||
class Config:
|
||||
class Meta:
|
||||
model = Case
|
||||
model_exclude = ['remark', 'sort', 'project', 'round', 'dut', 'design']
|
||||
exclude = ['remark', 'sort', 'project', 'round', 'dut', 'design']
|
||||
|
||||
# 新增接口schema
|
||||
class CaseInputSchema(Schema):
|
||||
|
||||
@@ -23,17 +23,17 @@ class DesignFilterSchema(Schema):
|
||||
|
||||
# 2025年改为2个输出,因为下级需要上级,原始不再嵌套上级
|
||||
class DesignModelOutSchemaOrigin(ModelSchema):
|
||||
class Config:
|
||||
class Meta:
|
||||
model = Design
|
||||
model_exclude = ['project', 'round', 'dut', 'remark', 'sort']
|
||||
exclude = ['project', 'round', 'dut', 'remark', 'sort']
|
||||
|
||||
class DesignModelOutSchema(ModelSchema):
|
||||
# 新增字段 - 上级的dut对象
|
||||
dut: Optional[DutModelOutSchema] = None
|
||||
|
||||
class Config:
|
||||
class Meta:
|
||||
model = Design
|
||||
model_exclude = ['project', 'round', 'dut', 'remark', 'sort']
|
||||
exclude = ['project', 'round', 'dut', 'remark', 'sort']
|
||||
|
||||
# 处理树状结构的schema
|
||||
class DesignTreeReturnSchema(Schema):
|
||||
|
||||
@@ -5,9 +5,9 @@ from datetime import date
|
||||
from pydantic import AliasChoices
|
||||
|
||||
class DutModelOutSchema(ModelSchema):
|
||||
class Config:
|
||||
class Meta:
|
||||
model = Dut
|
||||
model_exclude = ['project', 'round', 'remark', 'sort']
|
||||
exclude = ['project', 'round', 'remark', 'sort']
|
||||
|
||||
class DutFilterSchema(Schema):
|
||||
project_id: int = Field(None, alias='projectId')
|
||||
@@ -56,9 +56,9 @@ class DutCreateOutSchema(ModelSchema):
|
||||
effective_lines: Optional[Union[str, int]] = None
|
||||
comment_lines: Optional[Union[str, int]] = None
|
||||
|
||||
class Config:
|
||||
class Meta:
|
||||
model = Dut
|
||||
model_exclude = ['remark', 'sort', 'project', 'round']
|
||||
exclude = ['remark', 'sort', 'project', 'round']
|
||||
|
||||
# 删除schema
|
||||
class DeleteSchema(Schema):
|
||||
|
||||
@@ -11,9 +11,9 @@ class ProblemModelOutSchema(ModelSchema):
|
||||
related: Optional[bool] = Field(False) # 给前端反应是否为关联的问题单
|
||||
hang: bool = Field(False) # 给前端反应是否是悬挂状态(即没有关联case)
|
||||
|
||||
class Config:
|
||||
class Meta:
|
||||
model = Problem
|
||||
model_exclude = ['case', 'remark', 'sort']
|
||||
exclude = ['case', 'remark', 'sort']
|
||||
|
||||
# 查询问题单
|
||||
class ProblemFilterSchema(Schema):
|
||||
@@ -53,9 +53,9 @@ class ProblemTreeInputSchema(Schema):
|
||||
|
||||
# 增加问题单
|
||||
class ProblemCreateOutSchema(ModelSchema):
|
||||
class Config:
|
||||
class Meta:
|
||||
model = Problem
|
||||
model_exclude = ['remark', 'sort', 'case']
|
||||
exclude = ['remark', 'sort', 'case']
|
||||
|
||||
# 更新,新增schema
|
||||
class ProblemCreateInputSchema(Schema):
|
||||
|
||||
@@ -7,9 +7,9 @@ from typing import List, Optional
|
||||
window_file_str = ['\\', '/', ':', '*', '?', '"', '<', '>', "|"]
|
||||
|
||||
class ProjectRetrieveSchema(ModelSchema):
|
||||
class Config:
|
||||
class Meta:
|
||||
model = Project
|
||||
model_exclude = ['update_datetime', 'create_datetime', 'remark']
|
||||
exclude = ['update_datetime', 'create_datetime', 'remark']
|
||||
|
||||
class ProjectFilterSchema(Schema):
|
||||
ident: Optional[str] = None
|
||||
@@ -26,9 +26,9 @@ class ProjectFilterSchema(Schema):
|
||||
class ProjectCreateInput(ModelSchema):
|
||||
ident: str
|
||||
|
||||
class Config:
|
||||
class Meta:
|
||||
model = Project
|
||||
model_exclude = ['remark', 'update_datetime', 'create_datetime', 'sort', 'id']
|
||||
exclude = ['remark', 'update_datetime', 'create_datetime', 'sort', 'id']
|
||||
|
||||
@field_validator('ident')
|
||||
@staticmethod
|
||||
|
||||
@@ -69,9 +69,9 @@ class TestDemandTreeInputSchema(Schema):
|
||||
class TestDemandCreateOutSchema(ModelSchema):
|
||||
level: Union[str, int]
|
||||
|
||||
class Config:
|
||||
class Meta:
|
||||
model = TestDemand
|
||||
model_exclude = ['remark', 'sort', 'project', 'round', 'dut', 'design']
|
||||
exclude = ['remark', 'sort', 'project', 'round', 'dut', 'design']
|
||||
|
||||
# 新增测试子项,单个子项的Schema
|
||||
class TestContentInputSchema(Schema):
|
||||
|
||||
Reference in New Issue
Block a user