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

import webpath from '@/utils/webPath';

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


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


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


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


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


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


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



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


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


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

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


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


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


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

export async function queryPageForProUserChild(params = {}) {
    return request(`/${webpath.portalwebpath}/web/api/service/prouser/queryPage`, {
        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 getSelectedProUserByProjectId(params = {}) {
    return request(`/${webpath.portalwebpath}/web/api/service/prouserproject/getSelectedProUserByProjectId`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}
