Created
November 29, 2017 19:33
-
-
Save julianfalcionelli/bb31d4c00b0a669346c7461ff0916483 to your computer and use it in GitHub Desktop.
ExampleNetwork
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
// ------- | |
private IExampleNetwork mIExampleNetwork, mICachedExampleNetwork; | |
ExampleNetwork(RetrofitManager retrofitManager) { | |
mIExampleNetwork = retrofitManager.getRetrofit().create(IExampleNetwork.class); | |
mICachedExampleNetwork = retrofitManager.getCachedRetrofit().create(IExampleNetwork.class); | |
} | |
interface IExampleNetwork { | |
@GET("/api/details") | |
Single<Details> getDetails(@Query("id") String id); | |
} | |
@Override | |
public Single<Details> getDetails(String id) { | |
return mIExampleNetwork.getDetails(id); | |
} | |
@Override | |
public Single<Details> getCachedDetails(String id) { | |
return mICachedExampleNetwork.getDetails(id); | |
} | |
// ------- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment