diff options
author | Vitaly Takmazov | 2018-02-24 16:54:28 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2018-03-15 12:05:59 +0300 |
commit | bebe7c159f00e6d5a83bb786824d5f32e4de9270 (patch) | |
tree | 151801a2e625d4952d12630da6a4aec6a37fb76d /juick-notifications | |
parent | 70f481e2fe39a9029b1896d7b351293fd5de4ef8 (diff) |
spring boot wip
Diffstat (limited to 'juick-notifications')
5 files changed, 17 insertions, 49 deletions
diff --git a/juick-notifications/build.gradle b/juick-notifications/build.gradle index 8cf770a6..099e5e29 100644 --- a/juick-notifications/build.gradle +++ b/juick-notifications/build.gradle @@ -1,6 +1,7 @@ apply plugin: 'java' apply plugin: 'war' -apply plugin: 'org.akhikhl.gretty' +apply plugin: 'org.springframework.boot' +apply plugin: 'io.spring.dependency-management' dependencies { compile project(':juick-server-web') @@ -14,12 +15,6 @@ dependencies { compileJava.options.encoding = 'UTF-8' -gretty { - httpPort = 8080 - contextPath = '' - servletContainer = 'tomcat8' -} - configurations { all*.exclude module: 'commons-logging' } diff --git a/juick-notifications/src/main/java/com/juick/components/MPNSClient.java b/juick-notifications/src/main/java/com/juick/components/MPNSClient.java index 21286258..efa47bb1 100644 --- a/juick-notifications/src/main/java/com/juick/components/MPNSClient.java +++ b/juick-notifications/src/main/java/com/juick/components/MPNSClient.java @@ -34,9 +34,9 @@ public class MPNSClient { @Inject private ObjectMapper jsonMapper; - @Value("${wns_application_sip}") + @Value("${wns_application_sip:}") private String applicationSip; - @Value("${wns_client_secret}") + @Value("${wns_client_secret:}") private String applicationSecret; private RestTemplate wnsService; diff --git a/juick-notifications/src/main/java/com/juick/components/PushServer.java b/juick-notifications/src/main/java/com/juick/components/PushServer.java new file mode 100644 index 00000000..c22f48dc --- /dev/null +++ b/juick-notifications/src/main/java/com/juick/components/PushServer.java @@ -0,0 +1,12 @@ +package com.juick.components; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class PushServer { + + public static void main(String[] args) { + SpringApplication.run(PushServer.class, args); + } +} diff --git a/juick-notifications/src/main/java/com/juick/components/configuration/GCMConfiguration.java b/juick-notifications/src/main/java/com/juick/components/configuration/GCMConfiguration.java index 96c7716f..27e1af0f 100644 --- a/juick-notifications/src/main/java/com/juick/components/configuration/GCMConfiguration.java +++ b/juick-notifications/src/main/java/com/juick/components/configuration/GCMConfiguration.java @@ -11,7 +11,7 @@ import org.springframework.context.annotation.Configuration; */ @Configuration public class GCMConfiguration { - @Value("${gcm_key}") + @Value("${gcm_key:}") private String gcmKey; @Bean diff --git a/juick-notifications/src/main/java/com/juick/components/configuration/NotificationsInitializer.java b/juick-notifications/src/main/java/com/juick/components/configuration/NotificationsInitializer.java deleted file mode 100644 index d4068d26..00000000 --- a/juick-notifications/src/main/java/com/juick/components/configuration/NotificationsInitializer.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.juick.components.configuration; - -import org.apache.commons.codec.CharEncoding; -import org.springframework.web.filter.CharacterEncodingFilter; -import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer; - -import javax.servlet.Filter; - -/** - * Created by vt on 09/02/16. - */ -public class NotificationsInitializer extends AbstractAnnotationConfigDispatcherServletInitializer { - - @Override - protected Class<?>[] getRootConfigClasses() { - return new Class<?>[] {}; - } - - @Override - protected Class<?>[] getServletConfigClasses() { - return new Class<?>[]{ NotificationsAppConfiguration.class }; - } - - @Override - protected String[] getServletMappings() { - return new String[]{"/"}; - } - - @Override - protected Filter[] getServletFilters() { - CharacterEncodingFilter characterEncodingFilter = new CharacterEncodingFilter(CharEncoding.UTF_8); - return new Filter[]{characterEncodingFilter}; - } - - @Override - protected String getServletName() { - return "Notifications dispatcher servlet"; - } -} |