Skip to content

Commit

Permalink
[Feat] shareMemeUseCase 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
hyejin12-ju committed Sep 30, 2024
1 parent da0e8d2 commit 11c1b78
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import team.ppac.domain.usecase.SaveMemeUseCase
import team.ppac.domain.usecase.SaveMemeUseCaseImpl
import team.ppac.domain.usecase.SetLevelUseCase
import team.ppac.domain.usecase.SetLevelUseCaseImpl
import team.ppac.domain.usecase.ShareMemeUseCase
import team.ppac.domain.usecase.WatchMemeUseCase
import team.ppac.domain.usecase.WatchMemeUseCaseImpl

Expand Down Expand Up @@ -116,4 +117,8 @@ internal abstract class UseCaseModule {
@Binds
@ViewModelScoped
abstract fun bindEmitRefreshEventUseCase(impl: EmitRefreshEventUseCaseImpl): EmitRefreshEventUseCase

@Binds
@ViewModelScoped
abstract fun bindShareMemeUseCase(impl: SaveMemeUseCaseImpl): ShareMemeUseCase
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package team.ppac.domain.usecase

import team.ppac.domain.repository.MemeRepository
import javax.inject.Inject

interface ShareMemeUseCase {
suspend operator fun invoke(memeId: String): Boolean
}

internal class ShareMemeUseCaseImpl @Inject constructor(
private val memeRepository: MemeRepository,
) : ShareMemeUseCase {
override suspend fun invoke(memeId: String): Boolean =
memeRepository.shareMeme(memeId)

}

0 comments on commit 11c1b78

Please sign in to comment.