package com.example.mysmartlab.Model

import com.google.gson.GsonBuilder
import okhttp3.OkHttpClient
import okhttp3.logging.HttpLoggingInterceptor
import retrofit2.Retrofit
import retrofit2.converter.gson.GsonConverterFactory
import retrofit2.converter.scalars.ScalarsConverterFactory
object ApiHttp {

    private val Base_URL = "https://iis.ngknn.ru/NGKNN/МамшеваЮС/MedicMadlab/"
    public var User_mail : String = ""
    public var Bearer : String = ""


    val interceptor = HttpLoggingInterceptor()

    val httpClient = OkHttpClient.Builder()
        .addInterceptor(interceptor)
        .build()
    val gsonBuilder = GsonBuilder()
        .setLenient()
        .create()
    val retrofit = Retrofit.Builder()
        .addConverterFactory(ScalarsConverterFactory.create())
        .addConverterFactory(GsonConverterFactory.create(gsonBuilder))
        .baseUrl(Base_URL)
        .client(httpClient)
        .build()
    val retrifitApi :APIRequest
        get() = retrofit.create(APIRequest::class.java)
}