import axios from 'axios';

import {
  ScoreSegmentListRes,
  TotalAnalysisListRes,
  CollegeAnalysisListParam,
  CollegeAnalysisListRes,
  TeacherAnalysisListParam,
  TeacherAnalysisListRes,
  ClassAnalysisListParam,
  ClassAnalysisListRes,
  QuestionAnalysisListParam,
  QuestionAnalysisListRes,
  BigQuestionAnalysisListRes,
  ScoreSegmentListParam,
  AnalysisListPageParam,
} from './types/analysis';

// 总量分析列表
export function getTotalAnalysisList(
  params: AnalysisListPageParam
): Promise<TotalAnalysisListRes> {
  return axios.post('/api/analysis/total', {}, { params });
}

// 分段统计列表
export function getSegmentAnalysisList(
  params: ScoreSegmentListParam
): Promise<ScoreSegmentListRes> {
  return axios.post('/api/analysis/segment', {}, { params });
}

// 学院分析列表
export function getCollegeAnalysisList(
  params: CollegeAnalysisListParam
): Promise<CollegeAnalysisListRes> {
  return axios.post('/api/analysis/college', {}, { params });
}

// 任课老师分析列表
export function getTeacherAnalysisList(
  params: TeacherAnalysisListParam
): Promise<TeacherAnalysisListRes> {
  return axios.post('/api/analysis/teacher', {}, { params });
}

// 班级分析列表
export function getClassAnalysisList(
  params: ClassAnalysisListParam
): Promise<ClassAnalysisListRes> {
  return axios.post('/api/analysis/class', {}, { params });
}

// 客观题分析列表
export function getObjectiveQuestionAnalysisList(
  params: QuestionAnalysisListParam
): Promise<QuestionAnalysisListRes> {
  return axios.post('/api/analysis/question', {}, { params });
}

// 主观题分析列表
export function getSubjectiveQuestionAnalysisList(
  params: QuestionAnalysisListParam
): Promise<QuestionAnalysisListRes> {
  return axios.post('/api/analysis/question', {}, { params });
}

// 大题分析列表
export function getBigQuestionAnalysisList(
  params: AnalysisListPageParam
): Promise<BigQuestionAnalysisListRes> {
  return axios.post('/api/analysis/big-question', {}, { params });
}
