Created
April 22, 2020 20:59
-
-
Save cdmunoz/8ee85cb3c675cb31059b6b91312eef84 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
interface ApiService { | |
@GET("photos") | |
suspend fun getPhotos(@Query("sol") sol: Int, @Query("api_key") apiKey: String, @Query("page") page: Int): Response<PhotosResponse>? | |
} | |
object RetrofitService { | |
var client: OkHttpClient = OkHttpClient.Builder().build() | |
private var retrofit = Retrofit.Builder().baseUrl(BuildConfig.BASE_URL) | |
.addConverterFactory(GsonConverterFactory.create()).client(client).build() | |
fun <T> createService(serviceClass: Class<T>): T = retrofit.create(serviceClass) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment