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

import com.alibaba.fastjson2.JSON;
import com.tmerclub.cloud.api.multishop.vo.ShopRefundAddrVO;
import com.tmerclub.cloud.multishop.dto.ShopRefundAddrDTO;
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 ShopRefundAddrApi {
    public static Long addShopRefundAddr(ShopRefundAddrDTO shopRefundAddrDTO){
        String url = Constant.API_URL +"/tmerclub_admin/mp/refundAddr";
        return JSON.parseArray(JSON.toJSONString(HttpUtil.post(url,shopRefundAddrDTO, UrlEnum.SHOP,Long.class)),Long.class).get(0);
    }

    public static List<ShopRefundAddrVO> listShopRefundAddr(){
        String url = Constant.API_URL +"/tmerclub_admin/mp/refundAddr/list";
        return JSON.parseArray(JSON.toJSONString(HttpUtil.get(url,List.class, UrlEnum.SHOP)),ShopRefundAddrVO.class);
    }
}
