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

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

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

/**
 * @description 获得流程监听器
 * @url /bpm/process-listener/get
 * @method GET
 * @author @pubinfo/openapi
 */
export function getBpmProcessListenerGet<
  R = API.ResponseDataBpmProcessListenerRespVO,
  T = API.ResponseDataBpmProcessListenerRespVO,
>(
  params: API.getBpmProcessListenerGetParams,
  options?: Parameters<typeof request.Get<R, T>>[1],
) {
  return request.Get<R, T>('/bpm/process-listener/get', {
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/**
 * @description 获得流程监听器分页
 * @url /bpm/process-listener/page
 * @method POST
 * @author @pubinfo/openapi
 */
export function postBpmProcessListenerPage<
  R = API.ResponseDataPageDataBpmProcessListenerRespVO,
  T = API.ResponseDataPageDataBpmProcessListenerRespVO,
>(
  body: API.BpmProcessListenerPageReqVO,
  options?: Parameters<typeof request.Post<R, T>>[2],
) {
  return request.Post<R, T>('/bpm/process-listener/page', body, {
    headers: {
      'Content-Type': 'application/json',
    },
    ...(options || {}),
  });
}

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