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


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


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


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


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


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


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


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



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


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


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

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


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


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