Поправил стартер
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
91ccbb5a90
commit
bea9978ef6
4
pom.xml
4
pom.xml
|
@ -19,8 +19,8 @@
|
|||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
|
||||
<telegram.bot.version>0.0.52</telegram.bot.version>
|
||||
<godfather.version>0.0.53</godfather.version>
|
||||
<telegram.bot.version>0.0.54-SNAPSHOT</telegram.bot.version>
|
||||
<godfather.version>0.0.55-SNAPSHOT</godfather.version>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-compiler-plugin -->
|
||||
<plugin.maven.compiler.ver>3.10.1</plugin.maven.compiler.ver>
|
||||
|
|
|
@ -19,15 +19,14 @@ import dev.struchkov.godfather.simple.core.service.PersonSettingServiceImpl;
|
|||
import dev.struchkov.godfather.simple.core.service.StorylineMailService;
|
||||
import dev.struchkov.godfather.simple.core.service.StorylineService;
|
||||
import dev.struchkov.godfather.simple.core.service.UnitPointerServiceImpl;
|
||||
import dev.struchkov.godfather.telegram.main.context.TelegramConnect;
|
||||
import dev.struchkov.godfather.telegram.simple.consumer.EventDistributorService;
|
||||
import dev.struchkov.godfather.telegram.simple.context.repository.SenderRepository;
|
||||
import dev.struchkov.godfather.telegram.simple.context.service.EventDistributor;
|
||||
import dev.struchkov.godfather.telegram.simple.context.service.TelegramConnect;
|
||||
import dev.struchkov.godfather.telegram.simple.context.service.TelegramSending;
|
||||
import dev.struchkov.godfather.telegram.simple.context.service.TelegramService;
|
||||
import dev.struchkov.godfather.telegram.simple.core.ChatMailAutoresponderTelegram;
|
||||
import dev.struchkov.godfather.telegram.simple.core.MailAutoresponderTelegram;
|
||||
import dev.struchkov.godfather.telegram.simple.core.TelegramConnectBot;
|
||||
import dev.struchkov.godfather.telegram.simple.core.service.TelegramServiceImpl;
|
||||
import dev.struchkov.godfather.telegram.simple.sender.TelegramSender;
|
||||
import dev.struchkov.godfather.telegram.starter.ChatUnitConfiguration;
|
||||
|
@ -52,7 +51,7 @@ import static dev.struchkov.haiti.utils.Checker.checkNotNull;
|
|||
@AutoConfigureAfter(TelegramBotDataConfiguration.class)
|
||||
public class TelegramBotAutoconfiguration {
|
||||
|
||||
@ConditionalOnBean(TelegramConnectBot.class)
|
||||
@ConditionalOnBean(TelegramConnect.class)
|
||||
@Bean(AUTORESPONDER_EXECUTORS_SERVICE)
|
||||
public ExecutorService executorService(
|
||||
TelegramBotAutoresponderProperty autoresponderProperty
|
||||
|
@ -205,9 +204,9 @@ public class TelegramBotAutoconfiguration {
|
|||
}
|
||||
|
||||
@Bean
|
||||
@ConditionalOnBean(TelegramConnectBot.class)
|
||||
@ConditionalOnBean(TelegramConnect.class)
|
||||
public EventDistributor eventDistributor(
|
||||
TelegramConnectBot telegramConnect, List<? extends EventHandler> eventProviders
|
||||
TelegramConnect telegramConnect, List<? extends EventHandler> eventProviders
|
||||
) {
|
||||
return new EventDistributorService(telegramConnect, (List<EventHandler>) eventProviders);
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ import dev.struchkov.godfather.simple.data.repository.impl.PersonSettingLocalRep
|
|||
import dev.struchkov.godfather.simple.data.repository.impl.StorylineMapRepository;
|
||||
import dev.struchkov.godfather.simple.data.repository.impl.UnitPointLocalRepository;
|
||||
import dev.struchkov.godfather.telegram.simple.context.repository.SenderRepository;
|
||||
import dev.struchkov.godfather.telegram.simple.core.TelegramConnectBot;
|
||||
import dev.struchkov.godfather.telegram.simple.context.service.TelegramConnect;
|
||||
import dev.struchkov.godfather.telegram.simple.core.service.SenderMapRepository;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
|
||||
|
@ -22,21 +22,21 @@ import org.springframework.context.annotation.Configuration;
|
|||
public class TelegramBotDataConfiguration {
|
||||
|
||||
@Bean
|
||||
@ConditionalOnBean(TelegramConnectBot.class)
|
||||
@ConditionalOnBean(TelegramConnect.class)
|
||||
@ConditionalOnMissingBean(UnitPointerRepository.class)
|
||||
public UnitPointerRepository unitPointerRepository() {
|
||||
return new UnitPointLocalRepository();
|
||||
}
|
||||
|
||||
@Bean
|
||||
@ConditionalOnBean(TelegramConnectBot.class)
|
||||
@ConditionalOnBean(TelegramConnect.class)
|
||||
@ConditionalOnMissingBean(PersonSettingRepository.class)
|
||||
public PersonSettingRepository personSettingRepository() {
|
||||
return new PersonSettingLocalRepository();
|
||||
}
|
||||
|
||||
@Bean
|
||||
@ConditionalOnBean(TelegramConnectBot.class)
|
||||
@ConditionalOnBean(TelegramConnect.class)
|
||||
@ConditionalOnMissingBean(StorylineRepository.class)
|
||||
public StorylineRepository storylineRepository() {
|
||||
return new StorylineMapRepository();
|
||||
|
@ -49,7 +49,7 @@ public class TelegramBotDataConfiguration {
|
|||
}
|
||||
|
||||
@Bean
|
||||
@ConditionalOnBean(TelegramConnectBot.class)
|
||||
@ConditionalOnBean(TelegramConnect.class)
|
||||
public StorylineContext storylineContext() {
|
||||
return new StorylineContextMapImpl();
|
||||
}
|
||||
|
|
|
@ -2,8 +2,10 @@ package dev.struchkov.godfather.telegram.starter.config;
|
|||
|
||||
import dev.struchkov.godfather.telegram.domain.config.ProxyConfig;
|
||||
import dev.struchkov.godfather.telegram.domain.config.TelegramBotConfig;
|
||||
import dev.struchkov.godfather.telegram.main.core.TelegramDefaultConnect;
|
||||
import dev.struchkov.godfather.telegram.simple.core.TelegramConnectBot;
|
||||
import dev.struchkov.godfather.telegram.simple.context.service.TelegramConnect;
|
||||
import dev.struchkov.godfather.telegram.simple.core.TelegramDefaultConnect;
|
||||
import dev.struchkov.godfather.telegram.simple.core.TelegramPollingConnect;
|
||||
import dev.struchkov.godfather.telegram.simple.core.TelegramWebhookConnect;
|
||||
import dev.struchkov.godfather.telegram.starter.property.TelegramBotAutoresponderProperty;
|
||||
import org.springframework.beans.factory.ObjectProvider;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
|
@ -49,13 +51,20 @@ public class TelegramBotPropertyConfiguration {
|
|||
@Bean
|
||||
@Primary
|
||||
@ConditionalOnProperty(prefix = "telegram.bot", name = "username")
|
||||
public TelegramConnectBot telegramConnectBot(TelegramBotConfig telegramConfig) {
|
||||
return new TelegramConnectBot(telegramConfig);
|
||||
public TelegramConnect telegramConnectBot(TelegramBotConfig telegramConfig) {
|
||||
return new TelegramPollingConnect(telegramConfig);
|
||||
}
|
||||
|
||||
@Bean
|
||||
@Primary
|
||||
@ConditionalOnProperty(prefix = "telegram.bot", name = "webhook-url")
|
||||
public TelegramConnect telegramWebhookConnect(TelegramBotConfig telegramConfig) {
|
||||
return new TelegramWebhookConnect(telegramConfig);
|
||||
}
|
||||
|
||||
@Bean
|
||||
@ConditionalOnProperty(prefix = "telegram.bot", name = "token")
|
||||
public TelegramDefaultConnect telegramDefaultConnect(TelegramBotConfig telegramConfig) {
|
||||
public TelegramConnect telegramDefaultConnect(TelegramBotConfig telegramConfig) {
|
||||
return new TelegramDefaultConnect(telegramConfig);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue