import type { ApiResponse } from "@/types/api";

import { request } from "@/utils/request";

/**
 * 获取菜单树
 */
export function getMenuTree(params?: Record<string, unknown>): Promise<ApiResponse<any[]>> {
  return request.get("/sys/menu/tree", { params });
}

/**
 * 新增/编辑菜单
 */
export function saveMenu(data: Record<string, unknown>): Promise<ApiResponse<any>> {
  return request.post("/sys/menu/save", data);
}

/**
 * 删除菜单
 */
export function deleteMenu(id: string): Promise<ApiResponse<any>> {
  return request.post("/sys/menu/delete", { id });
}
