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

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

/** 菜单更新 DELETE /operation/destroyMenu */
export async function destroyMenu(
  body: BusinessAPI.MenuDestroyCmd,
  options?: { [key: string]: any },
) {
  return request<BusinessAPI.Response>("/operation/destroyMenu", {
    method: "DELETE",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}

/** 菜单拖拽 POST /operation/dragMenu */
export async function dragMenu(
  body: BusinessAPI.MenuDragCmd,
  options?: { [key: string]: any },
) {
  return request<BusinessAPI.Response>("/operation/dragMenu", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}

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

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

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

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

/** 菜单更新 PATCH /operation/updateMenu */
export async function updateMenu1(
  body: BusinessAPI.MenuUpdateCmd,
  options?: { [key: string]: any },
) {
  return request<BusinessAPI.SingleResponseMenuVO>("/operation/updateMenu", {
    method: "PATCH",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}
