api refactored and cleaned

This commit is contained in:
2021-08-31 16:28:06 +03:00
parent b09ae2049c
commit cb25112e83
7 changed files with 23 additions and 86 deletions
@@ -1,6 +1,5 @@
package com.meloda.fast.api.network
import android.util.Log
import com.meloda.fast.api.VKException
import okhttp3.Request
import okio.IOException
@@ -76,7 +75,6 @@ internal class ResultCall<T>(proxy: Call<T>) : CallDelegate<T, Answer<T>>(proxy)
private val callback: Callback<Answer<T>>
) : Callback<T> {
// TODO: 8/31/2021 parse VK errors
override fun onResponse(call: Call<T>, response: Response<T>) {
val result: Answer<T> = if (response.isSuccessful)
Answer.Success(response.body() as T)
@@ -1,21 +0,0 @@
package com.meloda.fast.api.network.request
import com.google.gson.annotations.SerializedName
class RequestMessagesGetConversations(
@SerializedName("offset")
private val offset: Int = 0,
@SerializedName("count")
private val count: Int = 0,
//values = all, unread
@SerializedName("filter")
private val filter: String = "",
@SerializedName("extended")
private val extended: Boolean = false,
@SerializedName("fields")
private var fields: String = ""
)
@@ -0,0 +1 @@
package com.meloda.fast.api.network.response
@@ -1,13 +0,0 @@
package com.meloda.fast.api.network.response
import android.os.Parcelable
import kotlinx.parcelize.Parcelize
class MessagesResponse(
val count: Int
) {
}
@Parcelize
data class GetConversationsResponse(val a: String) : Parcelable
// TODO: 7/12/2021 use hilt for this like in LIR and make simple conversations' screen