import type { AxiosResponse } from "axios";
import httpClient from "./httpClient";
import * as knowledgeGraphClient from "@/client/knowledgeGraph.client"
import type { Response } from "@/types/response.types";
import type { SubjectNode, Property, Request } from "@/types/knowledgeGraph.types";

/**
 * 根据学科ID查询学科属性
 * @param id 学科ID
 * @returns 学科属性
 */
export function fetchProperty(id: number): Promise<AxiosResponse<Response<Property>>> {
  return httpClient.get(`/knowledgeGraph/property/${id}`);
}

export async function find(request: Request): Promise<SubjectNode[]> {
  return knowledgeGraphClient.find(request)
}
