mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-09-28 15:09:57 +00:00
refactor: 完成项目代码结构优化与权限清理
主要变更: 1. 重构健康检查模块,迁移目录结构并合并重复代码 2. 清理路由标签冗余的"系统管理/平台管理"前缀,简化标签名称 3. 重构工作流相关目录与API,统一命名为flow和nodes 4. 重命名缓存删除接口为clear,同步前后端路由与权限 5. 简化接口参数描述,统一批量状态修改的请求体格式 6. 重构动态路由加载逻辑,优化初始化流程 7. 清理废弃的self_service模块,整合租户自助服务到租户API 8. 重构发票管理接口,统一路由前缀与权限控制 9. 优化代码生成模板,补全参数注解与描述 10: 修复日志删除接口的参数解析逻辑
This commit is contained in:
@@ -0,0 +1,110 @@
|
||||
import { request } from "@utils";
|
||||
|
||||
/** 对应后端 `plugin.module_task.workflow.flow` */
|
||||
const API_PATH = "/task/workflow/flow";
|
||||
|
||||
const WorkflowDefinitionAPI = {
|
||||
getWorkflowList(query: WorkflowPageQuery) {
|
||||
return request<ApiResponse<PageResult<WorkflowTable>>>({
|
||||
url: `${API_PATH}/list`,
|
||||
method: "get",
|
||||
params: query,
|
||||
});
|
||||
},
|
||||
|
||||
getWorkflowDetail(query: number) {
|
||||
return request<ApiResponse<WorkflowTable>>({
|
||||
url: `${API_PATH}/detail/${query}`,
|
||||
method: "get",
|
||||
});
|
||||
},
|
||||
|
||||
createWorkflow(body: WorkflowForm) {
|
||||
return request<ApiResponse<WorkflowTable>>({
|
||||
url: `${API_PATH}/create`,
|
||||
method: "post",
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
|
||||
updateWorkflow(id: number, body: WorkflowForm) {
|
||||
return request<ApiResponse<WorkflowTable>>({
|
||||
url: `${API_PATH}/update/${id}`,
|
||||
method: "put",
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
|
||||
deleteWorkflow(body: number[]) {
|
||||
return request<ApiResponse>({
|
||||
url: `${API_PATH}/delete`,
|
||||
method: "delete",
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
|
||||
publishWorkflow(id: number, body: WorkflowPublishForm) {
|
||||
return request<ApiResponse<WorkflowTable>>({
|
||||
url: `${API_PATH}/publish/${id}`,
|
||||
method: "post",
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
|
||||
executeWorkflow(body: WorkflowExecuteForm) {
|
||||
return request<ApiResponse<WorkflowExecuteResult>>({
|
||||
url: `${API_PATH}/execute`,
|
||||
method: "post",
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
export default WorkflowDefinitionAPI;
|
||||
export { WorkflowDefinitionAPI };
|
||||
|
||||
export interface WorkflowPageQuery extends PageQuery, UserByQueryParams {
|
||||
name?: string;
|
||||
code?: string;
|
||||
status?: number;
|
||||
}
|
||||
|
||||
export interface WorkflowTable extends BaseType {
|
||||
name?: string;
|
||||
code?: string;
|
||||
nodes?: any[];
|
||||
edges?: any[];
|
||||
status?: number;
|
||||
description?: string;
|
||||
}
|
||||
|
||||
export interface WorkflowForm extends BaseFormType {
|
||||
name?: string;
|
||||
code?: string;
|
||||
nodes?: any[];
|
||||
edges?: any[];
|
||||
status?: number;
|
||||
description?: string;
|
||||
}
|
||||
|
||||
export interface WorkflowPublishForm {
|
||||
remark?: string;
|
||||
}
|
||||
|
||||
export interface WorkflowExecuteForm {
|
||||
workflow_id: number;
|
||||
variables?: Record<string, any>;
|
||||
business_key?: string;
|
||||
job_id?: number;
|
||||
}
|
||||
|
||||
export interface WorkflowExecuteResult {
|
||||
workflow_id: number;
|
||||
workflow_name: string;
|
||||
status: number;
|
||||
start_time?: string;
|
||||
end_time?: string;
|
||||
variables?: Record<string, any>;
|
||||
node_results?: Record<string, any>;
|
||||
error?: string;
|
||||
}
|
||||
Reference in New Issue
Block a user