aboutsummaryrefslogtreecommitdiff
path: root/juick-api/src/main/java/com/juick/api/configuration
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2017-06-20 09:41:28 +0300
committerGravatar Vitaly Takmazov2017-06-20 15:43:58 +0300
commit7d75cabd9ea4c80348d5e98ac08347a204c60fc4 (patch)
treef46239dcf07bf3c1fe523faed998bc057fb7fe98 /juick-api/src/main/java/com/juick/api/configuration
parentc803d6ac3db2a76508058812accd3b1748caab69 (diff)
mail wip
Diffstat (limited to 'juick-api/src/main/java/com/juick/api/configuration')
-rw-r--r--juick-api/src/main/java/com/juick/api/configuration/ApiAppConfiguration.java9
-rw-r--r--juick-api/src/main/java/com/juick/api/configuration/ApiMvcConfiguration.java6
2 files changed, 9 insertions, 6 deletions
diff --git a/juick-api/src/main/java/com/juick/api/configuration/ApiAppConfiguration.java b/juick-api/src/main/java/com/juick/api/configuration/ApiAppConfiguration.java
index b6ba9282..cbf7d05c 100644
--- a/juick-api/src/main/java/com/juick/api/configuration/ApiAppConfiguration.java
+++ b/juick-api/src/main/java/com/juick/api/configuration/ApiAppConfiguration.java
@@ -1,9 +1,11 @@
package com.juick.api.configuration;
+import com.juick.api.ApiServer;
import com.juick.api.TGBot;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
+import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.web.socket.client.WebSocketConnectionManager;
import org.springframework.web.socket.client.standard.StandardWebSocketClient;
@@ -15,6 +17,7 @@ import javax.inject.Inject;
*/
@Configuration
@EnableScheduling
+@EnableAsync
@PropertySource("classpath:juick.conf")
public class ApiAppConfiguration {
@Inject
@@ -33,4 +36,10 @@ public class ApiAppConfiguration {
public StandardWebSocketClient client() {
return new StandardWebSocketClient();
}
+
+ @Bean
+ public ApiServer apiServer() {
+ return new ApiServer();
+ }
+
}
diff --git a/juick-api/src/main/java/com/juick/api/configuration/ApiMvcConfiguration.java b/juick-api/src/main/java/com/juick/api/configuration/ApiMvcConfiguration.java
index adff42a7..37c07434 100644
--- a/juick-api/src/main/java/com/juick/api/configuration/ApiMvcConfiguration.java
+++ b/juick-api/src/main/java/com/juick/api/configuration/ApiMvcConfiguration.java
@@ -2,7 +2,6 @@ package com.juick.api.configuration;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.datatype.jdk8.Jdk8Module;
-import com.juick.api.ApiServer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
@@ -23,11 +22,6 @@ import java.util.List;
@ComponentScan(basePackages = {"com.juick.api.controllers"})
public class ApiMvcConfiguration extends WebMvcConfigurationSupport {
- @Bean
- public ApiServer apiServer() {
- return new ApiServer();
- }
-
@Override
public RequestMappingHandlerMapping requestMappingHandlerMapping() {
RequestMappingHandlerMapping mapping = super.requestMappingHandlerMapping();