import service from '@/utils/service'
import miniTypeApi from './mini_type'

const baseUrl = process.env.VUE_APP_HOST + '/manager/api';

const miniApi = {};

miniApi.baseUrl = baseUrl;



miniApi.class_update = data => {
    return service({
        url: `${baseUrl}/miniClass/v1`,
        method: 'put',
        data: data
    })
};

miniApi.type_update = data => {
    return service({
        url: `${baseUrl}/miniType/v1`,
        method: 'put',
        data: data
    })
};

miniApi.result_update = data => {
    return service({
        url: `${baseUrl}/miniResult/v1`,
        method: 'put',
        data: data
    })
};

miniApi.question_update = data => {
    return service({
        url: `${baseUrl}/miniQuestion/v1`,
        method: 'put',
        data: data
    })
};

miniApi.option_update = data => {
    return service({
        url: `${baseUrl}/miniOption/v1`,
        method: 'put',
        data: data
    })
};




miniApi.list = params => {
    return service({
        url: `${baseUrl}/miniClass/list2`,
        method: 'get',
        params: params
    })
};

miniApi.class_list = params => {
    return service({
        url: `${baseUrl}/miniClass/v1/list`,
        method: 'get',
        params: params
    })
};



miniApi.upload_excel = formData => {
    return service({
        url: `${baseUrl}/miniType/v1/upload/excel`,
        method: 'post',
        data: formData
    })
};

miniApi.freshCDN = () =>{
  return service({
    url: `${baseUrl}/miniClass/refresh`,
    method: 'post',
  })
};


export default miniApi
