v 1.5.0 RC2
v 1.5.0 RC2
This commit is contained in:
@@ -47,12 +47,7 @@ public class MaxKeyConfig {
|
||||
return port;
|
||||
}
|
||||
|
||||
@Bean
|
||||
@Primary
|
||||
@ConfigurationProperties("spring.datasource")
|
||||
public DataSource dataSource() {
|
||||
return DruidDataSourceBuilder.create().build();
|
||||
}
|
||||
|
||||
|
||||
@Bean
|
||||
public FilterRegistrationBean<TokenEndpointAuthenticationFilter> TokenEndpointAuthenticationFilter() {
|
||||
@@ -109,16 +104,7 @@ public class MaxKeyConfig {
|
||||
tomcat.addAdditionalTomcatConnectors(connector);
|
||||
return tomcat;
|
||||
}
|
||||
|
||||
@Bean(name = "passwordReciprocal")
|
||||
public PasswordReciprocal passwordReciprocal() {
|
||||
return new PasswordReciprocal();
|
||||
}
|
||||
|
||||
@Bean(name = "savedRequestSuccessHandler")
|
||||
public SavedRequestAwareAuthenticationSuccessHandler SavedRequestAwareAuthenticationSuccessHandler() {
|
||||
return new SavedRequestAwareAuthenticationSuccessHandler();
|
||||
}
|
||||
|
||||
|
||||
@Bean(name = "keyUriFormat")
|
||||
public KeyUriFormat keyUriFormat(
|
||||
@@ -143,24 +129,6 @@ public class MaxKeyConfig {
|
||||
return keyUriFormat;
|
||||
}
|
||||
|
||||
@Bean(name = "authenticationProvider")
|
||||
public RealmAuthenticationProvider authenticationProvider() {
|
||||
return new RealmAuthenticationProvider();
|
||||
}
|
||||
|
||||
@Bean(name = "jdbcTemplate")
|
||||
public JdbcTemplate jdbcTemplate(DataSource dataSource) {
|
||||
return new JdbcTemplate(dataSource);
|
||||
}
|
||||
|
||||
@Bean(name = "sqlSession")
|
||||
public SqlSessionTemplate sqlSession(SqlSessionFactory sqlSessionFactory) throws Exception {
|
||||
return new SqlSessionTemplate(sqlSessionFactory);
|
||||
}
|
||||
|
||||
@Bean(name = "transactionManager")
|
||||
DataSourceTransactionManager transactionManager(DataSource dataSource) {
|
||||
return new DataSourceTransactionManager(dataSource);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
package org.maxkey;
|
||||
|
||||
import org.maxkey.persistence.redis.RedisConnectionFactory;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.PropertySource;
|
||||
|
||||
import redis.clients.jedis.JedisPoolConfig;
|
||||
|
||||
@Configuration
|
||||
@PropertySource("classpath:/application.properties")
|
||||
public class RedisAutoConfiguration {
|
||||
|
||||
@Value("${spring.redis.host}")
|
||||
private String host;
|
||||
@Value("${spring.redis.port}")
|
||||
private int port;
|
||||
@Value("${spring.redis.timeout}")
|
||||
private int timeout;
|
||||
@Value("${spring.redis.password}")
|
||||
private String password;
|
||||
@Value("${spring.redis.lettuce.pool.max-active}")
|
||||
private int maxActive;
|
||||
@Value("${spring.redis.jedis.pool.max-wait}")
|
||||
private int maxWait;
|
||||
@Value("${spring.redis.jedis.pool.max-idle}")
|
||||
private int maxIdle;
|
||||
@Value("${spring.redis.lettuce.pool.min-idle}")
|
||||
private int minIdle;
|
||||
|
||||
@Bean
|
||||
public RedisConnectionFactory redisConnectionFactory() {
|
||||
RedisConnectionFactory factory = new RedisConnectionFactory();
|
||||
factory.setHostName(host);
|
||||
factory.setPort(port);
|
||||
factory.setTimeOut(timeout);
|
||||
factory.setPassword(password);
|
||||
|
||||
JedisPoolConfig poolConfig = new JedisPoolConfig();
|
||||
poolConfig.setMaxIdle(maxIdle);
|
||||
poolConfig.setMinIdle(minIdle);
|
||||
poolConfig.setMaxTotal(maxActive);
|
||||
poolConfig.setMaxWaitMillis(maxWait);
|
||||
|
||||
factory.setPoolConfig(poolConfig);
|
||||
|
||||
return factory;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
# Auto Configure
|
||||
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
|
||||
org.maxkey.RedisAutoConfiguration,\
|
||||
org.maxkey.config.KaptchaAutoConfiguration,\
|
||||
org.maxkey.config.MvcAutoConfiguration
|
||||
org.maxkey.autoconfigure.ApplicationAutoConfiguration,\
|
||||
org.maxkey.autoconfigure.MvcAutoConfiguration,\
|
||||
org.maxkey.autoconfigure.KaptchaAutoConfiguration,\
|
||||
org.maxkey.autoconfigure.RedisAutoConfiguration
|
||||
|
||||
Reference in New Issue
Block a user