Skip to content

Commit

Permalink
[refactor] matchProfile - userId 매개변수 삭제
Browse files Browse the repository at this point in the history
  • Loading branch information
murjune committed Feb 7, 2024
1 parent 18f966a commit 754f480
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ package com.moya.funch.repository

import com.moya.funch.entity.match.Matching

fun interface MatchingRepository {
suspend fun matchProfile(userId: String, targetCode: String): Matching
interface MatchingRepository {
suspend fun matchProfile(targetCode: String): Matching
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import javax.inject.Inject
class CanMatchProfileUseCaseImpl @Inject constructor(
private val matchingRepository: MatchingRepository
) : CanMatchProfileUseCase {
override suspend operator fun invoke(userId: String, targetCode: String): Boolean =
runCatching { matchingRepository.matchProfile(userId, targetCode) }.isSuccess
override suspend operator fun invoke(targetCode: String): Boolean =
runCatching { matchingRepository.matchProfile(targetCode) }.isSuccess
}

fun interface CanMatchProfileUseCase {
suspend operator fun invoke(userId: String, targetCode: String): Boolean
suspend operator fun invoke(targetCode: String): Boolean
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ import javax.inject.Inject
class MatchProfileUseCaseImpl @Inject constructor(
private val matchingRepository: MatchingRepository
) : MatchProfileUseCase {
override suspend operator fun invoke(userId: String, targetCode: String): Matching =
matchingRepository.matchProfile(userId, targetCode)
override suspend operator fun invoke(targetCode: String): Matching = matchingRepository.matchProfile(targetCode)
}

fun interface MatchProfileUseCase {
suspend operator fun invoke(userId: String, targetCode: String): Matching
suspend operator fun invoke(targetCode: String): Matching
}

0 comments on commit 754f480

Please sign in to comment.