-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug fix
- Loading branch information
Showing
8 changed files
with
112 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package com.gcorp.retrofithelperexample | ||
open class T3 { | ||
var id: String = "pashm" | ||
var name: String = "pashm" | ||
var isComplete: Boolean = false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 0 additions & 44 deletions
44
retrofithelper/src/main/java/com/gcorp/retrofithelper/MySubscriber.kt
This file was deleted.
Oops, something went wrong.
8 changes: 5 additions & 3 deletions
8
retrofithelper/src/main/java/com/gcorp/retrofithelper/Response.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
package com.gcorp.retrofithelper | ||
|
||
import android.util.Log | ||
import com.google.gson.Gson | ||
import retrofit2.Response | ||
|
||
class Response<T>(response: Response<T>) { | ||
var header = response.headers().toMultimap() | ||
var body = response.body() | ||
class Response<T>(response: Response<T>, classOfT: Class<T>) { | ||
var header: MutableMap<String, MutableList<String>>? = response.headers().toMultimap() | ||
var body = Gson().fromJson<T>(response.body().toString(), classOfT) | ||
var code = response.code() | ||
var raw: okhttp3.Response? = response.raw() | ||
|
||
} |
Oops, something went wrong.