package com.ElyStudio.leGaou.utilities;

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

public class ApiController {

    private static ApiController apiController;
    private static Retrofit retrofit;

    ApiController(){

        retrofit = new Retrofit.Builder()
                .baseUrl(Constants.ADMIN_PANEL_URL)
                .addConverterFactory(GsonConverterFactory.create())
                .build();
    }

    public static synchronized ApiController getInstance(){

        if (apiController==null)
            apiController = new ApiController();
        return apiController;
    }

    public ApiInterface getApi(){

        return retrofit.create(ApiInterface.class);

    }


}
