diff options
Diffstat (limited to 'juick-notifications/src/main/java/com/juick/components/configuration/NotificationsAppConfiguration.java')
-rw-r--r-- | juick-notifications/src/main/java/com/juick/components/configuration/NotificationsAppConfiguration.java | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/juick-notifications/src/main/java/com/juick/components/configuration/NotificationsAppConfiguration.java b/juick-notifications/src/main/java/com/juick/components/configuration/NotificationsAppConfiguration.java index b8730bfb..b50edfd5 100644 --- a/juick-notifications/src/main/java/com/juick/components/configuration/NotificationsAppConfiguration.java +++ b/juick-notifications/src/main/java/com/juick/components/configuration/NotificationsAppConfiguration.java @@ -1,20 +1,16 @@ package com.juick.components.configuration; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.datatype.jdk8.Jdk8Module; import com.juick.components.CleanUp; import com.juick.components.Notifications; +import com.juick.server.configuration.BaseWebConfiguration; import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.PropertySource; +import org.springframework.context.annotation.*; import org.springframework.http.client.ClientHttpRequestInterceptor; import org.springframework.http.client.InterceptingClientHttpRequestFactory; import org.springframework.http.client.support.BasicAuthorizationInterceptor; import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.web.client.RestTemplate; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport; import java.util.Collections; import java.util.List; @@ -26,7 +22,8 @@ import java.util.List; @EnableScheduling @PropertySource("classpath:juick.conf") @ComponentScan(basePackages = {"com.juick.components.service"}) -public class NotificationsAppConfiguration { +@Import(BaseWebConfiguration.class) +public class NotificationsAppConfiguration extends WebMvcConfigurationSupport { @Value("${api_user:juick}") private String apiUser; @Value("${api_password:secret}") @@ -48,16 +45,6 @@ public class NotificationsAppConfiguration { } @Bean - public ObjectMapper jsonMapper() { - ObjectMapper mapper = new ObjectMapper(); - mapper.setSerializationInclusion(JsonInclude.Include.NON_EMPTY); - mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); - mapper.setSerializationInclusion(JsonInclude.Include.NON_DEFAULT); - mapper.registerModule(new Jdk8Module()); - return mapper; - } - - @Bean public CleanUp cleanUp() { return new CleanUp(); } |