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

/** 创建产品 POST /operation/createProduct */
export async function createProduct(
  body: BusinessAPI.ProductCreateCmd,
  options?: { [key: string]: any },
) {
  return request<BusinessAPI.SingleResponseProductVO>(
    "/operation/createProduct",
    {
      method: "POST",
      headers: {
        "Content-Type": "application/json",
      },
      data: body,
      ...(options || {}),
    },
  );
}

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

/** 产品拖拽排序 PUT /operation/dragProduct */
export async function dragProduct(
  body: BusinessAPI.ProductDragCmd,
  options?: { [key: string]: any },
) {
  return request<BusinessAPI.Response>("/operation/dragProduct", {
    method: "PUT",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}

/** 产品拖拽排序 PATCH /operation/dragProduct */
export async function dragProduct1(
  body: BusinessAPI.ProductDragCmd,
  options?: { [key: string]: any },
) {
  return request<BusinessAPI.Response>("/operation/dragProduct", {
    method: "PATCH",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}

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

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

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

/** 产品更新 PUT /operation/updateProduct */
export async function updateProduct(
  body: BusinessAPI.ProductUpdateCmd,
  options?: { [key: string]: any },
) {
  return request<BusinessAPI.SingleResponseProductVO>(
    "/operation/updateProduct",
    {
      method: "PUT",
      headers: {
        "Content-Type": "application/json",
      },
      data: body,
      ...(options || {}),
    },
  );
}

/** 产品更新 PATCH /operation/updateProduct */
export async function updateProduct1(
  body: BusinessAPI.ProductUpdateCmd,
  options?: { [key: string]: any },
) {
  return request<BusinessAPI.SingleResponseProductVO>(
    "/operation/updateProduct",
    {
      method: "PATCH",
      headers: {
        "Content-Type": "application/json",
      },
      data: body,
      ...(options || {}),
    },
  );
}
