导航菜单

页面标题

页面副标题

bbinstant v6.24.0 - ApiClient.java 源代码

正在查看: bbinstant v6.24.0 应用的 ApiClient.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.adjetter.kapchatsdk.helper;

import java.util.concurrent.TimeUnit;
import okhttp3.OkHttpClient;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

public class ApiClient {
    private static String BASE_URL = "https://bigbasket.kapdesk.com/";
    private static ApiClient apiClient = new ApiClient();
    private static Retrofit retrofit;

    private ApiClient() {
    }

    public static ApiClient getInstance() {
        if (apiClient == null) {
            apiClient = new ApiClient();
        }
        return apiClient;
    }

    public ApiInterface getRetrofitInstance() {
        OkHttpClient.Builder builder = new OkHttpClient.Builder();
        TimeUnit timeUnit = TimeUnit.SECONDS;
        Retrofit build = new Retrofit.Builder().baseUrl(BASE_URL).client(builder.readTimeout(15L, timeUnit).connectTimeout(15L, timeUnit).build()).addConverterFactory(GsonConverterFactory.create()).build();
        retrofit = build;
        return (ApiInterface) build.create(ApiInterface.class);
    }
}