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

/** 创建素材分类 POST /operation/createMaterialCategory */
export async function createMaterialCategory(
  body: BusinessAPI.CategoryCreateCmd,
  options?: { [key: string]: any },
) {
  return request<BusinessAPI.SingleResponseCategoryVO>(
    "/operation/createMaterialCategory",
    {
      method: "POST",
      headers: {
        "Content-Type": "application/json",
      },
      data: body,
      ...(options || {}),
    },
  );
}

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

/** 素材分类 GET /operation/showMaterialCategory */
export async function showMaterialCategory(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: BusinessAPI.showMaterialCategoryParams,
  options?: { [key: string]: any },
) {
  return request<BusinessAPI.SingleResponseCategoryVO>(
    "/operation/showMaterialCategory",
    {
      method: "GET",
      params: {
        ...params,
        categoryShowQry: undefined,
        ...params["categoryShowQry"],
      },
      ...(options || {}),
    },
  );
}

/** 素材分类树 GET /operation/treeMaterialCategory */
export async function treeMaterialCategory(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: BusinessAPI.treeMaterialCategoryParams,
  options?: { [key: string]: any },
) {
  return request<BusinessAPI.MultiResponseTreeLong>(
    "/operation/treeMaterialCategory",
    {
      method: "GET",
      params: {
        ...params,
        categoryTreeQry: undefined,
        ...params["categoryTreeQry"],
      },
      ...(options || {}),
    },
  );
}

/** 更新素材分类 PUT /operation/updateMaterialCategory */
export async function updateMaterialCategory(
  body: BusinessAPI.CategoryUpdateCmd,
  options?: { [key: string]: any },
) {
  return request<BusinessAPI.SingleResponseCategoryVO>(
    "/operation/updateMaterialCategory",
    {
      method: "PUT",
      headers: {
        "Content-Type": "application/json",
      },
      data: body,
      ...(options || {}),
    },
  );
}

/** 更新素材分类 PATCH /operation/updateMaterialCategory */
export async function updateMaterialCategory1(
  body: BusinessAPI.CategoryUpdateCmd,
  options?: { [key: string]: any },
) {
  return request<BusinessAPI.SingleResponseCategoryVO>(
    "/operation/updateMaterialCategory",
    {
      method: "PATCH",
      headers: {
        "Content-Type": "application/json",
      },
      data: body,
      ...(options || {}),
    },
  );
}
