import request from '@/utils/request';

/**
 * 备课 - 教学课件
 */
export const lessonCoursewarePage = (params: any) => {
  return request.post('/edu-app/lessonCourseware/page', {
    data: params
  });
};

/**
 * 备课 - 教学课件详情
 */
export const lessonCoursewareDetail = (params: any) => {
  return request.get('/edu-app/lessonCourseware/detail/' + params.id, {
    params: params
  });
};

/**
 * 备课 - 教学课件删除
 */
export const lessonCoursewareRemove = (params: any) => {
  return request.post('/edu-app/lessonCourseware/remove', {
    requestType: 'form',
    data: params
  });
};

/**
 * 备课 - 课件列表
 */
export const queryCourseware = (params: any) => {
  return request.post('/edu-app/teacherKnowledgeMaterial/queryCourseware', {
    data: params
  });
};

/**
 * 备课 - 保存课件
 */
export const saveCourseware = (params: any) => {
  return request.post('/edu-app/teacherKnowledgeMaterial/saveCourseware', {
    data: params
  });
};
/**
 * 备课 - 删除课件
 */
export const teacherKnowledgeMaterialDelete = (params: any) => {
  return request.post('/edu-app/teacherKnowledgeMaterial/delete', {
    requestType: 'form',
    data: params
  });
};

/**
 * 备课 - 训练列表
 */
export const lessonPreTrainingPage = (params: any) => {
  return request.post('/edu-app/lessonPreTraining/page', {
    data: params
  });
};

/**
 * 备课 - 新增训练
 */
export const lessonPreTrainingAdd = (params: any) => {
  return request.post('/edu-app/lessonPreTraining/add', {
    data: params
  });
};

/**
 * 备课 - 修改训练
 */
export const lessonPreTrainingUpdate = (params: any) => {
  return request.post('/edu-app/lessonPreTraining/update', {
    data: params
  });
};

/**
 * 备课 - 删除训练
 */
export const lessonPreTrainingDelete = (params: any) => {
  return request.post('/edu-app/lessonPreTraining/delete?ids=' + params.ids, {
    data: params
  });
};

/**
 * 备课 - 保存预训练曲目
 */
export const lessonPreTrainingBatchSave = (params: any) => {
  return request.post('/edu-app/lessonPreTraining/batchSave', {
    data: params
  });
};

/**
 * 备课 - 乐谱列表
 */
export const musicSheetPage = (params: any) => {
  return request.post('/edu-app/musicSheet/page', {
    data: params
  });
};

/**
 * 备课 - 班级列表
 */
export const classGroupPage = (params: any) => {
  return request.post('/edu-app/classGroup/page', {
    data: params
  });
};

/**
 * 备课 - 布置作业
 */
export const lessonTrainingAdd = (params: any) => {
  return request.post('/edu-app/lessonTraining/add', {
    data: params
  });
};

/**
 * 备课 - 开始上课
 */
export const courseScheduleStart = (params: any) => {
  return request.post('/edu-app/courseSchedule/start', {
    data: params
  });
};

/**
 * 备课 - 音乐教材版本
 */
export const bookVersionPage = (params?: any) => {
  return request.post('/edu-app/bookVersion/page', {
    data: params
  });
};
/**
 * 备课 - 使用课件打标记
 */
export const tagUseCourseware = (params?: any) => {
  return request.post('/edu-app/teacherKnowledgeMaterial/tagUseCourseware', {
    requestType: 'form',
    data: params
  });
};
/**
 * 备课 - 更新上课记录
 */
export const courseScheduleUpdate = (params?: any) => {
  return request.post('/edu-app/courseSchedule/update', {
    data: params
  });
};

/**
 * 评测详情
 */
export const musicPracticeRecordDetail = (params: any) => {
  return request.get('/edu-app/musicPracticeRecord/detail/' + params.id, {
    params: params
  });
};

/**
 * 预设作业列表
 */
