package com.liquidnet.service.goblin.test;

import com.liquidnet.common.third.zxlnft.biz.ZxlnftBiz;
import com.liquidnet.commons.lang.util.CollectionUtil;
import com.liquidnet.commons.lang.util.HttpUtil;
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;

/**
 * @author AnJiabin <anjiabin@zhengzai.tv>
 * @version V1.0
 * @Description: TODO
 * @class: TestHttpUtil
 * @Package com.liquidnet.service.goblin.test
 * @Copyright: LightNet @ Copyright (c) 2022
 * @date 2022/7/18 16:42
 */
@Slf4j
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest
public class TestHttpUtil {
    @Autowired
    private ZxlnftBiz zxlnftBiz;
    @Test
    public void testHttp(){
//        LinkedMultiValueMap<String, String> headersMap = CollectionUtil.linkedMultiValueMapStringString();
//        headersMap.add("Authorization", "APPCODE ".concat("1111"));
        LinkedMultiValueMap<String, String> paramsMap = CollectionUtil.linkedMultiValueMapStringString();
        paramsMap.add("identifyNum", "1111");
        paramsMap.add("mobile", "12222");
        paramsMap.add("userName", "12222");
////        paramsMap.add("identifyNum", cardNo);
////        paramsMap.add("mobile", mobile);
////        paramsMap.add("userName", realName);

        MultiValueMap<String, String> commonHeader = new LinkedMultiValueMap();
        zxlnftBiz.buildHeader(commonHeader);

        MultiValueMap<String, String> params = new LinkedMultiValueMap();
        params.add("addressList", "ZXb8602b785235f89aaa6cc4dc2df800d4490079c2");


        String rs =  HttpUtil.get("https://nfttest2.zxinchain.com/api/v1/nft/identity/bind/query", params, commonHeader);
//        String rs =  HttpUtil.get("https://nfttest2.zxinchain.com/api/v1/nft/identity/bind/query?addressList=ZXb8602b785235f89aaa6cc4dc2df800d4490079c2", params, commonHeader);
        System.out.println("结果==="+rs);
    }
}
