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

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

/**
 * @description 删除流程分类
 * @url /bpm/category/delete
 * @method POST
 * @author @pubinfo/openapi
 */
export function postBpmCategoryDelete<
  R = API.ResponseDataBoolean,
  T = API.ResponseDataBoolean,
>(
  params: API.postBpmCategoryDeleteParams,
  options?: Parameters<typeof request.Post<R, T>>[2],
) {
  return request.Post<R, T>(
    '/bpm/category/delete',
    {},
    {
      params: {
        ...params,
      },
      ...(options || {}),
    },
  );
}

/**
 * @description 获得流程分类
 * @url /bpm/category/get
 * @method GET
 * @author @pubinfo/openapi
 */
export function getBpmCategoryGet<
  R = API.ResponseDataBpmCategoryRespVO,
  T = API.ResponseDataBpmCategoryRespVO,
>(
  params: API.getBpmCategoryGetParams,
  options?: Parameters<typeof request.Get<R, T>>[1],
) {
  return request.Get<R, T>('/bpm/category/get', {
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/**
 * @description 获得流程用户信息
 * @url /bpm/category/getUserList
 * @method POST
 * @author @pubinfo/openapi
 */
export function postBpmCategoryGetUserList<
  R = API.ResponseDataListUserRespDto,
  T = API.ResponseDataListUserRespDto,
>(body: string[], options?: Parameters<typeof request.Post<R, T>>[2]) {
  return request.Post<R, T>('/bpm/category/getUserList', body, {
    headers: {
      'Content-Type': 'application/json',
    },
    ...(options || {}),
  });
}

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

/**
 * @description 获取流程分类的精简信息列表 只包含被开启的分类，主要用于前端的下拉选项
 * @url /bpm/category/simple-list
 * @method GET
 * @author @pubinfo/openapi
 */
export function getBpmCategorySimpleList<
  R = API.ResponseDataListBpmCategoryRespVO,
  T = API.ResponseDataListBpmCategoryRespVO,
>(options?: Parameters<typeof request.Get<R, T>>[1]) {
  return request.Get<R, T>('/bpm/category/simple-list', {
    ...(options || {}),
  });
}

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

/**
 * @description 批量更新流程分类的排序
 * @url /bpm/category/update-sort-batch
 * @method POST
 * @author @pubinfo/openapi
 */
export function postBpmCategoryUpdateSortBatch<
  R = API.ResponseDataBoolean,
  T = API.ResponseDataBoolean,
>(
  params: API.postBpmCategoryUpdateSortBatchParams,
  options?: Parameters<typeof request.Post<R, T>>[2],
) {
  return request.Post<R, T>(
    '/bpm/category/update-sort-batch',
    {},
    {
      params: {
        ...params,
      },
      ...(options || {}),
    },
  );
}
