import { basic as request } from '@/api/request';

/**
 * @description 创建流程表达式
 * @url /bpm/process-expression/create
 * @method POST
 * @author @pubinfo/openapi
 */
export function postBpmProcessExpressionCreate<
  R = API.ResponseDataString,
  T = API.ResponseDataString,
>(
  body: API.BpmProcessExpressionSaveReqVO,
  options?: Parameters<typeof request.Post<R, T>>[2],
) {
  return request.Post<R, T>('/bpm/process-expression/create', body, {
    headers: {
      'Content-Type': 'application/json',
    },
    ...(options || {}),
  });
}

/**
 * @description 删除流程表达式
 * @url /bpm/process-expression/delete
 * @method POST
 * @author @pubinfo/openapi
 */
export function postBpmProcessExpressionDelete<
  R = API.ResponseDataBoolean,
  T = API.ResponseDataBoolean,
>(
  params: API.postBpmProcessExpressionDeleteParams,
  options?: Parameters<typeof request.Post<R, T>>[2],
) {
  return request.Post<R, T>(
    '/bpm/process-expression/delete',
    {},
    {
      params: {
        ...params,
      },
      ...(options || {}),
    },
  );
}

/**
 * @description 获得流程表达式
 * @url /bpm/process-expression/get
 * @method GET
 * @author @pubinfo/openapi
 */
export function getBpmProcessExpressionGet<
  R = API.ResponseDataBpmProcessExpressionRespVO,
  T = API.ResponseDataBpmProcessExpressionRespVO,
>(
  params: API.getBpmProcessExpressionGetParams,
  options?: Parameters<typeof request.Get<R, T>>[1],
) {
  return request.Get<R, T>('/bpm/process-expression/get', {
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/**
 * @description 获得流程表达式分页
 * @url /bpm/process-expression/page
 * @method POST
 * @author @pubinfo/openapi
 */
export function postBpmProcessExpressionPage<
  R = API.ResponseDataPageDataBpmProcessExpressionRespVO,
  T = API.ResponseDataPageDataBpmProcessExpressionRespVO,
>(
  body: API.BpmProcessExpressionPageReqVO,
  options?: Parameters<typeof request.Post<R, T>>[2],
) {
  return request.Post<R, T>('/bpm/process-expression/page', body, {
    headers: {
      'Content-Type': 'application/json',
    },
    ...(options || {}),
  });
}

/**
 * @description 更新流程表达式
 * @url /bpm/process-expression/update
 * @method POST
 * @author @pubinfo/openapi
 */
export function postBpmProcessExpressionUpdate<
  R = API.ResponseDataBoolean,
  T = API.ResponseDataBoolean,
>(
  body: API.BpmProcessExpressionSaveReqVO,
  options?: Parameters<typeof request.Post<R, T>>[2],
) {
  return request.Post<R, T>('/bpm/process-expression/update', body, {
    headers: {
      'Content-Type': 'application/json',
    },
    ...(options || {}),
  });
}