export const lessonPreTrainingV2Page = (params: any) => {
  return request.post('/edu-app/lessonPreTrainingV2/page', {
    data: params
  });
};

/**
 * 预设作业 添加/修改
 */
export const lessonPreTrainingV2Save = (params: any) => {
  return request.post('/edu-app/lessonPreTrainingV2/save', {
    data: params
  });
};

/**
 * 预设作业 删除
 */
export const lessonPreTrainingV2Remove = (params: any) => {
  return request.post('/edu-app/lessonPreTrainingV2/remove', {
    data: params,
    requestType: 'form'
  });
};

/**
 * 预设作业 详情
 */
export const lessonPreTrainingV2Detail = (params: any) => {
  return request.get('/edu-app/lessonPreTrainingV2/detail/' + params.id);
};

/**
 * 课件列表
 */
export const teacherChapterLessonCoursewareList = (params: any) => {
  return request.post('/edu-app/teacherChapterLessonCourseware/list', {
    data: params
  });
};

/**
 * 课件 修改信息
 */
export const api_updateCoursewareInfo = (params: any) => {
  return request.post(
    '/edu-app/teacherChapterLessonCourseware/updateCoursewareInfo',
    {
      data: params
    }
  );
};

/**
 * 课件 查询公开课件列表
 */
export const api_queryOpenCoursewareByPage = (params: any) => {
  return request.post(
    '/edu-app/teacherChapterLessonCourseware/queryOpenCoursewareByPage',
    {
      data: params
    }
  );
};

/**
 * 课件 新增公开课件到我的课件
 */
export const api_addByOpenCourseware = (params: any) => {
  return request.post(
    '/edu-app/teacherChapterLessonCourseware/addByOpenCourseware',
    {
      data: params
    }
  );
};

/**
 * 课件 新增课件
 */
export const api_teacherChapterLessonCoursewareAdd = (params: any) => {
  return request.post('/edu-app/teacherChapterLessonCourseware/add', {
    data: params
  });
};

/**
 * 课件 删除我的课件
 */
export const api_teacherChapterLessonCoursewareRemove = (params: any) => {
  return request.post(
    '/edu-app/teacherChapterLessonCourseware/remove?id=' + params.id,
    {
      requestType: 'form'
    }
  );
};

/**
 * 课件 修改我的课件
 */
export const api_teacherChapterLessonCoursewareUpdate = (params: any) => {
  return request.post('/edu-app/teacherChapterLessonCourseware/update', {
    data: params
  });
};

/**
 * 课件 课件详情
 */
export const api_teacherChapterLessonCoursewareDetail = (id: string) => {
  return request.get('/edu-app/teacherChapterLessonCourseware/detail/' + id);
};

/**
 * 平台课件转老师课件
 */
export const api_coursewareToTeacherCourseware = (id: string) => {
  return request.post(
    '/edu-app/teacherChapterLessonCourseware/coursewareToTeacherCourseware',
    {
      data: { id }
    }
  );
};

/**
 *  @description: 素材详情
 * @param params
 */
export const api_materialDetail = (id: string) => {
  return request.get('/edu-app/material/detail/' + id);
};

/**
 *  @description: 老师查询教材分类
 * @param params
 */
export const api_lessonCoursewareTeacherCategory = () => {
  return request.get('/edu-app/lessonCourseware/teacherCategory');
};

/**
 *  @description: 备课页面检测声部
 * @param params
 */
export const api_courseScheduleCheck = (params: {
  classGroupId: string;
  chapterLessonCoursewareId: string;
}) => {
  return request.post('/edu-app/courseSchedule/check', {
    data: params
  });
};

/** 标签-所有 */
export const api_chapterLessonCoursewareTag_queryAll = (
  params?: any
): Promise<any> => {
  return request.post('/edu-app/chapterLessonCoursewareTag/queryAll', {
    data: params
  });
};
