import axios, { AxiosResponse } from 'axios';
import {
  ScoreListPageParam,
  ScoreListFilter,
  ScoreListPageRes,
} from './types/score';

// 获取成绩列表
export function getScoreList(
  params: ScoreListPageParam
): Promise<ScoreListPageRes> {
  return axios.post('/api/admin/exam/score/list', params);
}

// 导出成绩
export function exportScore(
  params: ScoreListFilter
): Promise<AxiosResponse<Blob>> {
  return axios.post('/api/admin/exam/score/export', params, {
    responseType: 'blob',
  });
}
