Skip to content

Commit

Permalink
feat: SocialUnlinkClientManager 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
belljun3395 committed May 19, 2024
1 parent af465fe commit 639b79c
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.walking.member.api.client.unlink

import com.walking.member.api.client.unlink.dto.SocialUnlinkData
import org.springframework.stereotype.Component

@Component
class SocialUnlinkClientManager(
private val socialUnlinkClients: List<SocialUnlinkClient>
) {
fun execute(socialType: String, targetId: String): SocialUnlinkData {
socialUnlinkClients.forEach { client ->
if (client.supports(socialType)) {
return client.execute(targetId)
}
}
throw IllegalArgumentException("Unsupported social type: $socialType")
}
}

0 comments on commit 639b79c

Please sign in to comment.