// @ts-ignore
/* eslint-disable */
import request from "../request";

/** 检查供应商 GET /operation/checkSupplier */
export async function checkSupplier(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: BusinessAPI.checkSupplierParams,
  options?: { [key: string]: any },
) {
  return request<BusinessAPI.SingleResponseSupplierVO>(
    "/operation/checkSupplier",
    {
      method: "GET",
      params: {
        ...params,
        supplierCheckQry: undefined,
        ...params["supplierCheckQry"],
      },
      ...(options || {}),
    },
  );
}

/** 创建供应商 POST /operation/createSupplier */
export async function createSupplier(
  body: BusinessAPI.SupplierCreateCmd,
  options?: { [key: string]: any },
) {
  return request<BusinessAPI.SingleResponseSupplierVO>(
    "/operation/createSupplier",
    {
      method: "POST",
      headers: {
        "Content-Type": "application/json",
      },
      data: body,
      ...(options || {}),
    },
  );
}

/** 供应商删除 DELETE /operation/destroySupplier */
export async function destroySupplier(
  body: BusinessAPI.SupplierDestroyCmd,
  options?: { [key: string]: any },
) {
  return request<BusinessAPI.Response>("/operation/destroySupplier", {
    method: "DELETE",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}

/** 供应商列表 GET /operation/listSupplier */
export async function listSupplier(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: BusinessAPI.listSupplierParams,
  options?: { [key: string]: any },
) {
  return request<BusinessAPI.MultiResponseSupplierVO>(
    "/operation/listSupplier",
    {
      method: "GET",
      params: {
        ...params,
        supplierListQry: undefined,
        ...params["supplierListQry"],
      },
      ...(options || {}),
    },
  );
}

/** 供应商列表 GET /operation/pageSupplier */
export async function pageSupplier(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: BusinessAPI.pageSupplierParams,
  options?: { [key: string]: any },
) {
  return request<BusinessAPI.PageResponseSupplierVO>(
    "/operation/pageSupplier",
    {
      method: "GET",
      params: {
        ...params,
        supplierPageQry: undefined,
        ...params["supplierPageQry"],
      },
      ...(options || {}),
    },
  );
}

/** 供应商详情 GET /operation/showSupplier */
export async function showSupplier(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: BusinessAPI.showSupplierParams,
  options?: { [key: string]: any },
) {
  return request<BusinessAPI.SingleResponseSupplierVO>(
    "/operation/showSupplier",
    {
      method: "GET",
      params: {
        ...params,
        supplierShowQry: undefined,
        ...params["supplierShowQry"],
      },
      ...(options || {}),
    },
  );
}

/** 供应商更新 PUT /operation/updateSupplier */
export async function updateSupplier(
  body: BusinessAPI.SupplierUpdateCmd,
  options?: { [key: string]: any },
) {
  return request<BusinessAPI.SingleResponseSupplierVO>(
    "/operation/updateSupplier",
    {
      method: "PUT",
      headers: {
        "Content-Type": "application/json",
      },
      data: body,
      ...(options || {}),
    },
  );
}

/** 供应商更新 PATCH /operation/updateSupplier */
export async function updateSupplier1(
  body: BusinessAPI.SupplierUpdateCmd,
  options?: { [key: string]: any },
) {
  return request<BusinessAPI.SingleResponseSupplierVO>(
    "/operation/updateSupplier",
    {
      method: "PATCH",
      headers: {
        "Content-Type": "application/json",
      },
      data: body,
      ...(options || {}),
    },
  );
}
