import request from "@/utils/request";

// 获取章节
export const getSubjectChapterList = (params) =>
  request({
    url: "/sc/subjectChapter/tree",
    params,
  });

// 获取知识点
export const getSubjectKnowledgeList = (params) =>
  request({
    url: "/sc/subjectKnowledge/tree",
    params,
  });

// 获取试卷类型
export const getPaperTypeList = (params) =>
  request({
    url: "/sc/subjectPaper/getPaperType",
    params,
  });

// 获取试卷年级
export const getPaperStageList = (params) =>
  request({
    url: "/sc/subjectPaper/getPaperStage",
    params,
  });

// 获取题型
export const getSubjectStageChannelType = (params) =>
  request({
    url: "/sc/subjectStageChannelType/tree",
    params,
  });

// 获取学科
export const getStageSubjectVoList = (params) =>
  request({
    url: "/sc/stage/getStageSubjectVoList",
    params,
  });

// 获取题目
export const getSubjectTitleList = (params) =>
  request({
    url: "/sc/subjectTitle/list",
    params,
  });

// 获取解析
export const getSubjectTitleAnalyze = (params) =>
  request({
    url: "/sc/subjectTitle/getAnalyse",
    params,
  });

// 更新题目收藏状态
export const updateSubjectTitleCollect = (data) =>
  request({
    url: "/sc/subjectTitleCollect",
    method: "post",
    data,
  });

// 更新试卷收藏状态
export const updateSubjectPaperCollect = (data) =>
  request({
    url: "/sc/subjectPaperCollect",
    method: "post",
    data,
  });

// 同步解析
export const syncPaperAnalyze = (data) =>
  request({
    url: "/sc/subjectPaper/syncAnalyse",
    method: "post",
    data,
  });

// 完成组卷
export const savePaper = (data) =>
  request({
    url: "/sc/subjectPaper/composePaper",
    method: "post",
    data,
  });

// 获取试卷列表
export const getSubjectPaperList = (params) =>
  request({
    url: "/sc/subjectPaper/list",
    params,
  });

// 获取试卷分析
export const getPaperAnalyzeById = (id) =>
  request({
    url: `/sc/subjectPaper/getPaperAnalyzeById/${id}`,
  });

// 根据试题内容获取试卷分析
export const getPaperAnalyzeByContent = (data) =>
  request({
    url: "/sc/subjectPaper/getPaperAnalyze",
    method: "post",
    data,
  });

// 获取试卷详情
export const getSubjectPaperById = (id) =>
  request({
    url: `/sc/subjectPaper/${id}`,
  });
