Skip to content

Commit

Permalink
FEAT : 추가 요청 반영
Browse files Browse the repository at this point in the history
  • Loading branch information
re4rk committed Feb 2, 2023
1 parent aab2ce3 commit 8ff34b0
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 66 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.fakedevelopers.presentation.api.di

import com.fakedevelopers.domain.secret.Constants.Companion.BASE_URL
import com.fakedevelopers.presentation.api.util.LoginAuthInterceptor
import com.google.firebase.auth.FirebaseAuth
import com.google.gson.Gson
import com.google.gson.GsonBuilder
Expand All @@ -19,18 +18,10 @@ import java.util.Locale
import javax.inject.Qualifier
import javax.inject.Singleton

@Qualifier
@Retention(AnnotationRetention.BINARY)
annotation class AuthOkHttpClient

@Qualifier
@Retention(AnnotationRetention.BINARY)
annotation class NormalOkHttpClient

@Qualifier
@Retention(AnnotationRetention.BINARY)
annotation class AuthRetrofit

@Qualifier
@Retention(AnnotationRetention.BINARY)
annotation class NormalRetrofit
Expand All @@ -42,22 +33,6 @@ object ApiModule {
@Provides
fun provideBaseUrl() = BASE_URL

@Singleton
@Provides
@AuthOkHttpClient
fun provideAuthOkHttpClient(authInterceptor: LoginAuthInterceptor) = if (BuildConfig.DEBUG.not()) {
val loggingInterceptor = HttpLoggingInterceptor()
loggingInterceptor.setLevel(HttpLoggingInterceptor.Level.HEADERS)
OkHttpClient.Builder()
.addInterceptor(authInterceptor)
.addInterceptor(loggingInterceptor)
.build()
} else {
OkHttpClient.Builder()
.addInterceptor(authInterceptor)
.build()
}

@Singleton
@Provides
@NormalOkHttpClient
Expand All @@ -75,18 +50,6 @@ object ApiModule {
@Provides
fun provideGson(): Gson = GsonBuilder().setLenient().create()

@Singleton
@Provides
@AuthRetrofit
fun provideAuthRetrofit(@AuthOkHttpClient okHttpClient: OkHttpClient, gson: Gson, baseUrl: String): Retrofit {
return Retrofit.Builder()
.client(okHttpClient)
.baseUrl(baseUrl)
.addConverterFactory(ScalarsConverterFactory.create())
.addConverterFactory(GsonConverterFactory.create(gson))
.build()
}

@Singleton
@Provides
@NormalRetrofit
Expand All @@ -107,8 +70,4 @@ object ApiModule {
setLanguageCode(Locale.getDefault().language)
}
}

@Singleton
@Provides
fun provideAuthInterceptor(auth: FirebaseAuth) = LoginAuthInterceptor(auth)
}

This file was deleted.

This file was deleted.

0 comments on commit 8ff34b0

Please sign in to comment.