liuyu
2 小时以前 82a74ba0402ab546ba524d23ce62198c4d00d2f7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import type { ExamPaperView, ExamScoreDetail, ExamScorePageQuery } from '#/views/x/tms/examScore/types';
 
import { defHttp } from '#/api/request';
import {
  mockGetExamPaperView,
  mockGetExamScoreDetail,
  mockQueryExamScores,
} from '#/views/x/tms/examScore/mock';
 
/** 后端未就绪前走 mock;联调后改为 false */
const USE_MOCK = true;
const prefix = '/api/tms/exam-score';
 
export function getExamScoreList(params: ExamScorePageQuery) {
  if (USE_MOCK) return mockQueryExamScores(params);
  return defHttp.get({ url: `${prefix}/list`, params });
}
 
export function getExamScoreDetail(id: string) {
  if (USE_MOCK) return mockGetExamScoreDetail(id);
  return defHttp.get<ExamScoreDetail>({ url: `${prefix}/${id}` });
}
 
export function getExamPaperView(examId: string) {
  if (USE_MOCK) return mockGetExamPaperView(examId);
  return defHttp.get<ExamPaperView>({ url: `${prefix}/paper/${examId}` });
}