import service from '@/utils/request'


// 获取兑换码库列表
export const mkList = (params) => {
    return service({
        url: '/cdk/mk/list',
        method: 'get',
        params
    })
}

// 新增兑换码库
export const addMk = (data) => {
    return service({
        url: '/cdk/mk',
        method: 'post',
        data
    })
}

// 编辑兑换码库
export const editMk = (data) => {
    return service({
        url: '/cdk/mk',
        method: 'put',
        data
    })
}


// 删除兑换码库
export const delMk = (data) => {
    return service({
        url: '/cdk/mk',
        method: 'delete',
        data
    })
}

// 获取兑换码库详情
export const mkDetail = (params) => {
    return service({
        url: '/cdk/mk',
        method: 'get',
        params
    })
}

// 导出兑换码库
export const exportMk = (params) => {
    return service({
        url: '/cdk/mk/excel',
        method: 'get',
        params,
        responseType: 'blob'
    })
}


// =======================CDK相关===========================

// 获取兑换码列表
export const cdkList = (params) => {
    return service({
        url: '/cdk/list',
        method: 'get',
        params
    })
}


// 新增兑换码
export const addCdk = (data) => {
    return service({
        url: '/cdk/generate',
        method: 'post',
        data
    })
}

// 作废兑换码
export const delCdk = (data) => {
    return service({
        url: '/cdk',
        method: 'delete',
        data
    })
}

