import http from '@/http/http.js'
const request = http.request
const urlType='market'

export function getConfig(data) {
    return request({
        url: `${urlType}/admin/distribution`,
        method: "GET",
        data: {
            ...data
        }
    })
}


export function editConfig(data) {
    return request({
        url: `${urlType}/admin/distribution`,
        method: "PUT",
        data: {
            ...data
        }
    })
}

export function moneyRecoders(data) {
    return request({
        url: `${urlType}/admin/distribution/flow`,
        method: "GET",
        data: {
            ...data
        }
    })
}
export function cashPay(data) {
    return request({
        url: `${urlType}/admin/distribution/cashPay`,
        method: "POST",
        data: {
            ...data
        }
    })
}
export function openFlow(data) {
    return request({
        url: `${urlType}/admin/distribution/openFlow`,
        method: "GET",
        data: {
            ...data
        }
    })
}
export function distributionFlow(data) {
    return request({
        url: `${urlType}/admin/distribution/distributionFlow`,
        method: "GET",
        data: {
            ...data
        }
    })
}
export function rechargeQrCode(data) {
    return request({
        url: `${urlType}/admin/distribution/rechargeQrCode`,
        method: "GET",
        data: {
            ...data
        }
    })
}
export function withdrawFlow(data) {
    return request({
        url: `${urlType}/admin/distribution/withdrawFlow`,
        method: "GET",
        data: {
            ...data
        }
    })
}

export function distributionUser(data) {
    return request({
        url: `${urlType}/admin/distribution/user`,
        method: "GET",
        data: {
            ...data
        }
    })
}

export function addDistributionUser(data) {
    return request({
        url: `${urlType}/admin/distribution/user`,
        method: "POST",
        data: {
            ...data
        }
    })
}

export function editDistributionUser(data) {
    return request({
        url: `${urlType}/admin/distribution/user`,
        method: "PUT",
        data: {
            ...data
        }
    })
}

export function deleteDistributionUser(data) {
    return request({
        url: `${urlType}/admin/distribution/user`,
        method: "DELETE",
        data: {
            ...data
        }
    })
}

export function inviteUser(data) {
    return request({
        url: `${urlType}/admin/distribution/user/inviteUser`,
        method: "GET",
        data: {
            ...data
        }
    })
}

export function resetLevel(data) {
    return request({
        url: `${urlType}/admin/distribution/user/resetLevel`,
        method: "POST",
        data: {
            ...data
        }
    })
}
