-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBotConfig.java
More file actions
28 lines (23 loc) · 843 Bytes
/
BotConfig.java
File metadata and controls
28 lines (23 loc) · 843 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package com.greenapi.demoChatbot;
import com.greenapi.chatbot.pkg.BotFactory;
import com.greenapi.chatbot.pkg.state.StateManager;
import com.greenapi.chatbot.pkg.state.StateManagerHashMapImpl;
import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;
@Configuration
public class BotConfig {
@Bean
public RestTemplate restTemplate() {
return new RestTemplateBuilder().build();
}
@Bean
public StateManager stateManager() {
return new StateManagerHashMapImpl();
}
@Bean
public BotFactory botFactory(RestTemplate restTemplate, StateManager stateManager) {
return new BotFactory(restTemplate, stateManager);
}
}