feat: add DatabaseModule for plant disease detection feature
This commit is contained in:
parent
b6f232f655
commit
42d9ff8510
|
|
@ -0,0 +1,20 @@
|
||||||
|
package com.syaroful.agrilinkvocpro.plant_disease_detection_feature.di
|
||||||
|
|
||||||
|
import androidx.room.Room
|
||||||
|
import com.syaroful.agrilinkvocpro.plant_disease_detection_feature.data.local.database.AppDatabase
|
||||||
|
import com.syaroful.agrilinkvocpro.plant_disease_detection_feature.data.repository.PlantDiagnosisLocalRepository
|
||||||
|
import org.koin.dsl.module
|
||||||
|
|
||||||
|
val databaseModule = module {
|
||||||
|
single {
|
||||||
|
Room.databaseBuilder(
|
||||||
|
get(),
|
||||||
|
AppDatabase::class.java,
|
||||||
|
"plant_db"
|
||||||
|
).build()
|
||||||
|
}
|
||||||
|
|
||||||
|
single { get<AppDatabase>().plantDiagnosisDao() }
|
||||||
|
|
||||||
|
single { PlantDiagnosisLocalRepository(get()) }
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user