Retrofit service 2
package com.example.retrofit2 import android.content.Context import android.util.Log import com.jakewharton.retrofit2.adapter.kotlin.coroutines.CoroutineCallAdapterFactory import com.kaopiz.kprogresshud.KProgressHUD import kotlinx.coroutines.CoroutineExceptionHandler import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch import okhttp3.OkHttpClient import okhttp3.ResponseBody import org.json.JSONObject import retrofit2.Response import retrofit2.Retrofit import retrofit2.converter.gson.GsonConverterFactory import java.util.concurrent.TimeUnit class RetrofitService() { private var kProgressHUD: KProgressHUD? = null lateinit var context: Context fun callService( mContext: Context, dialogFlag: Boolean, token: String, requestProcessor: RetrofitResponse ) { try { context = mContext if (dialogFlag) { createProgressBar(mContext) } ...