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

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

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

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

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




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

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


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


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



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

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


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

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

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

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


