import request from '@/helpers/request';

/**
 * 学员分页
 * @param data
 * @returns
 */
export const api_studentManageUserPage = (data: any) => {
  return request.post('/api-web/studentManage/userPage', {
    data
  });
};

/**
 * 学校端-人数统计
 * @param data
 * @returns
 */
export const api_studentManageUserCount = (data: any) => {
  return request.post('/api-web/studentManage/userCount', {
    data
  });
};

/**
 * 获取声部列表
 * @param data
 * @returns
 */
export const api_studentManageCoopSubjectList = (musicGroupId?: string) => {
  return request.post('/api-web/studentManage/coopSubjectList', {
    params: { musicGroupId }
  });
};

/**
 * 合作单位的乐团
 * @returns
 */
export const api_cooperationOrganMusicGroupPage = () => {
  return request.get('/api-web/cooperationOrgan/musicGroupPage');
};

/** 学校端-学员详情 */
export const api_studentManageUserDetail = (data: any) => {
  return request.post('/api-web/studentManage/userDetail', { data });
};
/**
 * 学校端-学生所在乐团
 * @param studentId 学生ID
 * @returns
 */
export const api_studentManageUserMusicGroup = (studentId: string) => {
  return request.post('/api-web/studentManage/userMusicGroup', {
    params: { studentId }
  });
};

/**
 * 获取用户所在分部的年级列表
 * @param organId 机构ID
 * @returns
 */
export const api_organizationGetGradeList = (
  organId: string | number,
  gradeType: string
) => {
  return request.get('/api-web/organization/getGradeList', {
    params: { organId, gradeType }
  });
};

/**
 * 学校端-修改学员班级信息
 * @param data 
 * @returns 
 */
export const api_studentManageUpdateGrade = (data: any) => {
  return request.post('/api-web/studentManage/updateGrade', { data });
};

/**
 * 申请退团
 * @param data 
 * @returns 
 */
export const api_studentManageQuitMusicGroup = (data: any) => {
  return request.post('/api-web/schoolMusicGroupQuit/quitMusicGroup', { data, requestType: 'form' });
};
