import request from '@/helpers/request';

/** 获取音乐教材列表 */
export const api_lessonCoursewarePage = (params: any): Promise<any> => {
  return request.post('/edu-app/lessonCourseware/page', {
    data: params
  });
};
/** 获取音乐教材收藏列表 */
export const api_lessonCoursewareFavoriteage = (params: any): Promise<any> => {
  return request.post('/edu-app/lessonCoursewareFavorite/page', {
    data: params
  });
};
/** 获取音乐教材课程列表 */
export const api_classLessonCoursewarePage = (params: any): Promise<any> => {
  return request.post('/edu-app/classLessonCourseware/page ', {
    data: params
  });
};
/** 教材收藏 */
export const api_lessonCoursewareFavoriteSave = (params: any): Promise<any> => {
  return request.post('/edu-app/lessonCoursewareFavorite/save', {
    data: params
  });
};
/** 教材收藏取消 */
export const api_lessonCoursewareFavoriteRemove = (
  params: any
): Promise<any> => {
  return request.post('/edu-app/lessonCoursewareFavorite/remove', {
    data: params
  });
};
/** 教材详情 */
export const api_lessonCoursewareDetail = (params: any): Promise<any> => {
  return request.get(`/edu-app/lessonCourseware/detail/${params.id}`, {
    params: params
  });
};

/** 课程教材详情 */
export const api_classLessonCoursewareDetail = (params: any): Promise<any> => {
  return request.get(`/edu-app/classLessonCourseware/detail/${params.id}`, {
    params: params
  });
};

/** 版本教材 */
export const api_tenantInfoDetail = (params: any): Promise<any> => {
  return request.get(`/edu-app/tenantInfo/detail`, {
    params: params
  });
};

export const api_schoolDetail = (params: any): Promise<any> => {
  return request.get(`/edu-app/school/detail`, {
    params: params
  });
};

/**
 * 获取声部列表
 * returns subjects
 */
export const api_subjectList = (params: any) => {
  return request.post('/edu-app/subject/page', {
    data: params
  });
};

/** 课件章节详情（全部教材） */
export const api_lessonDetailCourseware = (params: any) => {
  return request.post('/edu-app/lessonCoursewareKnowledgeDetail/detailCourseware', {
    data: params
  });
};

/** 课件章节详情（课程教材） */
export const api_classDetailCourseware = (params: any) => {
  return request.post('/edu-app/classLessonCourseware/classKnowledge', {
    data: params
  });
};

/** 检测教材是否存在 */
export const api_coursewareCheckUpdate = (params: any) => {
  return request.get('/edu-app/classLessonCourseware/checkUpdate/' + params.id);
};


/** 查询版本 */
export const api_bookVersionPage = (params: any) => {
  return request.post('/edu-app/bookVersion/page', {
    data: params
  })
}
