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

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

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


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

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

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

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