package com.tmerclub.cloud.systemtest.api.supplier;

import com.tmerclub.cloud.api.delivery.dto.DeliveryOrderDTO;
import com.tmerclub.cloud.common.order.vo.OrderVO;
import com.tmerclub.cloud.order.dto.OrderAddrDTO;
import com.moyuer.cloud.systemtest.constants.Constant;
import com.moyuer.cloud.systemtest.util.HttpUtil;
import com.moyuer.cloud.systemtest.util.UrlEnum;

import java.util.List;

/**
 * @author Tu
 */
public class SupplierOrderApi {
    public static void updateOrderDelivery(OrderAddrDTO orderAddrDTO){
        String url =  Constant.API_URL + "/tmerclub_order/s/order/change_user_addr";
        HttpUtil.put(url,orderAddrDTO, UrlEnum.SUPPLIER);
    }

    public static OrderVO info(Long orderNumber){
        String url =  Constant.API_URL + "/tmerclub_order/s/order/order_info/"+orderNumber;
        return HttpUtil.get(url,OrderVO.class, UrlEnum.SUPPLIER);
    }

    public static void delivery(DeliveryOrderDTO deliveryOrderParam){
        String url = Constant.API_URL + "/tmerclub_order/s/order/delivery";
        HttpUtil.post(url,deliveryOrderParam,UrlEnum.SUPPLIER);
    }

    public static void updateOrderDelivery(List<DeliveryOrderDTO> list){
        String url = Constant.API_URL + "/tmerclub_order/mp/orderDelivery/update";
        HttpUtil.put(url,list,UrlEnum.SUPPLIER);
    }
}
