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

import com.tmerclub.cloud.common.vo.ShopSubstituteSalesVO;
import com.tmerclub.cloud.multishop.dto.ShopSubstituteSalesDTO;
import com.moyuer.cloud.systemtest.constants.Constant;
import com.moyuer.cloud.systemtest.util.HttpUtil;
import com.moyuer.cloud.systemtest.util.UrlEnum;

/**
 * @author lpj
 */
public class ShopSubstituteSalesApi {
    /**
     * 获取代销设置详情
     */
    public static ShopSubstituteSalesVO getShopSubstituteSales() {
        String url = Constant.API_URL + "/tmerclub_admin/m/shop_substitute_sales";
        return HttpUtil.get(url, ShopSubstituteSalesVO.class, UrlEnum.SHOP);
    }

    /**
     * 修改代销设置
     */
    public static void updateShopSubstituteSales(ShopSubstituteSalesDTO shopSubstituteSalesDTO, Boolean isMainShop) {
        String url = Constant.API_URL + "/tmerclub_admin/m/shop_substitute_sales";
        if(isMainShop) {
            HttpUtil.put(url, shopSubstituteSalesDTO, UrlEnum.SHOP);
        } else {
            HttpUtil.put(url, shopSubstituteSalesDTO, UrlEnum.SHOP_OTHER);
        }
    }
}
