import request from "../utils/request";

/** 获取学生信息 */
export const studentQueryUserInfo = async () => {
  return await request.get(`/student/queryUserInfo`);
};
/** 获取老师信息 */
export const teacherQueryUserInfo = () => {
  return request.get(`/user/getUserInfo`);
};
/** 创建曲谱 */
export const api_musicSheetCreationSave = (data: any) => {
  return request.post(`/musicSheetCreation/save`, { data, requestType: "json" });
};
/** 曲谱列表 */
export const api_musicSheetCreationPage = (data: any) => {
  return request.post(`/musicSheetCreation/page`, { data, requestType: "json" });
};
/** 删除曲谱 */
export const api_musicSheetCreationRemove = (id: any, delMusicSheet: number) => {
  return request.post(`/musicSheetCreation/remove?id=${id}&delMusicSheet=${delMusicSheet}`);
};
/** 曲谱详情 */
export const api_musicSheetCreationDetail = (data: any) => {
  return request.get(`/musicSheetCreation/detail/${data}`);
};
/** 曲谱更新 */
export const api_musicSheetCreationUpdate = (data: any) => {
  return request.post(`/musicSheetCreation/update`, { data, requestType: "json" });
};
/** 声部 */
export const api_subjectList = () => {
  return request.post(`/subject/list`);
};

/** 导入xml */
export const api_xmlToAbc = (data: any) => {
  return request.post(`/musicSheetCreation/xmlToAbc`, {
    requestType: "form",
    data: data,
  });
};
/** 创建曲谱 */
export const api_musicSheetCreationSaveMusic = (data: any) => {
  return request.post(`/musicSheetCreation/saveMusic`, {
    data: data,
    requestType: "json",
  });
};
/** wav转mp3 */
export const api_musicSheetCreationWav2mp3 = (data: any) => {
  return request.get(`/musicSheetCreation/wav2mp3?url=` + data);
};

/** 添加曲谱转换 */
export const api_musicalScoreConversionRecordSave = (data: any) => {
  return request.post("/musicalScoreConversionRecord/save", {
    data: data,
    requestType: "json",
  });
};

/** 曲谱转换列表 */
export const api_musicalScoreConversionRecordPage = (data: any) => {
  return request.post("/musicalScoreConversionRecord/page", {
    data: data,
    requestType: "json",
  });
};
/** 曲谱转换删除 */
export const api_musicalScoreConversionRecordRemove = (data: any) => {
  return request.post("/musicalScoreConversionRecord/remove?id=" + data);
};
