import request from "@/utils/request";
import {BASE_URL} from '@/config';



//获取考试列表
export const getExamList = (params) => {
    return request({
        method: 'get',
        url: `${BASE_URL}/exam-data/common/getAllExams`,
        params,
    });
};

//创建考试
export const addExamList = (data) => {
    return request({
        method: 'post',
        url: `${BASE_URL}/exam-data/upload_v2/createExam`,
        data,
    });
};


//获取考试
export const getExam = (params) => {
    return request({
        method: 'get',
        url: `${BASE_URL}/exam-data/common/getExam`,
        params
    });
};

//修改考试
export const updateExam = (data) => {
    return request({
        method: 'post',
        url: `${BASE_URL}/exam-data/upload_v2/updateExam`,
        data,
    });
};

//获取考试计算文件名
export const getExamFileName =  (params) => {
    return request({
        method: 'get',
        url: `${BASE_URL}/exam-data/upload_v2/getExamFile`,
        params,
    });
};


//上传考试计算文件

export const uploadFile =  (data) => {
    return request({
        method: 'post',
        url: `${BASE_URL}/exam-data/upload_v2/createSubjectDetail`,
        headers: { 'Content-Type': 'multipart/form-data' },
        data,
    });
};


// 开始计算考试
export const  startComputeExam = (params) => {
    return request({
        method: 'get',
        url: `${BASE_URL}/exam-data/cal_v2/calExam`,
        params,
    });
}

// 重新计算考试
export const  afreshComputeExam = (params) => {
    return request({
        method: 'get',
        url: `${BASE_URL}/exam-data/upload_v2/reCalExam`,
        params,
    });
}

// 删除考试
export const  deleteExam = (params) => {
    return request({
        method: 'get',
        url: `${BASE_URL}/exam-data/cal_v2/delExam`,
        params,
    });
}



// 获取编辑描述
export const  getExamDescription = (params) => {
    return request({
        method: 'get',
        url: `${BASE_URL}/exam-data/base/getExamDescription`,
        params,
    });
}


// 获取分数线列表
export const  getScoreLineList = (params) => {
    return request({
        method: 'get',
        url: `${BASE_URL}/score/page`,
        params,
    });
}

// 保存分数线
export const  saveScoreLine = (data) => {
    return request({
        method: 'post',
        url: `${BASE_URL}/score/edit`,
        data,
    });
}
// 删除分数线
export const deleteScoreLine = (data) => {
    return request({
        method: 'post',
        url: `${BASE_URL}/score/delete`,
        data,
    });
}