[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):
|
||||
|
||||
@@ -332,3 +332,17 @@ AttributeError: 'str' object has no attribute 'testType'
|
||||
[WARNING][2025-11-17 16:45:54,859][log.py:253]Unauthorized: /api/system/getInfo
|
||||
[WARNING][2025-11-17 16:45:54,926][log.py:253]Unauthorized: /api/system/logout
|
||||
[WARNING][2025-11-17 16:46:10,800][backend.py:91]Caught LDAPError looking up user: SERVER_DOWN({'result': -1, 'desc': "Can't contact LDAP server", 'ctrls': []})
|
||||
[WARNING][2025-11-18 15:07:15,118][log.py:253]Unauthorized: /api/system/getInfo
|
||||
[WARNING][2025-11-18 15:07:15,177][log.py:253]Unauthorized: /api/system/logout
|
||||
[WARNING][2025-11-26 14:01:13,585][backend.py:91]Caught LDAPError looking up user: SERVER_DOWN({'result': -1, 'desc': "Can't contact LDAP server", 'ctrls': []})
|
||||
[WARNING][2025-11-26 14:01:13,879][operation.py:131]"POST - UserTokenController[obtain_token] /api/system/login" 401
|
||||
[WARNING][2025-11-26 14:01:13,881][log.py:253]Unauthorized: /api/system/login
|
||||
[WARNING][2025-11-26 14:01:18,695][backend.py:91]Caught LDAPError looking up user: SERVER_DOWN({'result': -1, 'desc': "Can't contact LDAP server", 'ctrls': []})
|
||||
[WARNING][2025-11-28 13:08:56,051][log.py:253]Not Found: /api/user/admin
|
||||
[WARNING][2025-11-28 13:09:03,236][log.py:253]Not Found: /api/user/admin
|
||||
[WARNING][2025-11-28 13:09:15,425][log.py:253]Not Found: /api/user/admin
|
||||
[WARNING][2025-12-01 09:14:00,800][backend.py:91]Caught LDAPError looking up user: SERVER_DOWN({'result': -1, 'desc': "Can't contact LDAP server", 'ctrls': []})
|
||||
[WARNING][2025-12-02 09:12:28,085][log.py:253]Unauthorized: /api/system/getInfo
|
||||
[WARNING][2025-12-02 09:12:28,124][log.py:253]Unauthorized: /api/system/logout
|
||||
[WARNING][2025-12-02 09:12:36,217][backend.py:91]Caught LDAPError looking up user: SERVER_DOWN({'result': -1, 'desc': "Can't contact LDAP server", 'ctrls': []})
|
||||
[WARNING][2025-12-02 15:56:55,439][backend.py:91]Caught LDAPError looking up user: SERVER_DOWN({'result': -1, 'desc': "Can't contact LDAP server", 'ctrls': []})
|
||||
|
||||
@@ -11,18 +11,18 @@ typing_extensions~=4.15.0
|
||||
python-ldap~=3.4.4
|
||||
# 项目包
|
||||
django-environ~=0.12.0
|
||||
django-ninja~=1.4.5
|
||||
django-ninja~=1.5.0
|
||||
pydantic~=2.12.4
|
||||
pydantic-core~=2.41.5
|
||||
django-ninja-extra~=0.30.2
|
||||
django-ninja-jwt~=5.4.0
|
||||
django-ninja-extra~=0.30.6
|
||||
django-ninja-jwt~=5.4.2
|
||||
django-tinymce~=5.0.0
|
||||
PyJWT~=2.10.1
|
||||
cryptography~=45.0.6
|
||||
ninja-schema~=0.14.3
|
||||
user-agents~=2.2.0
|
||||
numpy~=2.3.4
|
||||
docxtpl~=0.20.1
|
||||
docxtpl~=0.20.2
|
||||
python-docx~=1.2.0
|
||||
Jinja2~=3.1.6
|
||||
django-redis~=6.0.0
|
||||
|
||||
Reference in New Issue
Block a user