Skip to content

Instantly share code, notes, and snippets.

@ajailani4
Created April 10, 2021 12:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ajailani4/2381c503e8bd30095be32ab14936c045 to your computer and use it in GitHub Desktop.
Save ajailani4/2381c503e8bd30095be32ab14936c045 to your computer and use it in GitHub Desktop.
interface ApiService {
@GET("brands")
suspend fun getBrands(
@Query("page") page: Int,
@Query("limit") limit: Int
): Response<BrandResponse>
@GET("brands/{brandSlug}")
suspend fun getPhones(
@Path("brandSlug") brandSlug: String,
@Query("page") page: Int,
@Query("limit") limit: Int
): Response<PhoneResponse>
@GET("brands/{brandSlug}?limit=5")
suspend fun getPhonesHome(
@Path("brandSlug") brandSlug: String
): Response<PhoneResponse>
@GET("brands/{brandSlug}/{phoneSlug}")
suspend fun getPhoneSpecs(
@Path("brandSlug") brandSlug: String,
@Path("phoneSlug") phoneSlug: String
): Response<PhoneSpecsResponse>
@GET("search")
suspend fun getPhoneSearch(
@Query("query") phoneQuery: String,
@Query("page") page: Int,
@Query("limit") limit: Int
): Response<PhoneSearchResponse>
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment