-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Storage sdk - Implement non-gms upload and return null in gms(implement in other task). * Storage sdk: Add constants and missing space. Don't force unwrap nullable values. * Storage sdk - Change to private and refactor JSON_MIME_TYPE constant value * Solved comments * Solve conflicts --------- Co-authored-by: Hector A. Narvaez <hector.narvaez@encora.com>
- Loading branch information
1 parent
9e89281
commit 3fe751d
Showing
10 changed files
with
129 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
storage-api/src/main/java/com/omh/android/storage/api/domain/usecase/UploadFileUseCase.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package com.omh.android.storage.api.domain.usecase | ||
|
||
import com.omh.android.storage.api.domain.model.OmhFile | ||
import com.omh.android.storage.api.domain.repository.OmhFileRepository | ||
import kotlinx.coroutines.CoroutineDispatcher | ||
import kotlinx.coroutines.Dispatchers | ||
import java.io.File | ||
|
||
class UploadFileUseCase( | ||
private val repository: OmhFileRepository, | ||
dispatcher: CoroutineDispatcher = Dispatchers.Default | ||
) : OmhSuspendUseCase<UploadFileUseCaseParams, UploadFileUseCaseResult>(dispatcher) { | ||
|
||
override suspend fun execute(parameters: UploadFileUseCaseParams): UploadFileUseCaseResult { | ||
return UploadFileUseCaseResult( | ||
repository.uploadFile(parameters.localFileToUpload, parameters.fileName, parameters.parentId) | ||
) | ||
} | ||
} | ||
|
||
data class UploadFileUseCaseParams(val localFileToUpload: File, val fileName: String, val parentId: String?) | ||
|
||
data class UploadFileUseCaseResult(val file: OmhFile?) |