@ -17,7 +17,7 @@
package com.google.samples.apps.nowinandroid.core.network.retrofit
import com.google.samples.apps.nowinandroid.core.network.BuildConfig
import com.google.samples.apps.nowinandroid.core.network.Ni A Network
import com.google.samples.apps.nowinandroid.core.network.Ni a Network
import com.google.samples.apps.nowinandroid.core.network.model.NetworkAuthor
import com.google.samples.apps.nowinandroid.core.network.model.NetworkChangeList
import com.google.samples.apps.nowinandroid.core.network.model.NetworkNewsResource
@ -37,7 +37,7 @@ import retrofit2.http.Query
/ * *
* Retrofit API declaration for NIA Network API
* /
private interface RetrofitNi A NetworkApi {
private interface RetrofitNi a NetworkApi {
@GET ( value = " topics " )
suspend fun getTopics (
@Query ( " id " ) ids : List < String > ? ,
@ -69,10 +69,10 @@ private interface RetrofitNiANetworkApi {
) : List < NetworkChangeList >
}
private const val Ni A BaseUrl = BuildConfig . BACKEND _URL
private const val Ni a BaseUrl = BuildConfig . BACKEND _URL
/ * *
* Wrapper for data provided from the [ Ni A BaseUrl]
* Wrapper for data provided from the [ Ni a BaseUrl]
* /
@Serializable
private data class NetworkResponse < T > (
@ -80,15 +80,15 @@ private data class NetworkResponse<T>(
)
/ * *
* [ Retrofit ] backed [ Ni A Network]
* [ Retrofit ] backed [ Ni a Network]
* /
@Singleton
class RetrofitNi A Network @Inject constructor (
class RetrofitNi a Network @Inject constructor (
networkJson : Json
) : Ni A Network {
) : Ni a Network {
private val networkApi = Retrofit . Builder ( )
. baseUrl ( Ni A BaseUrl)
. baseUrl ( Ni a BaseUrl)
. client (
OkHttpClient . Builder ( )
. addInterceptor (
@ -101,7 +101,7 @@ class RetrofitNiANetwork @Inject constructor(
)
. addConverterFactory ( networkJson . asConverterFactory ( " application/json " . toMediaType ( ) ) )
. build ( )
. create ( RetrofitNi A NetworkApi:: class . java )
. create ( RetrofitNi a NetworkApi:: class . java )
override suspend fun getTopics ( ids : List < String > ? ) : List < NetworkTopic > =
networkApi . getTopics ( ids = ids ) . data