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

import com.tmerclub.cloud.api.delivery.dto.DeliveryOrderDTO;
import com.tmerclub.cloud.api.delivery.vo.DeliveryOrderFeignVO;
import com.tmerclub.cloud.common.order.vo.OrderVO;
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 lpj
 */
public class ScoreOrderApi {
    public static OrderVO getScoreOrderItemAndAddress(Long orderNumber){
        String url = Constant.API_URL+"/tmerclub_order/mp/order/order_item_and_address/"+orderNumber;
        return HttpUtil.get(url, OrderVO.class, UrlEnum.PLATFORM);
    }

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

    public static List<DeliveryOrderFeignVO> infoOrderDelivery(Long orderNumber){
        String url = Constant.API_URL+"/tmerclub_order/mp/orderDelivery/info?orderId="+orderNumber;
        List<DeliveryOrderFeignVO> deliveryOrderFeignVos = HttpUtil.get(url, List.class,UrlEnum.PLATFORM);
        return deliveryOrderFeignVos;
    }

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