File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
data/src/release/java/com/dkin/chevit/data/di Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ import okhttp3.MediaType.Companion.toMediaType
1818import okhttp3.OkHttpClient
1919import retrofit2.Converter
2020import retrofit2.Retrofit
21+ import javax.inject.Named
2122
2223@Module
2324@InstallIn(SingletonComponent ::class )
@@ -61,6 +62,15 @@ internal object NetworkModule {
6162 .addInterceptor(tokenInterceptor)
6263 .build()
6364
65+ @Provides
66+ @Singleton
67+ @Named(" Pure" )
68+ fun providePureOkHttpClient () = OkHttpClient .Builder ()
69+ .connectTimeout(20 , TimeUnit .SECONDS )
70+ .readTimeout(20 , TimeUnit .SECONDS )
71+ .writeTimeout(20 , TimeUnit .SECONDS )
72+ .build()
73+
6474 @Provides
6575 @Singleton
6676 fun provideRetrofit (
@@ -71,4 +81,16 @@ internal object NetworkModule {
7181 .addConverterFactory(jsonConverter)
7282 .baseUrl(BuildConfig .API_URL )
7383 .build()
84+
85+ @Provides
86+ @Singleton
87+ @Named(" Pure" )
88+ fun providePureRetrofit (
89+ @Named(" Pure" ) okHttpClient : OkHttpClient ,
90+ @JsonConverter jsonConverter : Converter .Factory ,
91+ ): Retrofit = Retrofit .Builder ()
92+ .client(okHttpClient)
93+ .addConverterFactory(jsonConverter)
94+ .baseUrl(BuildConfig .API_URL )
95+ .build()
7496}
You can’t perform that action at this time.
0 commit comments