import http from "@/util/http.js";

// 店铺管理页面请求

// 店铺平台
export function shopListId() {
    return http({
        url: "/api/shop_platforms",
        method: "get",
    });
}
// 店铺新增
export function shopAdd(data) {
    return http({
        url: "/api/shops",
        method: "post",
        data,
    });
}
// 店铺列表
export function storeList(params) {
    return http({
        url: "/api/shops",
        method: "get",
        params,
    });
}

// 下载商品
export function downloadGoods(id) {
    return http({
        url: `/api/download/${id}/goods`,
        method: "get",
    });
}

export function updateStore(id, params) {
    return http({
        url: `/api/shops/${id}`,
        method: "patch",
        params,
    });
}

export function syncStoreStock(params) {
    return http({
        url: '/api/sync/shop/stock',
        method: "put",
        params,
    });
}

export function shipList() {
    return http({
        url: '/api/shop/ship',
        method: 'get',
    })
}

export function ShopSenderList(shopId, shopShipId) {
    return http({
        url: '/api/shop/ship/senders',
        method: 'get',
        params: {
            'shop_id': shopId,
            'shop_ship_id': shopShipId,
        }
    })
}

export function saveSenders(params) {
    return http({
        url: '/api/shop/ship/senders',
        method: 'post',
        params
    })
}

export function orderRest(params) {
    return http({
        url: '/api/order/reset',
        method: 'get',
    })
}
