File tree Expand file tree Collapse file tree 3 files changed +13
-1
lines changed
data/src/main/java/com/whyranoid/data
domain/src/main/java/com/whyranoid/domain/repository Expand file tree Collapse file tree 3 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,8 @@ import kotlinx.coroutines.flow.Flow
7
7
import javax.inject.Inject
8
8
9
9
class RunningHistoryRepositoryImpl @Inject constructor(
10
- private val runningHistoryLocalDataSource : RunningHistoryLocalDataSource
10
+ private val runningHistoryLocalDataSource : RunningHistoryLocalDataSource ,
11
+ private val runningHistoryRemoteDataSource : RunningHistoryRemoteDataSource
11
12
) : RunningHistoryRepository {
12
13
override fun getRunningHistory (): Flow <Result <List <RunningHistory >>> {
13
14
return runningHistoryLocalDataSource.getRunningHistory()
@@ -36,4 +37,8 @@ class RunningHistoryRepositoryImpl @Inject constructor(
36
37
)
37
38
)
38
39
}
40
+
41
+ override suspend fun uploadRunningHistory (runningHistory : RunningHistory ): Result <Boolean > {
42
+ return runningHistoryRemoteDataSource.uploadRunningHistory(runningHistory)
43
+ }
39
44
}
Original file line number Diff line number Diff line change @@ -5,6 +5,8 @@ import com.whyranoid.data.account.AccountDataSourceImpl
5
5
import com.whyranoid.data.account.AccountRepositoryImpl
6
6
import com.whyranoid.data.account.RunningHistoryLocalDataSource
7
7
import com.whyranoid.data.account.RunningHistoryLocalDataSourceImpl
8
+ import com.whyranoid.data.account.RunningHistoryRemoteDataSource
9
+ import com.whyranoid.data.account.RunningHistoryRemoteDataSourceImpl
8
10
import com.whyranoid.data.account.RunningHistoryRepositoryImpl
9
11
import com.whyranoid.domain.repository.AccountRepository
10
12
import com.whyranoid.domain.repository.RunningHistoryRepository
@@ -28,4 +30,7 @@ abstract class AccountModule {
28
30
29
31
@Binds
30
32
abstract fun provideRunningHistoryDataSource (runningHistoryLocalDataSourceImpl : RunningHistoryLocalDataSourceImpl ): RunningHistoryLocalDataSource
33
+
34
+ @Binds
35
+ abstract fun bindRunningHistoryRemoteDataSource (runningHistoryRemoteDataSourceImpl : RunningHistoryRemoteDataSourceImpl ): RunningHistoryRemoteDataSource
31
36
}
Original file line number Diff line number Diff line change @@ -20,4 +20,6 @@ interface RunningHistoryRepository {
20
20
pace : Double ,
21
21
totalDistance : Double
22
22
): Result <RunningHistory >
23
+
24
+ suspend fun uploadRunningHistory (runningHistory : RunningHistory ): Result <Boolean >
23
25
}
You can’t perform that action at this time.
0 commit comments