Приложение
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
package stories.data.repository
|
||||
|
||||
import stories.data.remote.api.*
|
||||
import stories.domain.repository.StoryRepository
|
||||
import okhttp3.MultipartBody
|
||||
import javax.inject.Inject
|
||||
|
||||
class StoryRepositoryImpl @Inject constructor(
|
||||
private val api: StoryApi
|
||||
) : StoryRepository {
|
||||
override suspend fun getStories(): List<StoryGroupDto> = api.getStories()
|
||||
|
||||
override suspend fun createStory(request: CreateStoryRequest): StoryResponse =
|
||||
api.createStory(request)
|
||||
|
||||
override suspend fun uploadVideo(file: MultipartBody.Part): UploadResponse =
|
||||
api.uploadVideo(file)
|
||||
|
||||
override suspend fun viewStory(storyId: String) = api.viewStory(storyId)
|
||||
|
||||
override suspend fun addReaction(storyId: String, emoji: String) =
|
||||
api.addReaction(storyId, ReactionRequest(emoji))
|
||||
|
||||
override suspend fun addReply(storyId: String, content: String) =
|
||||
api.addReply(storyId, ReplyRequest(content))
|
||||
}
|
||||
Reference in New Issue
Block a user