jeudi 21 juillet 2016

Retrofit with QueryMap

I have some request with the same endpoint but parameter and return type are different.

I used @QueryMap for the parameter but I don't know how to write the return type:

Must I write:

@GET("xxx")
Call<List<A1>> groupList(@QueryMap Map<String, String> options);
@GET("xxx")
Call<List<A2>> groupList(@QueryMap Map<String, String> options);
@GET("xxx")
Call<List<A3>> groupList(@QueryMap Map<String, String> options);
....

or there is a shorter solution?

Aucun commentaire:

Enregistrer un commentaire