24 lines
694 B
TypeScript
24 lines
694 B
TypeScript
import { http } from '@/utils/http';
|
|
import type { FlowResponse, FlowQuery, FlowRequest } from './types';
|
|
|
|
const baseUrl = '/api/v1/flows';
|
|
|
|
// 获取流程列表
|
|
export const getList = (params?: FlowQuery) =>
|
|
http.get<FlowResponse[]>(baseUrl, { params });
|
|
|
|
// 获取流程详情
|
|
export const getDetail = (id: number) =>
|
|
http.get<FlowResponse>(`${baseUrl}/${id}`);
|
|
|
|
// 创建流程
|
|
export const create = (data: FlowRequest) =>
|
|
http.post<FlowResponse>(baseUrl, data);
|
|
|
|
// 更新流程
|
|
export const update = (id: number, data: FlowRequest) =>
|
|
http.put<FlowResponse>(`${baseUrl}/${id}`, data);
|
|
|
|
// 删除流程
|
|
export const remove = (id: number) =>
|
|
http.delete(`${baseUrl}/${id}`);
|