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

import webpath from '@/utils/webPath';

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


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


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


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


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


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


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



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


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


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

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


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


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

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

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

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

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

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

