import { request } from 'umi';
import type { CardListItemDataType } from './data.d';

/**
 * 【6.5】（教师首页）当前学习主题课程信息
 *  /dsideal_yy/ypt/careerTraining/learning/listMyLearningSubject
 * @param params
 * @returns
 */
export async function listMyLearningSubject(params: {
  page_size: number;
  //count: number;
}): Promise<{ data: { list: CardListItemDataType[] } }> {
  return request('/dsideal_yy/ypt/careerTraining/learning/listMyLearningSubject', {
    params,
  });
}
/**
 * 【6.5】（教师首页）当前学习主题课程信息
 *  /dsideal_yy/ypt/careerTraining/learning/listMyLearningSubject
 * @param params
 * @returns
 */
export async function getRulesList(params: {
  page_size: number;
  //count: number;
}): Promise<{ data: { list: CardListItemDataType[] } }> {
  return request('/dsideal_yy/zygh/training/rules/getRulesList', {
    params,
  });
}
/**
 * 05 组卷详情查询
 * /dsideal_yy/zygh/training/rules/getRulesPaper
 * @param params
 * @returns
 */
export async function getRulesPaper(params: {
  page_size: number;
  //count: number;
}): Promise<{ data: { list: CardListItemDataType[] } }> {
  return request('/dsideal_yy/zygh/training/rules/getRulesPaper', {
    params,
  });
}
/**
 * 14 保存考试结果，返回当前得分
 * /dsideal_yy/zygh/training/person/finishExamination
 * @param params
 * @returns
 */

export async function finishExamination(
  params: ParamsType,
): Promise<{ data: { list: BasicListItemDataType[] } }> {
  return request('/dsideal_yy/zygh/training/person/finishExamination', {
    method: 'POST',
    requestType: 'form',
    data: {
      ...params,
    },
  });
}






/**
 * 06 获取试卷内容
 * /dsideal_yy/zygh/training/rules/getPaperQuestionList
 * @param params
 * @returns
 */
export async function getPaperQuestionList(params: {
  page_size: number;
  //count: number;
}): Promise<{ data: { list: CardListItemDataType[] } }> {
  return request('/dsideal_yy/zygh/training/rules/getPaperQuestionList', {
    params,
  });
}

export async function viewMyLearningSubject(params: {
  identity_id: number;
  person_id: number;
  data_id: number;
  data_type: number;
  subject_id: number
}) {
  return request(' /dsideal_yy/ypt/careerTraining/learning/viewMyLearningSubject', {
    params,
  });
}

export async function listMyLearningChapterCourse(params: {
  chapter_id: number;
  identity_id: number;
  person_id: number;
  subject_id: number
}) {
  return request(' /dsideal_yy/ypt/careerTraining/learning/listMyLearningChapterCourse', {
    params,
  });
}

export async function getCourseExaminationProgressList(params: {
  chapter_id: number;
  identity_id: number;
  person_id: number;
  subject_id: number
}) {
  return request('/dsideal_yy/zygh/training/mock/getCourseExaminationProgressList', {
    params,
  });
}

//13 开始考试前获取试卷id
export async function getPersonPaperId(params: {

}): Promise<{ data: { list: CardListItemDataType[] } }> {
  return request(' /dsideal_yy/zygh/training/person/getPersonPaperId', {
    params,
  });
}

//获取准考证号
export async function getExaminationPersonApplyInfo(params: {

}): Promise<{ data: { list: CardListItemDataType[] } }> {
  return request('/dsideal_yy/zygh/training/person/getExaminationPersonApplyInfo', {
    params,
  });
}
