diff options
Diffstat (limited to 'juick-server/src/main/java/com/juick/server/configuration/EventsConfiguration.java')
-rw-r--r-- | juick-server/src/main/java/com/juick/server/configuration/EventsConfiguration.java | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/juick-server/src/main/java/com/juick/server/configuration/EventsConfiguration.java b/juick-server/src/main/java/com/juick/server/configuration/EventsConfiguration.java deleted file mode 100644 index 63c774fa..00000000 --- a/juick-server/src/main/java/com/juick/server/configuration/EventsConfiguration.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.juick.server.configuration; - -import com.juick.server.TelegramBotManager; -import com.juick.server.XMPPBot; -import com.juick.server.component.LikeEvent; -import com.juick.server.component.MessageEvent; -import com.juick.server.component.SubscribeEvent; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.context.ApplicationListener; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -import javax.inject.Inject; - -@Configuration -public class EventsConfiguration { - private static Logger logger = LoggerFactory.getLogger(EventsConfiguration.class); - @Inject - private TelegramBotManager telegramBotManager; - @Inject - private XMPPBot bot; - @Bean - ApplicationListener<MessageEvent> messageListener() { - return event -> { - logger.info("MessageEvent: {}", event.getMessage()); - telegramBotManager.processMessage(event.getMessage()); - bot.processMessage(event.getMessage()); - }; - } - @Bean - ApplicationListener<LikeEvent> likeListener() { - return event -> { - logger.info("LikeEvent: {} -> {}", event.getUser().getName(), event.getMessage()); - telegramBotManager.processLike(event.getUser(), event.getMessage()); - }; - } - @Bean - ApplicationListener<SubscribeEvent> subscribeListener() { - return event -> { - logger.info("SubscribeEvent: {} -> {}", event.getUser().getName(), event.getToUser().getName()); - telegramBotManager.processSubscribe(event.getUser(), event.getToUser()); - }; - } -} |