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

import com.alibaba.fastjson2.JSON;
import com.tmerclub.cloud.api.supplier.vo.SupplierApiRefundAddrVO;
import com.tmerclub.cloud.supplier.dto.SupplierRefundAddrDTO;
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 SupplierRefundAddrApi {
    public static Long addSupplierRefundAddr(SupplierRefundAddrDTO supplierRefundAddrDTO){
        String url = Constant.API_URL +"/tmerclub_admin/mp/supplier_refund_addr";
        return JSON.parseArray(JSON.toJSONString(HttpUtil.post(url,supplierRefundAddrDTO, UrlEnum.SUPPLIER,Long.class)),Long.class).get(0);
    }

    public static List<SupplierApiRefundAddrVO> listSupplierRefundAddr(){
        String url = Constant.API_URL +"/tmerclub_admin/mp/supplier_refund_addr/list";
        return JSON.parseArray(JSON.toJSONString(HttpUtil.get(url,List.class, UrlEnum.SUPPLIER)),SupplierApiRefundAddrVO.class);
    }
}
