Skip to content

Commit

Permalink
#178 [feat] ApiModule 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
murjune committed Aug 11, 2022
1 parent cf4eb1d commit abf40f9
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 52 deletions.
32 changes: 32 additions & 0 deletions app/src/main/java/com/hous/hous_aos/di/ApiModule.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package com.hous.hous_aos.di

import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import retrofit2.Retrofit
import javax.inject.Singleton

@Module
@InstallIn(SingletonComponent::class)
object ApiModule {
@Provides
@Singleton
fun provideHomeService(retrofit: Retrofit): com.hous.data.api.HomeApi =
retrofit.create(com.hous.data.api.HomeApi::class.java)

@Provides
@Singleton
fun provideRulesService(retrofit: Retrofit): com.hous.data.api.RulesApi =
retrofit.create(com.hous.data.api.RulesApi::class.java)

@Provides
@Singleton
fun provideProfileService(retrofit: Retrofit): com.hous.data.api.ProfileApi =
retrofit.create(com.hous.data.api.ProfileApi::class.java)

@Provides
@Singleton
fun provideNewRulesApi(retrofit: Retrofit): com.hous.data.api.NewRulesApi =
retrofit.create(com.hous.data.api.NewRulesApi::class.java)
}
24 changes: 2 additions & 22 deletions app/src/main/java/com/hous/hous_aos/di/NetworkModule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import java.util.concurrent.TimeUnit
import javax.inject.Singleton
import okhttp3.Interceptor
import okhttp3.OkHttpClient
import okhttp3.logging.HttpLoggingInterceptor
import retrofit2.Retrofit
import retrofit2.converter.gson.GsonConverterFactory
import java.util.concurrent.TimeUnit
import javax.inject.Singleton

@Module
@InstallIn(SingletonComponent::class)
Expand Down Expand Up @@ -71,24 +71,4 @@ object NetworkModule {
)
)
.build()

@Provides
@Singleton
fun provideHomeService(retrofit: Retrofit): com.hous.data.api.HomeApi =
retrofit.create(com.hous.data.api.HomeApi::class.java)

@Provides
@Singleton
fun provideRulesService(retrofit: Retrofit): com.hous.data.api.RulesApi =
retrofit.create(com.hous.data.api.RulesApi::class.java)

@Provides
@Singleton
fun provideProfileService(retrofit: Retrofit): com.hous.data.api.ProfileApi =
retrofit.create(com.hous.data.api.ProfileApi::class.java)

@Provides
@Singleton
fun provideNewRulesApi(retrofit: Retrofit): com.hous.data.api.NewRulesApi =
retrofit.create(com.hous.data.api.NewRulesApi::class.java)
}
9 changes: 0 additions & 9 deletions domain/src/main/java/com/hous/domain/model/Category.kt

This file was deleted.

6 changes: 0 additions & 6 deletions domain/src/main/java/com/hous/domain/model/DayData.kt

This file was deleted.

15 changes: 0 additions & 15 deletions domain/src/main/java/com/hous/domain/model/Homie.kt

This file was deleted.

0 comments on commit abf40f9

Please sign in to comment.