import request from '@/utils/request';

/**
 * 用户登录
 * @param prams 登录参数
 */
export const userLogin = (params: any) => {
  return request.post('/edu-app/userlogin', {
    requestType: 'form',
    data: params
  });
};

/**
 * 获取用户信息
 * returns user
 */
export const getUserInfo = () => {
  return request.get('/edu-app/user/getUserInfo');
};

/**
 * 老师端修改用户信息
 */
export const api_teacherUpdate = (body: any) => {
  return request.post('/edu-app/teacher/update', { data: body });
};

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

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

/**
 * 获取曲谱分类
 * @returns musicSheetCategories
 */
export const getCategories = (params: any) => {
  return request.post('/edu-app/musicSheetCategories/page', {
    data: params
  });
};

/**
 * 反馈购买未读条数
 * @returns suggestMessageUnread
 */
export const suggestMessageUnread = (params?: any) => {
  return request.get('/edu-app/sysSuggestion/suggestMessageUnread', {
    params
  });
};

/** 曲谱详情 */
export const api_musicSheetDetail = (data: any) => {
  return request.get(`/edu-app/musicSheet/detail/${data}`);
};

/** 获取乐器列表 */
export const api_musicalInstrumentList = (data: any) => {
  return request.post('/edu-app/musicalInstrument/list', {
    data
  });
};

/**
 * @description: 上课记录详情
 * @param params
 */
export const api_cousseScheduleDetail = (id: string) => {
  return request.post('/edu-app/courseSchedule/detail/' + id);
};

/**
 * @description: 标签列表
 * @param params
 */
export const api_musicTagTree = (params?: any) => {
  return request.get('/edu-app/musicTag/tree', {
    params
  });
};

/** 获取所有操作手册 */
export const api_sysTeacherManualPage = (params: any) => {
  return request.post('/edu-app/sysTeacherManual/page', {
    data: params
  });
};

/** 老师操作手册详情 */
export const api_sysTeacherManual_detail = (id: string | number) => {
  return request.get('/edu-app/sysTeacherManual/detail/' + id);
};
