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

import webpath from '@/utils/webPath';

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

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


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

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


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

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


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


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

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

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

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

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

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

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

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

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

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


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

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

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

