ru.breffi.storyclmsdk.OAuth.ServiceGenerator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of storyclmsdk Show documentation
Show all versions of storyclmsdk Show documentation
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.
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); }
}