From 9a4add44ecbd32dea6ac3d30fd81ae1ac82e3dbc Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Sun, 15 Oct 2017 05:37:18 +0300 Subject: api: ImagesService --- .../main/java/com/juick/api/configuration/ApiAppConfiguration.java | 3 +++ .../src/main/java/com/juick/api/configuration/ApiInitializer.java | 5 ++--- .../src/main/java/com/juick/api/configuration/ApiSecurityConfig.java | 2 ++ 3 files changed, 7 insertions(+), 3 deletions(-) (limited to 'juick-api/src/main') 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 f77611e2..c78ea51a 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 @@ -20,6 +20,8 @@ package com.juick.api.configuration; import com.juick.api.ApiServer; import com.juick.api.TelegramBotManager; import com.juick.server.configuration.BaseWebConfiguration; +import com.juick.service.ImagesService; +import com.juick.service.ImagesServiceImpl; import org.springframework.context.annotation.*; import org.springframework.scheduling.annotation.EnableAsync; import org.springframework.scheduling.annotation.EnableScheduling; @@ -69,6 +71,7 @@ public class ApiAppConfiguration extends BaseWebConfiguration { public ApiServer apiServer() { return new ApiServer(); } + @Bean public Docket api() { return new Docket(DocumentationType.SWAGGER_2) diff --git a/juick-api/src/main/java/com/juick/api/configuration/ApiInitializer.java b/juick-api/src/main/java/com/juick/api/configuration/ApiInitializer.java index fa025e56..8f9cb4ed 100644 --- a/juick-api/src/main/java/com/juick/api/configuration/ApiInitializer.java +++ b/juick-api/src/main/java/com/juick/api/configuration/ApiInitializer.java @@ -17,7 +17,6 @@ package com.juick.api.configuration; -import com.juick.configuration.DataConfiguration; import org.apache.commons.codec.CharEncoding; import org.springframework.web.filter.CharacterEncodingFilter; import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer; @@ -32,13 +31,13 @@ public class ApiInitializer extends AbstractAnnotationConfigDispatcherServletIni @Override protected Class[] getRootConfigClasses() { return new Class[]{ - ApiSecurityConfig.class, DataConfiguration.class, MessengerConfiguration.class + ApiSecurityConfig.class }; } @Override protected Class[] getServletConfigClasses() { - return new Class[]{ ApiAppConfiguration.class }; + return new Class[]{ MessengerConfiguration.class }; } @Override diff --git a/juick-api/src/main/java/com/juick/api/configuration/ApiSecurityConfig.java b/juick-api/src/main/java/com/juick/api/configuration/ApiSecurityConfig.java index e4ae4b80..7e3f3345 100644 --- a/juick-api/src/main/java/com/juick/api/configuration/ApiSecurityConfig.java +++ b/juick-api/src/main/java/com/juick/api/configuration/ApiSecurityConfig.java @@ -24,6 +24,7 @@ import com.juick.service.security.deprecated.RequestParamHashRememberMeServices; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Import; import org.springframework.context.annotation.PropertySource; import org.springframework.http.HttpMethod; import org.springframework.security.authentication.dao.DaoAuthenticationProvider; @@ -48,6 +49,7 @@ import java.util.concurrent.TimeUnit; @Configuration @EnableWebSecurity @PropertySource("classpath:juick.conf") +@Import(ApiAppConfiguration.class) public class ApiSecurityConfig extends WebSecurityConfigurerAdapter { @Value("${auth_remember_me_key}") private String rememberMeKey; -- cgit v1.2.3