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


export async function deleteByPrimaryKeyForWordFile(params = {}) {
    return request(`/${webpath.portalwebpath}/web/api/service/wordfile/delete?${stringify(params)}`);
}


export async function selectByPrimaryKeyForWordFile(params = {}) {
    return request(`/${webpath.portalwebpath}/web/api/service/wordfile/get?${stringify(params)}`);
}


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


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


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


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


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



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


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


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

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


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


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

// 获取新建文件模版地址
export async function getCreateFilePathForWps(params = {}) {
    return request(`/${webpath.portalwebpath}/web/api/service/wordfile/createTemplateFile`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}

// 获取新建文件模版地址
export async function getViewUrlDbPathForWps(params = {}) {
    return request(`/${webpath.portalwebpath}/web/api/service/wordfile/getViewUrlDbPath`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}

// 获取web预览文件地址
export async function getViewUrlWebPathForWps(params = {}) {
    return request(`/${webpath.portalwebpath}/web/api/service/wordfile/getViewUrlWebPath`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}

// 获取转换文件
export async function convertForWps(params = {}) {
    return request(`/${webpath.portalwebpath}/web/api/service/wordfile/convert`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}

// 获取转换文件
export async function getConvertForWps(params = {}) {
    return request(`/${webpath.portalwebpath}/web/api/service/wordfile/getConvert`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}
