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


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


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


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


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


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


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


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



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


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


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

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


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


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

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

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

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

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

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

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

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

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


