edwardwongtl
12/10/2018, 8:28 AM{
"error": 0,
"err_msg": "",
"users": [ ... ],
}
{
"error": 0,
"err_msg": "",
"movies": [ ... ],
}
The part that is common is the error
and err_msg
fields, other than that, the json-key and value can vary depending on which server api I call.
I think the way to go is a custom Adapter with @FromJson fun fromJson(reader: JsonReader): Result<T>
, but I’m struggling on the <T>
part..dave08
12/10/2018, 9:32 AMedwardwongtl
12/10/2018, 9:52 AM