package com.search.supersearch.cube;


import com.search.supersearch.util.HttpClientUtils;

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

public class TokenUtil {
    private static final String clientId = "UZ81v8EYVWSckt787x0eQvIyTXVVGx4RHKVQ5riZ";
    private static final String clientSecret = "cZXylKpqgLoVHFSIeKZWJlTMBixQDN6n2HPvpeX2VFLPZqkt66PnSFtmA3Ad7OKi3ZIuY1rFjmFVd9DPYqj3WKiHcEQhcCNfrNllaUMPMnHTlN7qyiln2f15lepzRW31";
    private static final String serverUrl = "http://cube2.smartdot.com:18000";
    private static final String tokenUrl = serverUrl + "/o/token/";
    private static final String projectId = "31";

    public static String getToken() {
        Map<String, String> parameters = new HashMap<>();
        parameters.put("client_id", clientId);
        parameters.put("client_secret", clientSecret);
        parameters.put("grant_type", "client_credentials");
        parameters.put("scope", "review");

        String tokenResult = HttpClientUtils.getResponseUplod(tokenUrl, parameters);
        System.out.println(tokenResult);
        return null;
    }


}
