diff --git a/src/main/java/beforespring/socialfeed/content/service/ExternalApiHandlerResolver.java b/src/main/java/beforespring/socialfeed/content/service/ExternalApiHandlerResolver.java index 42c3a32..26472db 100644 --- a/src/main/java/beforespring/socialfeed/content/service/ExternalApiHandlerResolver.java +++ b/src/main/java/beforespring/socialfeed/content/service/ExternalApiHandlerResolver.java @@ -16,6 +16,7 @@ public class ExternalApiHandlerResolver { public ExternalApiHandlerResolver(List handlers) { handlers.forEach(handler -> handlerMap.put(handler.getSourceType(), handler)); } + /** * 핸들러를 검색하여 반환. * diff --git a/src/main/java/beforespring/socialfeed/content/service/FacebookApiHandler.java b/src/main/java/beforespring/socialfeed/content/service/FacebookApiHandler.java index f8de06b..99ab04a 100644 --- a/src/main/java/beforespring/socialfeed/content/service/FacebookApiHandler.java +++ b/src/main/java/beforespring/socialfeed/content/service/FacebookApiHandler.java @@ -6,7 +6,7 @@ @Component @Slf4j -public class FacebookApiHandler implements ExternalApiHandler{ +public class FacebookApiHandler implements ExternalApiHandler { @Override public ContentSourceType getSourceType() { return ContentSourceType.FACEBOOK; diff --git a/src/main/java/beforespring/socialfeed/content/service/InstagramApiHandler.java b/src/main/java/beforespring/socialfeed/content/service/InstagramApiHandler.java new file mode 100644 index 0000000..718abbd --- /dev/null +++ b/src/main/java/beforespring/socialfeed/content/service/InstagramApiHandler.java @@ -0,0 +1,24 @@ +package beforespring.socialfeed.content.service; + +import beforespring.socialfeed.content.domain.ContentSourceType; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Component; + +@Component +@Slf4j +public class InstagramApiHandler implements ExternalApiHandler { + @Override + public ContentSourceType getSourceType() { + return ContentSourceType.INSTAGRAM; + } + + @Override + public void like(String contentSourceId) { + log.info("Instagram like contentSourceId: {}", contentSourceId); + } + + @Override + public void share(String contentSourceId) { + log.info("Instagram share contentSourceId: {}", contentSourceId); + } +} diff --git a/src/main/java/beforespring/socialfeed/content/service/ThreadsApiHandler.java b/src/main/java/beforespring/socialfeed/content/service/ThreadsApiHandler.java new file mode 100644 index 0000000..4dcde7f --- /dev/null +++ b/src/main/java/beforespring/socialfeed/content/service/ThreadsApiHandler.java @@ -0,0 +1,24 @@ +package beforespring.socialfeed.content.service; + +import beforespring.socialfeed.content.domain.ContentSourceType; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Component; + +@Component +@Slf4j +public class ThreadsApiHandler implements ExternalApiHandler { + @Override + public ContentSourceType getSourceType() { + return ContentSourceType.THREADS; + } + + @Override + public void like(String contentSourceId) { + log.info("Threads like contentSourceId: {}", contentSourceId); + } + + @Override + public void share(String contentSourceId) { + log.info("Threads share contentSourceId: {}", contentSourceId); + } +} diff --git a/src/main/java/beforespring/socialfeed/content/service/TwitterApiHandler.java b/src/main/java/beforespring/socialfeed/content/service/TwitterApiHandler.java new file mode 100644 index 0000000..fffaea2 --- /dev/null +++ b/src/main/java/beforespring/socialfeed/content/service/TwitterApiHandler.java @@ -0,0 +1,24 @@ +package beforespring.socialfeed.content.service; + +import beforespring.socialfeed.content.domain.ContentSourceType; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Component; + +@Component +@Slf4j +public class TwitterApiHandler implements ExternalApiHandler { + @Override + public ContentSourceType getSourceType() { + return ContentSourceType.TWITTER; + } + + @Override + public void like(String contentSourceId) { + log.info("Twitter like contentSourceId: {}", contentSourceId); + } + + @Override + public void share(String contentSourceId) { + log.info("Twitter share contentSourceId: {}", contentSourceId); + } +}