Skip to content

Instantly share code, notes, and snippets.

@CostaFot
Created February 17, 2019 23:37
Show Gist options
  • Save CostaFot/9fb43a92fce47b38cf38909822defb5b to your computer and use it in GitHub Desktop.
Save CostaFot/9fb43a92fce47b38cf38909822defb5b to your computer and use it in GitHub Desktop.
This is where the GET is located
class CatsDataSource(retrofit: Retrofit) {
private val api: CatsApi = retrofit.create(CatsApi::class.java)
fun getNumberOfRandomCats(limit: Int, category_ids: Int?) =
api.getNumberOfRandomCats(limit, category_ids)
interface CatsApi {
@GET("images/search")
fun getNumberOfRandomCats(@Query("limit") limit: Int, @Query("category_ids") category_ids: Int?): Single<List<NetCat>>
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment