feat: 添加module表status字段及相关接口优化

1. 在module表新增status字段(0:待确认;1:正常;2:弃用)
2. 修改/document/generate-cases接口,创建模块时设置status=0
3. 修改/case/restore接口,恢复用例时同步更新模块及其父模块的status为1
4. 修改/case/list接口,支持module_status参数过滤,默认只显示status=1的模块
5. 修改/case/list接口,返回module_path字段
6. 修改/plan/case/list接口,返回module_path字段
7. 修改/module/tree接口,默认筛选status=1的数据
8. 优化数据库连接池配置,添加连接验证和自动重试机制
This commit is contained in:
qiaoxinjiu
2026-05-18 10:04:56 +08:00
parent 4cc0f1453c
commit b71c4a66e1
14 changed files with 489 additions and 150 deletions

View File

@@ -17,6 +17,7 @@ class Module(Base):
sort_order = Column(Integer, default=0, comment='排序')
path = Column(String(512), comment='模块路径')
is_delete = Column(Integer, default=0, comment='0未删除1已删除')
status = Column(Integer, default=0, comment='0待确认1正常2弃用')
class TestCase(Base):
@@ -34,6 +35,7 @@ class TestCase(Base):
tags = Column(ARRAY(String(64)), server_default=text("'{}'::varchar[]"), comment='标签')
status = Column(SmallInteger, default=1, comment='1:正常 2:已废弃 3:评审中 4评审通过')
is_auto = Column(Integer, default=0, comment='0未实现自动化1已实现自动化')
is_ai_generated = Column(Integer, default=0, comment='0非AI生成1AI生成')
created_by = Column(BigInteger, comment='创建人')
is_delete = Column(Integer, default=0, comment='0未删除1已删除')
created_time = Column(TIMESTAMP, server_default=text('CURRENT_TIMESTAMP'), nullable=True, comment='创建时间')