diff options
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/facebook/retro/IFrost.kt')
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/facebook/retro/IFrost.kt | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/facebook/retro/IFrost.kt b/app/src/main/kotlin/com/pitchedapps/frost/facebook/retro/IFrost.kt deleted file mode 100644 index b9048fe0..00000000 --- a/app/src/main/kotlin/com/pitchedapps/frost/facebook/retro/IFrost.kt +++ /dev/null @@ -1,36 +0,0 @@ -package com.pitchedapps.frost.facebook.retro - -import com.pitchedapps.frost.facebook.token -import com.pitchedapps.frost.utils.L -import okhttp3.ResponseBody -import retrofit2.Call -import retrofit2.Callback -import retrofit2.Response -import retrofit2.http.GET -import retrofit2.http.Query - -/** - * Created by Allan Wang on 2017-05-30. - */ -interface IFrost { - - @GET("me") - fun me(): Call<ResponseBody> - - -} - -fun <T> Call<T>.enqueueFrost(success: (call: Call<T>, response: Response<T>) -> Unit) { - this.enqueue(object : Callback<T> { - override fun onFailure(call: Call<T>?, t: Throwable?) { - L.e("Frost enqueue error") - } - - override fun onResponse(call: Call<T>, response: Response<T>) { - if (response.isSuccessful && !call.isCanceled) - success.invoke(call, response) - else - L.e("Frost response received but not successful") - } - }) -}
\ No newline at end of file |