All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.authing.sdk.java.client.BaseClient Maven / Gradle / Ivy

There is a newer version: 3.1.10
Show newest version
package cn.authing.sdk.java.client;

import cn.authing.sdk.java.model.AuthingClientOptions;
import cn.authing.sdk.java.model.AuthingRequestConfig;
import cn.authing.sdk.java.util.JsonUtils;
import cn.authing.sdk.java.model.Receiver;

/**
 * @author luojielin
 */
public class BaseClient {

    protected AuthingClientOptions options;

    public BaseClient(AuthingClientOptions options) {
        this.options = options;
    }

    public static  T deserialize(String content, Class valueType) {
         return JsonUtils.deserialize(content, valueType);
    }

    public static String serialize(Object value) {
        return JsonUtils.serialize(value);
    }

    public String request(AuthingRequestConfig config) {
        return options.doRequest(config.getUrl(), config.getMethod(), config.getHeaders(), config.getBody());
    }

    public void subEvent(String eventCode, Receiver receiver){
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy