package com.zhiqiyun;

import com.alibaba.fastjson.JSON;
import com.dliyun.AlgorithmType;
import com.dliyun.DefaultClient;
import com.dliyun.Response;

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

public class TestSdk {
    public static void main(String[] args) throws Exception {
        DefaultClient client = new DefaultClient(
                "http://127.0.0.1:9800/router",
                "220118010121",
                "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCjgdx7EA9femto4A1MXYy1Ycs0ZmqrE1FYqgpEplh0VYbIhhTauXZxxxs07NO7GjL9mCa+WqmSNkZq1/UcqYj3yM7ATyWKDTJUpxoEX9Asr3uyECsRthiq688unhsavcNY54kEjFFXoE/sNnPTkzsbidVgi8gWjbTGUiIOVGTeAQIDAQAB",
                AlgorithmType.RSA
        );
        Map<String, Object> form1 = new HashMap<>();
//        form1.put("userName", "13666666666");
//        form1.put("password", "admin");
        form1.put("accessToken", "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0ZW5hbnRfaWQiOiIxMDQ3ODQiLCJ1c2VyX25hbWUiOiIxMzY2NjY2NjY2NiIsInJlYWxfbmFtZSI6ImFkbWluIiwiYXZhdGFyIjoiIiwiYXV0aG9yaXRpZXMiOlsiYWRtaW4iXSwiY2xpZW50X2lkIjoic2FiZXIiLCJyb2xlX25hbWUiOiJhZG1pbiIsImxpY2Vuc2UiOiJwb3dlcmVkIGJ5IGJsYWRleCIsImFjY291bnRfaWQiOiIxNDg0MTI3ODYwMzI5NDcyMDAxIiwicG9zdF9pZCI6IjE0ODQxMjc4NTk2MzcxNTc4ODkiLCJ1c2VyX2lkIjoiMTQ4NDEyNzg2MDI0MTM5MTYxOCIsInJvbGVfaWQiOiIxNDg0MTI3ODU3MzUxMjYyMjEwIiwic2NvcGUiOlsiYWxsIl0sIm5pY2tfbmFtZSI6ImFkbWluIiwib2F1dGhfaWQiOiIiLCJkZXRhaWwiOnsidHlwZSI6IndlYiJ9LCJleHAiOjE2NDI3NzUwMDIsImRlcHRfaWQiOiIxNDg0MTI3ODU5NjIwMzgwNjc0IiwianRpIjoiMzE5MTQyMTQtMzA2ZS00OGZiLWE1YzYtNWQwMDZmN2YwYjRlIiwiYWNjb3VudCI6IjEzNjY2NjY2NjY2In0.I6J6GFDqjlRY1U9D_NNPDTFFpEa-DoCnF9iuArCwy5o");
//        form1.put("password", "admin");
        Response<Map<String, Object>> response = client.execute("oauth2.user.info", "1.0.0", form1);
        System.out.println(JSON.toJSONString(response));
    }
}
