Skip to content

Commit

Permalink
[add]: provideResultCallAdapterFactory 메서드 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
kangyuri1114 committed Jan 2, 2025
1 parent bd97926 commit 1ec4536
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import com.hmh.hamyeonham.common.qualifier.Secured
import com.hmh.hamyeonham.common.qualifier.Unsecured
import com.hmh.hamyeonham.core.network.auth.authenticator.HMHAuthenticator
import com.hmh.hamyeonham.core.network.auth.interceptor.HeaderInterceptor
import com.hmh.hamyeonham.core.network.call.CustomResultCallAdapterFactory
import com.hmh.hamyeonham.core.network.call.ResultCallAdapterFactory
import com.jakewharton.retrofit2.converter.kotlinx.serialization.asConverterFactory
import dagger.Binds
import dagger.Module
Expand Down Expand Up @@ -88,13 +88,17 @@ object NetModule {
.writeTimeout(15, TimeUnit.SECONDS)
.build()

@Singleton
@Provides
fun provideResultCallAdapterFactory(): ResultCallAdapterFactory = ResultCallAdapterFactory()

@Singleton
@Provides
@Secured
fun provideRetrofit(
@Secured client: OkHttpClient,
converterFactory: Converter.Factory,
resultCallAdapterFactory: CustomResultCallAdapterFactory,
resultCallAdapterFactory: ResultCallAdapterFactory,
): Retrofit = Retrofit.Builder()
.baseUrl(HMHBaseUrl)
.client(client)
Expand All @@ -108,7 +112,7 @@ object NetModule {
fun provideRetrofitNotNeededAuth(
@Unsecured client: OkHttpClient,
converterFactory: Converter.Factory,
resultCallAdapterFactory: CustomResultCallAdapterFactory,
resultCallAdapterFactory: ResultCallAdapterFactory,
): Retrofit = Retrofit.Builder()
.baseUrl(HMHBaseUrl)
.client(client)
Expand Down

0 comments on commit 1ec4536

Please sign in to comment.