package org.dromara.zhishu.util;

import com.pdd.pop.sdk.common.util.JsonUtil;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class NewTaskUtils {

    public static String newTaskPost(String taskId,String shopId,List bodyList){
        Map requestShopDataMap = new HashMap();
        requestShopDataMap.put("shopId",shopId);
        requestShopDataMap.put("data", JsonUtil.transferToJson(bodyList));
        String shopDataListStr = InterfaceUtils.postForm("http://119.45.237.193:14008","/shopGoods/getShopGoods",requestShopDataMap);
        //      String shopDataListStr = InterfaceUtils.postForm("http://localhost:18099","/shopGoods/getShopGoods",requestShopDataMap);
        List shopDataList = JsonUtil.transferToObj(shopDataListStr,List.class);
        String response = InterfaceUtils.postTaskBodyWithSign(UrlUtil.getNewTaskUrl(), "/task/setTaskBody", taskId.toString(), shopDataList);
        System.out.println("新发布任务发布"+bodyList.size()+"条"+";查询后数据："+shopDataList.size()+"条");
        return response;
    }
}
