import { httpAxios } from "@/api/ApiInstance"
import { type pptContentType } from "@/views/components/element/musicResourcesElement"

/**
 * 获取乐理知识 旁边的列表
 */

export const getListKnowledge = () => {
  return httpAxios.axioseRquest({
    method: "post",
    url: "/edu-app/lessonCoursewareDetail/listKnowledge",
    data: {
      type: "COURSEWARE"
    }
  })
}

/**
 * 获取查询配置
 */

export const getKnowledgeWikiCategoryType = (type: Exclude<pptContentType, "THEORY">) => {
  return httpAxios.axioseRquest({
    method: "post",
    url: "/edu-app/knowledgeWikiCategoryType/page",
    data: {
      page: 1,
      rows: 99,
      type
    }
  })
}

/**
 * 获取查询配置
 */

export const getKnowledgeWikiPage = (
  data: { page: number; rows: number; type: string; wikiCategoryId: string },
  abortController: AbortController
) => {
  return httpAxios.axioseRquest({
    signal: abortController.signal,
    method: "post",
    url: "/edu-app/knowledgeWiki/page",
    data
  })
}
