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

ru.breffi.storyclmsdk.OAuth.ServiceGenerator Maven / Gradle / Ivy

Go to download

StoryCLM — a digital-platform developed by BREFFI, allowing you to create interactive presentations with immediate feedback on the change in the customer perception of the brand and the representative’s activity.

There is a newer version: 1.0.5
Show newest version
package ru.breffi.storyclmsdk.OAuth;

import java.util.concurrent.TimeUnit;

import okhttp3.OkHttpClient;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

public class ServiceGenerator {
	private static final String BASE_URL = "https://auth.storyclm.com/";

  /*  private static Retrofit.Builder builder =
            new Retrofit.Builder()
                    .baseUrl(BASE_URL)
                    .addConverterFactory(GsonConverterFactory.create());
*/
	
	
	private static Retrofit retrofit = null;
    private static Retrofit getRetrofit (){
    	return (retrofit!=null)?
    				retrofit:
    					(retrofit=new Retrofit.Builder()
    					.baseUrl(BASE_URL)
		    		    .addConverterFactory(GsonConverterFactory.create())
		    		    .client(
		    		    		new OkHttpClient.Builder()
		    	    	        .readTimeout(60, TimeUnit.SECONDS)
		    	    	        .connectTimeout(60, TimeUnit.SECONDS)
		    	    	        .build()
		    	    	)
		    		    .build());
    }


    public static  S createService(Class serviceClass) {     
    	
    	
    	
    	
    	return getRetrofit().create(serviceClass);    }
}