Skip to content

Commit

Permalink
Update RepositoryModule.kt
Browse files Browse the repository at this point in the history
  • Loading branch information
mutukuian committed May 13, 2024
1 parent 8dcad06 commit cc131cd
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ import com.example.kocelainterview.data.repository.SearchControllerRepositoryImp
import com.example.kocelainterview.data.repository.ShipRepositoryImpl
import com.example.kocelainterview.domain.repository_interface.SearchControllerRepository
import com.example.kocelainterview.domain.repository_interface.ShipRepository
import android.content.Context
import androidx.room.Room
import dagger.hilt.android.qualifiers.ApplicationContext
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
Expand All @@ -28,6 +31,16 @@ object RepositoryModule {
return database.shipDao()
}

@Provides
@Singleton
fun provideShipDatabase(@ApplicationContext context: Context): ShipDatabase {
return Room.databaseBuilder(
context.applicationContext,
ShipDatabase::class.java,
"ship_database"
).build()
}

@Provides
@Singleton
fun providesSearchControllerRepository(api: ShipsApi):SearchControllerRepository{
Expand Down

0 comments on commit cc131cd

Please sign in to comment.