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

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

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

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

/** 获取OSS上传凭证 GET /operation/ossToken */
export async function ossToken(options?: { [key: string]: any }) {
  return request<BusinessAPI.SingleResponseOssTokenVO>("/operation/ossToken", {
    method: "GET",
    ...(options || {}),
  });
}

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

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

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

/** 素材内容更新 PATCH /operation/updateMaterial */
export async function updateMaterial1(
  body: BusinessAPI.MaterialUpdateCmd,
  options?: { [key: string]: any },
) {
  return request<BusinessAPI.SingleResponseMaterialVO>(
    "/operation/updateMaterial",
    {
      method: "PATCH",
      headers: {
        "Content-Type": "application/json",
      },
      data: body,
      ...(options || {}),
    },
  );
}
