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


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


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


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


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


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


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


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



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


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


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

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


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


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

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