package com.fdkankan.platform.util;

import com.fdkankan.platform.order.constant.OrderEnum;
import com.fdkankan.platform.user.vo.ResponseOrder;

import java.util.List;

public class ResultConvertUtil {

    public static void getOrderList(List<ResponseOrder> orderList) {
        for (ResponseOrder order : orderList) {
            order.setOrderStatus("completed");
            switch (order.getPaymentTypeName()){
                case 1 :  order.setPaymentStatus(OrderEnum.PaymentStatus.paid.name());    break;
                case -2 : order.setPaymentStatus(OrderEnum.PaymentStatus.refunded.name());break;
                default:  order.setPaymentStatus(OrderEnum.PaymentStatus.unpaid.name());  break;
            }
        }
    }

}
