inject networker into data service
This commit is contained in:
@ -31,5 +31,8 @@ object AppModule {
|
||||
|
||||
@Singleton
|
||||
@Provides
|
||||
fun provideDataService(@ApplicationContext app: Context) = DataService(app)
|
||||
fun provideDataService(
|
||||
@ApplicationContext app: Context,
|
||||
networker: Networker
|
||||
) = DataService(app, networker)
|
||||
}
|
||||
|
||||
@ -2,11 +2,13 @@ package app.omnivore.omnivore
|
||||
|
||||
import android.content.Context
|
||||
import androidx.room.Room
|
||||
import app.omnivore.omnivore.networking.Networker
|
||||
import app.omnivore.omnivore.persistence.AppDatabase
|
||||
import javax.inject.Inject
|
||||
|
||||
class DataService @Inject constructor(
|
||||
context: Context
|
||||
context: Context,
|
||||
private val networker: Networker
|
||||
) {
|
||||
val db = Room.databaseBuilder(
|
||||
context,
|
||||
|
||||
@ -12,7 +12,7 @@ import app.omnivore.omnivore.persistence.entities.ViewerDao
|
||||
Viewer::class,
|
||||
SavedItem::class
|
||||
],
|
||||
version = 1
|
||||
version = 2
|
||||
)
|
||||
abstract class AppDatabase : RoomDatabase() {
|
||||
abstract fun viewerDao(): ViewerDao
|
||||
|
||||
Reference in New Issue
Block a user