diff options
author | Vitaly Takmazov | 2016-10-24 17:11:52 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2016-10-24 17:12:41 +0300 |
commit | d1f27eff90719ed40d0d30d048f00908656b3028 (patch) | |
tree | a69a24b15d52613e662c4dcdaaff5b9453cd359c /juick-notifications/src/main/java/com/juick/notifications/configuration | |
parent | f2789e9891751e913c951dcaf1f215788306dfc3 (diff) |
notifications: jdbctemplate -> resttemplate
Diffstat (limited to 'juick-notifications/src/main/java/com/juick/notifications/configuration')
-rw-r--r-- | juick-notifications/src/main/java/com/juick/notifications/configuration/NotificationsConfiguration.java | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/juick-notifications/src/main/java/com/juick/notifications/configuration/NotificationsConfiguration.java b/juick-notifications/src/main/java/com/juick/notifications/configuration/NotificationsConfiguration.java index e1267de0..fd122724 100644 --- a/juick-notifications/src/main/java/com/juick/notifications/configuration/NotificationsConfiguration.java +++ b/juick-notifications/src/main/java/com/juick/notifications/configuration/NotificationsConfiguration.java @@ -8,7 +8,6 @@ import com.mitchellbosecke.pebble.loader.Loader; import com.mitchellbosecke.pebble.loader.ServletLoader; import com.mitchellbosecke.pebble.spring4.PebbleViewResolver; import com.mitchellbosecke.pebble.spring4.extension.SpringExtension; -import org.apache.commons.dbcp2.BasicDataSource; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; @@ -17,7 +16,7 @@ import org.springframework.core.env.Environment; import org.springframework.http.converter.HttpMessageConverter; import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder; import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; -import org.springframework.jdbc.core.JdbcTemplate; +import org.springframework.web.client.RestTemplate; import org.springframework.web.servlet.ViewResolver; import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport; @@ -42,11 +41,8 @@ public class NotificationsConfiguration extends WebMvcConfigurationSupport { ExecutorService service; @Bean - JdbcTemplate jdbc() { - BasicDataSource dataSource = new BasicDataSource(); - dataSource.setDriverClassName(env.getProperty("datasource_driver", "com.mysql.jdbc.Driver")); - dataSource.setUrl(env.getProperty("datasource_url")); - return new JdbcTemplate(dataSource); + RestTemplate rest() { + return new RestTemplate(); } @Inject private ServletContext servletContext; |