mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-09-21 04:46:26 +00:00
refactor: 完成项目大规模代码重构与依赖清理
这是一次综合性的重构更新,包含以下主要变更: 1. 升级Python版本到3.12,更新依赖配置 2. 替换旧的.j2模板为.jinja2格式,新增代码生成模板 3. 重构权限过滤策略,更新权限枚举与模型配置 4. 移除Prefect依赖,替换为自研拓扑并行执行引擎 5. 重构认证与上下文管理,拆分租户/请求上下文 6. 简化响应模型、CRUD与服务层代码 7. 清理废弃的支付网关模块,重构订单定时任务 8. 更新在线用户、监控等模块的接口与路由 9. 优化邮件模板与工具类,新增邮件模板文件 10. 修复数据库会话配置与类型提示
This commit is contained in:
@@ -32,16 +32,8 @@ WorkflowNodeTypeRouter = APIRouter(
|
||||
async def get_workflow_node_type_options_controller(
|
||||
auth: Annotated[AuthSchema, Depends(AuthPermission(["module_task:workflow:node-type:query"]))],
|
||||
) -> JSONResponse:
|
||||
"""
|
||||
获取画布用编排节点类型选项(仅启用项)。
|
||||
|
||||
参数:
|
||||
- auth (AuthSchema): 认证信息。
|
||||
|
||||
返回:
|
||||
- JSONResponse: 成功响应,data 为选项列表。
|
||||
"""
|
||||
result = await WorkflowNodeTypeService.get_options_service(auth=auth)
|
||||
service = WorkflowNodeTypeService(auth)
|
||||
result = await service.get_options()
|
||||
return SuccessResponse(data=result, msg="获取编排节点类型选项成功")
|
||||
|
||||
|
||||
@@ -54,17 +46,8 @@ async def get_workflow_node_type_detail_controller(
|
||||
id: Annotated[int, Path(description="ID")],
|
||||
auth: Annotated[AuthSchema, Depends(AuthPermission(["module_task:workflow:node-type:query"]))],
|
||||
) -> JSONResponse:
|
||||
"""
|
||||
获取编排节点类型详情。
|
||||
|
||||
参数:
|
||||
- id (int): 主键。
|
||||
- auth (AuthSchema): 认证信息。
|
||||
|
||||
返回:
|
||||
- JSONResponse: 成功响应,data 为详情。
|
||||
"""
|
||||
result_dict = await WorkflowNodeTypeService.get_detail_service(auth=auth, id=id)
|
||||
service = WorkflowNodeTypeService(auth)
|
||||
result_dict = await service.get_detail(id=id)
|
||||
return SuccessResponse(data=result_dict, msg="获取编排节点类型详情成功")
|
||||
|
||||
|
||||
@@ -78,22 +61,11 @@ async def get_workflow_node_type_list_controller(
|
||||
search: Annotated[WorkflowNodeTypeQueryParam, Depends()],
|
||||
auth: Annotated[AuthSchema, Depends(AuthPermission(["module_task:workflow:node-type:query"]))],
|
||||
) -> JSONResponse:
|
||||
"""
|
||||
分页查询编排节点类型列表。
|
||||
|
||||
参数:
|
||||
- page (PaginationQueryParam): 分页与排序。
|
||||
- search (WorkflowNodeTypeQueryParam): 查询条件。
|
||||
- auth (AuthSchema): 认证信息。
|
||||
|
||||
返回:
|
||||
- JSONResponse: 成功响应,data 为分页结果。
|
||||
"""
|
||||
order_by = [{"sort_order": "asc"}, {"id": "asc"}]
|
||||
if page.order_by:
|
||||
order_by = page.order_by
|
||||
result_dict = await WorkflowNodeTypeService.get_page_service(
|
||||
auth=auth,
|
||||
service = WorkflowNodeTypeService(auth)
|
||||
result_dict = await service.get_page(
|
||||
page_no=page.page_no,
|
||||
page_size=page.page_size,
|
||||
search=search,
|
||||
@@ -111,17 +83,8 @@ async def create_workflow_node_type_controller(
|
||||
data: WorkflowNodeTypeCreateSchema,
|
||||
auth: Annotated[AuthSchema, Depends(AuthPermission(["module_task:workflow:node-type:create"]))],
|
||||
) -> JSONResponse:
|
||||
"""
|
||||
创建编排节点类型。
|
||||
|
||||
参数:
|
||||
- data (WorkflowNodeTypeCreateSchema): 创建体。
|
||||
- auth (AuthSchema): 认证信息。
|
||||
|
||||
返回:
|
||||
- JSONResponse: 成功响应,data 为新记录。
|
||||
"""
|
||||
result_dict = await WorkflowNodeTypeService.create_service(auth=auth, data=data)
|
||||
service = WorkflowNodeTypeService(auth)
|
||||
result_dict = await service.create(data=data)
|
||||
return SuccessResponse(data=result_dict, msg="创建编排节点类型成功")
|
||||
|
||||
|
||||
@@ -135,18 +98,8 @@ async def update_workflow_node_type_controller(
|
||||
data: WorkflowNodeTypeUpdateSchema,
|
||||
auth: Annotated[AuthSchema, Depends(AuthPermission(["module_task:workflow:node-type:update"]))],
|
||||
) -> JSONResponse:
|
||||
"""
|
||||
更新编排节点类型。
|
||||
|
||||
参数:
|
||||
- id (int): 主键。
|
||||
- data (WorkflowNodeTypeUpdateSchema): 更新体。
|
||||
- auth (AuthSchema): 认证信息。
|
||||
|
||||
返回:
|
||||
- JSONResponse: 成功响应,data 为更新后记录。
|
||||
"""
|
||||
result_dict = await WorkflowNodeTypeService.update_service(auth=auth, id=id, data=data)
|
||||
service = WorkflowNodeTypeService(auth)
|
||||
result_dict = await service.update(id=id, data=data)
|
||||
return SuccessResponse(data=result_dict, msg="更新编排节点类型成功")
|
||||
|
||||
|
||||
@@ -159,17 +112,8 @@ async def delete_workflow_node_type_controller(
|
||||
ids: Annotated[list[int], Body(description="ID列表")],
|
||||
auth: Annotated[AuthSchema, Depends(AuthPermission(["module_task:workflow:node-type:delete"]))],
|
||||
) -> JSONResponse:
|
||||
"""
|
||||
批量删除编排节点类型。
|
||||
|
||||
参数:
|
||||
- ids (list[int]): ID 列表。
|
||||
- auth (AuthSchema): 认证信息。
|
||||
|
||||
返回:
|
||||
- JSONResponse: 成功提示响应。
|
||||
"""
|
||||
await WorkflowNodeTypeService.delete_service(auth=auth, ids=ids)
|
||||
service = WorkflowNodeTypeService(auth)
|
||||
await service.delete(ids=ids)
|
||||
return SuccessResponse(msg="删除编排节点类型成功")
|
||||
|
||||
|
||||
@@ -181,14 +125,6 @@ async def delete_workflow_node_type_controller(
|
||||
async def get_workflow_node_type_select_controller(
|
||||
auth: Annotated[AuthSchema, Depends(AuthPermission(["module_task:workflow:node-type:query"]))],
|
||||
) -> JSONResponse:
|
||||
"""
|
||||
获取编排节点类型选择列表。
|
||||
|
||||
参数:
|
||||
- auth (AuthSchema): 认证信息。
|
||||
|
||||
返回:
|
||||
- JSONResponse: 成功响应,data 为选择列表。
|
||||
"""
|
||||
result = await WorkflowNodeTypeService.get_select_service(auth=auth)
|
||||
service = WorkflowNodeTypeService(auth)
|
||||
result = await service.get_select()
|
||||
return SuccessResponse(data=result, msg="获取编排节点类型选择列表成功")
|
||||
|
||||
Reference in New Issue
Block a user