import { request } from 'umi';
import type { NoticeType, ActivitiesType, AnalysisData } from './data';

/**
 * 【6.4】（教师首页）每日学习时长统计
 * /dsideal_yy/ypt/careerTraining/report/personLearningDayStatistics
 * @param params
 * @returns
 */
export async function personLearningDayStatistics(params: {
  page_size: number;
  //count: number;
}): Promise<{ data: { list: CardListItemDataType[] } }> {
  return request('/dsideal_yy/ypt/careerTraining/report/personLearningDayStatistics', {
    params,
  });
}
/**
 * 【6.5】（教师首页）当前学习主题课程信息
 * /dsideal_yy/ypt/careerTraining/report/personLastLearning
 * @param params
 * @returns
 */
export async function personLastLearning(params: {
  page_size: number;
  //count: number;
}): Promise<{ data: { list: CardListItemDataType[] } }> {
  return request('/dsideal_yy/ypt/careerTraining/report/personLastLearning', {
    params,
  });
}
/**
 * 01 获取教师端考试列表
 *  /dsideal_yy/zygh/training/examination/getExaminationList
 * @param params
 * @returns
 */
export async function getExaminationList(params: {
  page_size: number;
  //count: number;
}): Promise<{ data: { list: CardListItemDataType[] } }> {
  return request(' /dsideal_yy/zygh/training/examination/getExaminationList', {
    params,
  });
}


/**
 * 01 获取教师端考试列表
 *  /dsideal_yy/zygh/training/examination/getPersonExaminationList
 * @param params
 * @returns
 */
export async function getPersonExaminationList(params: {
  page_size: number;
  //count: number;
}): Promise<{ data: { list: CardListItemDataType[] } }> {
  return request(' /dsideal_yy/zygh/training/examination/getPersonExaminationList', {
    params,
  });
}












export async function queryProjectNotice(): Promise<{ data: NoticeType[] }> {
  return request('/api/project/notice');
}

export async function queryActivities(): Promise<{ data: ActivitiesType[] }> {
  return request('/api/activities');
}

/** 折线图 */
export async function fakeChartData(): Promise<{ data: AnalysisData }> {
  // return request('/api/fake_workplace_chart_data');
  return request('/api/fake_analysis_chart_data');
}

export async function getPersonAnswerTime(params: {

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


// 获取人员信息
export async function getExaminationById(params: {
  examination_id: number;
}) {
  return request(' /dsideal_yy/zygh/training/examination/getExaminationById', {
    params,
  });
}
//获取当前时间
export async function getCurrentDate(params: {
  //count: number;
}): Promise<{ data: { list: CardListItemDataType[] } }> {
  return request('/dsideal_yy/zygh/training/examination/getCurrentDate', {
    params,
  });
}
//13 开始考试前获取试卷id
export async function getPersonPaperId(params: {

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