import { stringify } from 'qs';
import { request } from 'umi';
import webpath from '@/utils/webPath';


export async function deleteByPrimaryKeyForXdc(params = {}) {
    return request(`/${webpath.zngfserverpath}/web/api/service/xdc/delete?${stringify(params)}`);
}


export async function selectByPrimaryKeyForXdc(params = {}) {
    return request(`/${webpath.zngfserverpath}/web/api/service/xdc/get?${stringify(params)}`);
}


export async function insertForXdc(params = {}) {
    return request(`/${webpath.zngfserverpath}/web/api/service/xdc/insert`, {
        method: 'POST',
        data: {
            ...params,
            method: 'insert',
        },
    });
}


export async function updateForXdc(params = {}) {
    return request(`/${webpath.zngfserverpath}/web/api/service/xdc/update`, {
        method: 'POST',
        data: {
            ...params,
            method: 'update',
        },
    });
}


export async function deleteByMapForXdc(params = {}) {
    return request(`/${webpath.zngfserverpath}/web/api/service/xdc/deleteByMap`, {
        method: 'POST',
        data: {
            ...params,
            method: 'delete',
        },
    });
}


export async function updateByMapForXdc(params = {}) {
    return request(`/${webpath.zngfserverpath}/web/api/service/xdc/updateByMap`, {
        method: 'POST',
        data: {
            ...params,
            method: 'update',
        },
    });
}


export async function getOneForXdc(params = {}) {
    return request(`/${webpath.zngfserverpath}/web/api/service/xdc/getOne`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}



export async function getAllForXdc(params = {}) {
    return request(`/${webpath.zngfserverpath}/web/api/service/xdc/getAll`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}


export async function queryPageForXdc(params = {}) {
    return request(`/${webpath.zngfserverpath}/web/api/service/xdc/queryPage`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}


export async function countForXdc(params = {}) {
    return request(`/${webpath.zngfserverpath}/web/api/service/xdc/count`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}

export async function insertBatchForXdc(params = {}) {
    return request(`/${webpath.zngfserverpath}/web/api/service/xdc/insertBatch`, {
        method: 'POST',
        data: {
            ...params,
            method: 'insert',
        },
    });
}


export async function deleteBatchForXdc(params = {}) {
    return request(`/${webpath.zngfserverpath}/web/api/service/xdc/deleteBatch`, {
        method: 'POST',
        data: {
            ...params,
            method: 'delete',
        },
    });
}


export async function updateBatchForXdc(params = {}) {
    return request(`/${webpath.zngfserverpath}/web/api/service/xdc/updateBatch`, {
        method: 'POST',
        data: {
            ...params,
            method: 'update',
        },
    });
}