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

export async function orderPage(body) {
    return request('/admin/orders/page', {
        method: 'POST',
        headers: {
            'Content-Type': 'application/json;charset=UTF-8',
        },
        data: body || {},
    });
}

export async function findOrdersTransactionByOrderId(params) {
    return request('/admin/orders/findOrdersTransactionByOrderId', {
        method: 'GET',
        headers: {
            'Content-Type': 'application/json;charset=UTF-8',
        },
        params
    });
}

export async function findOrdersRealtimeDataByOrderId(body) {
    return request('/admin/orders/findOrdersRealtimeDataByOrderId', {
        method: 'POST',
        headers: {
            'Content-Type': 'application/json;charset=UTF-8',
        },
        data: body || {},
    });
}

export async function findOrdersPriceByOrderId(params) {
    return request('/admin/orders/findOrdersPriceByOrderId', {
        method: 'GET',
        headers: {
            'Content-Type': 'application/json;charset=UTF-8',
        },
        params
    });
}

export async function exportExcel(body) {
    return request('/admin/orders/exportExcel', {
        method: 'POST',
        headers: {
            'Content-Type': 'application/json;charset=UTF-8',
        },
        data: body || {},
        responseType: 'blob'
    });
}


export async function refundAmount(body) {
    return request('/admin/orders/refundAmount', {
        method: 'POST',
        headers: {
            'Content-Type': 'application/json;charset=UTF-8',
        },
        data: body || {},
    });
}




export async function findOrdersStatusByOrderId(params) {
    return request('/admin/orders/findOrdersStatusByOrderId', {
        method: 'GET',
        headers: {
            'Content-Type': 'application/json;charset=UTF-8',
        },
        params
    });
}

export async function findOrdersAmountRecordByOrderId(params) {
    return request('/admin/orders/findOrdersAmountRecordByOrderId', {
        method: 'GET',
        headers: {
            'Content-Type': 'application/json;charset=UTF-8',
        },
        params
    });
}

export async function getPriceTemplateSnapshot(params) {
    return request('/admin/orders/getPriceTemplateSnapshot', {
        method: 'GET',
        headers: {
            'Content-Type': 'application/json;charset=UTF-8',
        },
        params
    });
}

export async function stopCharging(data) {
    return request('/admin/orders/stopCharging', {
        method: 'POST',
        headers: {
            'Content-Type': 'application/json;charset=UTF-8',
        },
        data
    });
}


export async function adminCharge(data) {
    return request('/admin/users/wallet/record/adminCharge', {
        method: 'POST',
        headers: {
            'Content-Type': 'application/json;charset=UTF-8',
        },
        data
    });
}

