mirror of
https://github.com/hs-web/hsweb-framework.git
synced 2026-06-08 00:49:21 +08:00
refactor: 调整spring-boot自动配置. (#261)
This commit is contained in:
@@ -15,7 +15,6 @@ public interface DimensionManager {
|
||||
/**
|
||||
* 获取用户维度
|
||||
*
|
||||
* @param type 维度类型
|
||||
* @param userId 用户ID
|
||||
* @return 用户维度信息
|
||||
*/
|
||||
|
||||
@@ -14,6 +14,7 @@ import org.hswebframework.web.authorization.twofactor.defaults.DefaultTwoFactorV
|
||||
import org.hswebframework.web.convert.CustomMessageConverter;
|
||||
import org.springframework.beans.factory.ObjectProvider;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
@@ -25,12 +26,9 @@ import java.util.List;
|
||||
/**
|
||||
* @author zhouhao
|
||||
*/
|
||||
@Configuration
|
||||
@AutoConfiguration
|
||||
public class DefaultAuthorizationAutoConfiguration {
|
||||
|
||||
@Autowired(required = false)
|
||||
private List<DataAccessConfigConverter> dataAccessConfigConverters;
|
||||
|
||||
@Bean
|
||||
@ConditionalOnMissingBean(UserTokenManager.class)
|
||||
@ConfigurationProperties(prefix = "hsweb.user-token")
|
||||
@@ -67,11 +65,7 @@ public class DefaultAuthorizationAutoConfiguration {
|
||||
@ConditionalOnMissingBean(DataAccessConfigBuilderFactory.class)
|
||||
@ConfigurationProperties(prefix = "hsweb.authorization.data-access", ignoreInvalidFields = true)
|
||||
public SimpleDataAccessConfigBuilderFactory dataAccessConfigBuilderFactory() {
|
||||
SimpleDataAccessConfigBuilderFactory factory = new SimpleDataAccessConfigBuilderFactory();
|
||||
if (null != dataAccessConfigConverters) {
|
||||
dataAccessConfigConverters.forEach(factory::addConvert);
|
||||
}
|
||||
return factory;
|
||||
return new SimpleDataAccessConfigBuilderFactory();
|
||||
}
|
||||
|
||||
@Bean
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
# Auto Configure
|
||||
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
|
||||
org.hswebframework.web.authorization.simple.DefaultAuthorizationAutoConfiguration
|
||||
@@ -0,0 +1 @@
|
||||
org.hswebframework.web.authorization.simple.DefaultAuthorizationAutoConfiguration
|
||||
@@ -16,6 +16,7 @@ import org.hswebframework.web.authorization.token.UserTokenManager;
|
||||
import org.hswebframework.web.authorization.twofactor.TwoFactorValidatorManager;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.config.BeanPostProcessor;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.condition.*;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
@@ -36,7 +37,7 @@ import java.util.List;
|
||||
* @author zhouhao
|
||||
* @since 3.0
|
||||
*/
|
||||
@Configuration
|
||||
@AutoConfiguration
|
||||
@EnableConfigurationProperties(EmbedAuthenticationProperties.class)
|
||||
public class AuthorizingHandlerAutoConfiguration {
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import org.hswebframework.web.authorization.basic.twofactor.TwoFactorHandlerInte
|
||||
import org.hswebframework.web.authorization.basic.web.*;
|
||||
import org.hswebframework.web.authorization.token.UserTokenManager;
|
||||
import org.hswebframework.web.authorization.twofactor.TwoFactorValidatorManager;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.condition.*;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
@@ -17,7 +18,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.List;
|
||||
|
||||
@Configuration
|
||||
@AutoConfiguration
|
||||
@ConditionalOnClass(name = "org.springframework.web.servlet.config.annotation.WebMvcConfigurer")
|
||||
@ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.SERVLET)
|
||||
public class WebMvcAuthorizingConfiguration {
|
||||
|
||||
@@ -1,4 +1,2 @@
|
||||
# Auto Configure
|
||||
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
|
||||
org.hswebframework.web.authorization.basic.configuration.AuthorizingHandlerAutoConfiguration,\
|
||||
org.hswebframework.web.authorization.basic.configuration.AuthorizingHandlerAutoConfiguration
|
||||
org.hswebframework.web.authorization.basic.configuration.WebMvcAuthorizingConfiguration
|
||||
@@ -1,11 +1,8 @@
|
||||
package org.hswebframework.web.oauth2.server;
|
||||
|
||||
import org.hswebframework.web.authorization.ReactiveAuthenticationHolder;
|
||||
import org.hswebframework.web.authorization.ReactiveAuthenticationManager;
|
||||
import org.hswebframework.web.authorization.basic.web.ReactiveUserTokenParser;
|
||||
import org.hswebframework.web.authorization.token.UserToken;
|
||||
import org.hswebframework.web.authorization.token.UserTokenManager;
|
||||
import org.hswebframework.web.oauth2.server.auth.ReactiveOAuth2AccessTokenParser;
|
||||
import org.hswebframework.web.oauth2.server.code.AuthorizationCodeGranter;
|
||||
import org.hswebframework.web.oauth2.server.code.DefaultAuthorizationCodeGranter;
|
||||
import org.hswebframework.web.oauth2.server.credential.ClientCredentialGranter;
|
||||
@@ -16,6 +13,7 @@ import org.hswebframework.web.oauth2.server.refresh.DefaultRefreshTokenGranter;
|
||||
import org.hswebframework.web.oauth2.server.refresh.RefreshTokenGranter;
|
||||
import org.hswebframework.web.oauth2.server.web.OAuth2AuthorizeController;
|
||||
import org.springframework.beans.factory.ObjectProvider;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
@@ -27,7 +25,7 @@ import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.data.redis.connection.ReactiveRedisConnectionFactory;
|
||||
import org.springframework.data.redis.core.ReactiveRedisOperations;
|
||||
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@AutoConfiguration
|
||||
@EnableConfigurationProperties(OAuth2Properties.class)
|
||||
public class OAuth2ServerAutoConfiguration {
|
||||
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
# Auto Configure
|
||||
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
|
||||
org.hswebframework.web.oauth2.server.OAuth2ServerAutoConfiguration
|
||||
@@ -0,0 +1 @@
|
||||
org.hswebframework.web.oauth2.server.OAuth2ServerAutoConfiguration
|
||||
@@ -49,6 +49,11 @@
|
||||
<artifactId>commons-codec</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-autoconfigure</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@@ -1,11 +1,12 @@
|
||||
package org.hswebframework.web.api.crud.entity;
|
||||
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.context.ApplicationContextAware;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@AutoConfiguration
|
||||
public class EntityFactoryHolderConfiguration {
|
||||
|
||||
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
# Auto Configure
|
||||
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
|
||||
org.hswebframework.web.api.crud.entity.EntityFactoryHolderConfiguration
|
||||
@@ -0,0 +1 @@
|
||||
org.hswebframework.web.api.crud.entity.EntityFactoryHolderConfiguration
|
||||
@@ -35,6 +35,7 @@ import org.springframework.beans.BeansException;
|
||||
import org.springframework.beans.factory.ObjectProvider;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.config.BeanPostProcessor;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
@@ -53,7 +54,7 @@ import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
|
||||
@Configuration
|
||||
@AutoConfiguration
|
||||
@EnableConfigurationProperties(EasyormProperties.class)
|
||||
@EnableEasyormRepository("org.hswebframework.web.**.entity")
|
||||
public class EasyormConfiguration {
|
||||
|
||||
@@ -4,6 +4,7 @@ import org.hswebframework.ezorm.rdb.executor.SyncSqlExecutor;
|
||||
import org.hswebframework.ezorm.rdb.executor.reactive.ReactiveSqlExecutor;
|
||||
import org.hswebframework.web.crud.sql.DefaultJdbcExecutor;
|
||||
import org.hswebframework.web.crud.sql.DefaultJdbcReactiveExecutor;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
@@ -13,7 +14,7 @@ import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
|
||||
@Configuration
|
||||
@AutoConfiguration
|
||||
@AutoConfigureAfter(DataSourceAutoConfiguration.class)
|
||||
@ConditionalOnBean(DataSource.class)
|
||||
public class JdbcSqlExecutorConfiguration {
|
||||
|
||||
@@ -5,6 +5,7 @@ import org.hswebframework.ezorm.rdb.executor.SyncSqlExecutor;
|
||||
import org.hswebframework.ezorm.rdb.executor.reactive.ReactiveSqlExecutor;
|
||||
import org.hswebframework.ezorm.rdb.executor.reactive.ReactiveSyncSqlExecutor;
|
||||
import org.hswebframework.web.crud.sql.DefaultR2dbcExecutor;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||
@@ -12,7 +13,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
@AutoConfiguration
|
||||
@AutoConfigureAfter(name = "org.springframework.boot.autoconfigure.r2dbc.R2dbcAutoConfiguration")
|
||||
@ConditionalOnBean(ConnectionFactory.class)
|
||||
public class R2dbcSqlExecutorConfiguration {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.hswebframework.web.crud.web;
|
||||
|
||||
import org.hswebframework.web.i18n.WebFluxLocaleFilter;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
@@ -13,7 +14,7 @@ import org.springframework.http.codec.ServerCodecConfigurer;
|
||||
import org.springframework.web.reactive.accept.RequestedContentTypeResolver;
|
||||
import org.springframework.web.server.WebFilter;
|
||||
|
||||
@Configuration
|
||||
@AutoConfiguration
|
||||
@ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.REACTIVE)
|
||||
public class CommonWebFluxConfiguration {
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.hswebframework.web.crud.web;
|
||||
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
@@ -8,7 +9,7 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
@AutoConfiguration
|
||||
@ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.SERVLET)
|
||||
@ConditionalOnClass(org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice.class)
|
||||
public class CommonWebMvcConfiguration {
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
# Auto Configure
|
||||
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
|
||||
org.hswebframework.web.crud.configuration.EasyormConfiguration,\
|
||||
org.hswebframework.web.crud.configuration.JdbcSqlExecutorConfiguration,\
|
||||
org.hswebframework.web.crud.configuration.R2dbcSqlExecutorConfiguration,\
|
||||
org.hswebframework.web.crud.web.CommonWebFluxConfiguration,\
|
||||
org.hswebframework.web.crud.web.CommonWebMvcConfiguration
|
||||
@@ -0,0 +1,5 @@
|
||||
org.hswebframework.web.crud.configuration.EasyormConfiguration
|
||||
org.hswebframework.web.crud.configuration.JdbcSqlExecutorConfiguration
|
||||
org.hswebframework.web.crud.configuration.R2dbcSqlExecutorConfiguration
|
||||
org.hswebframework.web.crud.web.CommonWebFluxConfiguration
|
||||
org.hswebframework.web.crud.web.CommonWebMvcConfiguration
|
||||
@@ -10,6 +10,11 @@ import java.util.Collection;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
/**
|
||||
* 响应式缓存
|
||||
*
|
||||
* @param <E> 缓存元素类型
|
||||
*/
|
||||
public interface ReactiveCache<E> {
|
||||
|
||||
Flux<E> getFlux(Object key);
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
package org.hswebframework.web.cache.configuration;
|
||||
|
||||
import org.hswebframework.web.cache.ReactiveCacheManager;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
@AutoConfiguration
|
||||
@ConditionalOnMissingBean(ReactiveCacheManager.class)
|
||||
@EnableConfigurationProperties(ReactiveCacheProperties.class)
|
||||
public class ReactiveCacheManagerConfiguration {
|
||||
|
||||
@@ -24,6 +24,10 @@ public class CaffeineReactiveCache<E> extends AbstractReactiveCache<E> {
|
||||
@Override
|
||||
public Flux<E> getAll(Object... keys) {
|
||||
return Flux.<E>defer(() -> {
|
||||
if (keys == null || keys.length == 0) {
|
||||
return Flux.fromIterable(cache.asMap().values())
|
||||
.map(e -> (E) e);
|
||||
}
|
||||
return Flux.fromIterable(cache.getAllPresent(Arrays.asList(keys)).values())
|
||||
.map(e -> (E) e);
|
||||
});
|
||||
|
||||
@@ -9,7 +9,7 @@ import java.util.Arrays;
|
||||
|
||||
@SuppressWarnings("all")
|
||||
@AllArgsConstructor
|
||||
public class GuavaReactiveCache<E> extends AbstractReactiveCache<E>{
|
||||
public class GuavaReactiveCache<E> extends AbstractReactiveCache<E> {
|
||||
|
||||
private Cache<Object, Object> cache;
|
||||
|
||||
@@ -34,11 +34,17 @@ public class GuavaReactiveCache<E> extends AbstractReactiveCache<E>{
|
||||
public Mono<Void> evict(Object key) {
|
||||
return Mono.fromRunnable(() -> cache.invalidate(key));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Flux<E> getAll(Object... keys) {
|
||||
return Flux.<E>defer(() -> {
|
||||
if (keys == null || keys.length == 0) {
|
||||
return Flux
|
||||
.fromIterable(cache.asMap().values())
|
||||
.map(e -> (E) e);
|
||||
}
|
||||
return Flux.fromIterable(cache.getAllPresent(Arrays.asList(keys)).values())
|
||||
.map(e -> (E) e);
|
||||
.map(e -> (E) e);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ public class RedisReactiveCache<E> extends AbstractReactiveCache<E> {
|
||||
|
||||
@Override
|
||||
public Flux<E> getAll(Object... keys) {
|
||||
if (keys.length == 0) {
|
||||
if (keys == null || keys.length == 0) {
|
||||
return operations
|
||||
.opsForHash()
|
||||
.values(redisKey)
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
# Auto Configure
|
||||
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
|
||||
org.hswebframework.web.cache.configuration.ReactiveCacheManagerConfiguration
|
||||
@@ -0,0 +1 @@
|
||||
org.hswebframework.web.cache.configuration.ReactiveCacheManagerConfiguration
|
||||
@@ -21,19 +21,15 @@ package org.hswebframework.web.aop;
|
||||
import com.google.common.collect.Maps;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.aopalliance.intercept.MethodInvocation;
|
||||
import org.hswebframework.web.utils.AnnotationUtils;
|
||||
import org.hswebframework.web.utils.DigestUtils;
|
||||
import org.reactivestreams.Publisher;
|
||||
import org.springframework.core.LocalVariableTableParameterNameDiscoverer;
|
||||
import org.springframework.core.DefaultParameterNameDiscoverer;
|
||||
import org.springframework.core.ParameterNameDiscoverer;
|
||||
import reactor.core.publisher.Flux;
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
import java.lang.annotation.Annotation;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.function.Function;
|
||||
@@ -47,7 +43,7 @@ public class MethodInterceptorHolder {
|
||||
/**
|
||||
* 参数名称获取器,用于获取方法参数的名称
|
||||
*/
|
||||
public static final ParameterNameDiscoverer nameDiscoverer = new LocalVariableTableParameterNameDiscoverer();
|
||||
public static final ParameterNameDiscoverer nameDiscoverer = new DefaultParameterNameDiscoverer();
|
||||
|
||||
public static MethodInterceptorHolder create(MethodInvocation invocation) {
|
||||
String[] argNames = nameDiscoverer.getParameterNames(invocation.getMethod());
|
||||
|
||||
@@ -3,6 +3,7 @@ package org.hswebframework.web.datasource;
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.config.BeanPostProcessor;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
@@ -11,7 +12,7 @@ import org.springframework.context.annotation.Configuration;
|
||||
/**
|
||||
* @author zhouhao
|
||||
*/
|
||||
@Configuration
|
||||
@AutoConfiguration
|
||||
@ImportAutoConfiguration(AopDataSourceSwitcherAutoConfiguration.class)
|
||||
public class DynamicDataSourceAutoConfiguration {
|
||||
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
# Auto Configure
|
||||
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
|
||||
org.hswebframework.web.datasource.DynamicDataSourceAutoConfiguration
|
||||
@@ -0,0 +1 @@
|
||||
org.hswebframework.web.datasource.DynamicDataSourceAutoConfiguration
|
||||
@@ -3,6 +3,7 @@ package org.hswebframework.web.datasource.jta;
|
||||
import org.hswebframework.web.datasource.DynamicDataSourceAutoConfiguration;
|
||||
import org.hswebframework.web.datasource.DynamicDataSourceService;
|
||||
import org.hswebframework.web.datasource.config.DynamicDataSourceConfigRepository;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.boot.jta.atomikos.AtomikosDataSourceBean;
|
||||
@@ -16,7 +17,7 @@ import java.sql.SQLException;
|
||||
/**
|
||||
* @author zhouhao
|
||||
*/
|
||||
@Configuration
|
||||
@AutoConfiguration
|
||||
@AutoConfigureBefore(DynamicDataSourceAutoConfiguration.class)
|
||||
public class AtomikosDataSourceAutoConfiguration {
|
||||
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
# Auto Configure
|
||||
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
|
||||
org.hswebframework.web.datasource.jta.AtomikosDataSourceAutoConfiguration,\
|
||||
org.hswebframework.web.datasource.jta.JtaJdbcSqlExecutorAutoConfiguration
|
||||
@@ -0,0 +1 @@
|
||||
org.hswebframework.web.datasource.jta.AtomikosDataSourceAutoConfiguration
|
||||
@@ -1,9 +1,10 @@
|
||||
package org.hswebframework.web.datasource.web;
|
||||
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
@AutoConfiguration
|
||||
public class DatasourceWebApiAutoConfiguration {
|
||||
|
||||
@Bean
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
# Auto Configure
|
||||
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
|
||||
org.hswebframework.web.datasource.web.DatasourceWebApiAutoConfiguration
|
||||
@@ -0,0 +1 @@
|
||||
org.hswebframework.web.datasource.web.DatasourceWebApiAutoConfiguration
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.hswebframework.web.starter;
|
||||
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
|
||||
@@ -61,7 +62,7 @@ import java.util.Optional;
|
||||
* @author Jia
|
||||
* @since 1.0
|
||||
*/
|
||||
@Configuration
|
||||
@AutoConfiguration
|
||||
@ConditionalOnProperty(prefix = "hsweb.cors", name = "enable", havingValue = "true")
|
||||
@EnableConfigurationProperties(CorsProperties.class)
|
||||
public class CorsAutoConfiguration {
|
||||
|
||||
@@ -12,6 +12,7 @@ import org.hswebframework.web.starter.initialize.SystemVersion;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.CommandLineRunner;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
@@ -24,7 +25,7 @@ import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
@Configuration
|
||||
@AutoConfiguration
|
||||
@EnableConfigurationProperties(AppProperties.class)
|
||||
public class HswebAutoConfiguration {
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.hswebframework.web.i18n.MessageSourceInitializer;
|
||||
import org.springframework.beans.factory.ObjectProvider;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigureOrder;
|
||||
import org.springframework.context.MessageSource;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
@@ -18,7 +19,7 @@ import org.springframework.util.StringUtils;
|
||||
import java.util.Arrays;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@AutoConfiguration
|
||||
@AutoConfigureOrder(Ordered.HIGHEST_PRECEDENCE)
|
||||
@Slf4j
|
||||
public class I18nConfiguration {
|
||||
|
||||
@@ -11,6 +11,7 @@ import com.fasterxml.jackson.databind.type.ClassKey;
|
||||
import com.fasterxml.jackson.databind.type.ReferenceType;
|
||||
import org.hswebframework.web.api.crud.entity.EntityFactory;
|
||||
import org.hswebframework.web.dict.EnumDict;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||
@@ -23,8 +24,7 @@ import org.springframework.http.codec.CodecConfigurer;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@AutoConfigureAfter(JacksonAutoConfiguration.class)
|
||||
@AutoConfiguration(after = JacksonAutoConfiguration.class)
|
||||
public class CustomCodecsAutoConfiguration {
|
||||
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
# Auto Configure
|
||||
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
|
||||
org.hswebframework.web.starter.jackson.CustomCodecsAutoConfiguration,\
|
||||
org.hswebframework.web.starter.HswebAutoConfiguration,\
|
||||
org.hswebframework.web.starter.CorsAutoConfiguration,\
|
||||
org.hswebframework.web.starter.i18n.I18nConfiguration
|
||||
@@ -0,0 +1,4 @@
|
||||
org.hswebframework.web.starter.jackson.CustomCodecsAutoConfiguration
|
||||
org.hswebframework.web.starter.HswebAutoConfiguration
|
||||
org.hswebframework.web.starter.CorsAutoConfiguration
|
||||
org.hswebframework.web.starter.i18n.I18nConfiguration
|
||||
@@ -14,6 +14,7 @@ import org.hswebframework.web.system.authorization.defaults.service.*;
|
||||
import org.hswebframework.web.system.authorization.defaults.service.terms.DimensionTerm;
|
||||
import org.hswebframework.web.system.authorization.defaults.service.terms.UserDimensionTerm;
|
||||
import org.springframework.beans.factory.ObjectProvider;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
@@ -21,10 +22,10 @@ import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
|
||||
@Configuration
|
||||
@AutoConfiguration
|
||||
public class AuthorizationServiceAutoConfiguration {
|
||||
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@AutoConfiguration
|
||||
@AutoConfigureBefore(DefaultAuthorizationAutoConfiguration.class)
|
||||
static class ReactiveAuthorizationServiceAutoConfiguration {
|
||||
@ConditionalOnBean(ReactiveRepository.class)
|
||||
|
||||
@@ -1,17 +1,18 @@
|
||||
package org.hswebframework.web.system.authorization.defaults.configuration;
|
||||
|
||||
import org.hswebframework.web.system.authorization.defaults.webflux.*;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
@AutoConfiguration
|
||||
public class AuthorizationWebAutoConfiguration {
|
||||
|
||||
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@AutoConfiguration
|
||||
@ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.REACTIVE)
|
||||
public static class WebFluxAuthorizationConfiguration {
|
||||
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
# Auto Configure
|
||||
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
|
||||
org.hswebframework.web.system.authorization.defaults.configuration.AuthorizationServiceAutoConfiguration,\
|
||||
org.hswebframework.web.system.authorization.defaults.configuration.AuthorizationWebAutoConfiguration
|
||||
@@ -0,0 +1,4 @@
|
||||
org.hswebframework.web.system.authorization.defaults.configuration.AuthorizationServiceAutoConfiguration
|
||||
org.hswebframework.web.system.authorization.defaults.configuration.AuthorizationServiceAutoConfiguration.ReactiveAuthorizationServiceAutoConfiguration
|
||||
org.hswebframework.web.system.authorization.defaults.configuration.AuthorizationWebAutoConfiguration
|
||||
org.hswebframework.web.system.authorization.defaults.configuration.AuthorizationWebAutoConfiguration.WebFluxAuthorizationConfiguration
|
||||
@@ -4,15 +4,16 @@ import org.hswebframework.web.oauth2.server.OAuth2ClientManager;
|
||||
import org.hswebframework.web.oauth2.service.InDBOAuth2ClientManager;
|
||||
import org.hswebframework.web.oauth2.service.OAuth2ClientService;
|
||||
import org.hswebframework.web.oauth2.web.WebFluxOAuth2ClientController;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@AutoConfiguration
|
||||
public class OAuth2ClientManagerAutoConfiguration {
|
||||
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@AutoConfiguration
|
||||
@ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.REACTIVE)
|
||||
static class ReactiveOAuth2ClientManagerAutoConfiguration {
|
||||
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
# Auto Configure
|
||||
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
|
||||
org.hswebframework.web.oauth2.configuration.OAuth2ClientManagerAutoConfiguration
|
||||
@@ -0,0 +1,2 @@
|
||||
org.hswebframework.web.oauth2.configuration.OAuth2ClientManagerAutoConfiguration
|
||||
org.hswebframework.web.oauth2.configuration.OAuth2ClientManagerAutoConfiguration.ReactiveOAuth2ClientManagerAutoConfiguration
|
||||
@@ -5,12 +5,13 @@ import org.hswebframework.web.dictionary.service.DefaultDictionaryItemService;
|
||||
import org.hswebframework.web.dictionary.service.DefaultDictionaryService;
|
||||
import org.hswebframework.web.dictionary.webflux.WebfluxDictionaryController;
|
||||
import org.hswebframework.web.dictionary.webflux.WebfluxDictionaryItemController;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
@AutoConfiguration
|
||||
@EnableConfigurationProperties(DictionaryProperties.class)
|
||||
public class DictionaryAutoConfiguration {
|
||||
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
# Auto Configure
|
||||
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
|
||||
org.hswebframework.web.dictionary.configuration.DictionaryAutoConfiguration
|
||||
@@ -0,0 +1 @@
|
||||
org.hswebframework.web.dictionary.configuration.DictionaryAutoConfiguration
|
||||
@@ -3,13 +3,14 @@ package org.hswebframework.web.file;
|
||||
import org.hswebframework.web.file.service.FileStorageService;
|
||||
import org.hswebframework.web.file.service.LocalFileStorageService;
|
||||
import org.hswebframework.web.file.web.ReactiveFileController;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
@AutoConfiguration
|
||||
@EnableConfigurationProperties(FileUploadProperties.class)
|
||||
public class FileServiceConfiguration {
|
||||
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
# Auto Configure
|
||||
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
|
||||
org.hswebframework.web.file.FileServiceConfiguration
|
||||
@@ -0,0 +1 @@
|
||||
org.hswebframework.web.file.FileServiceConfiguration
|
||||
5
pom.xml
5
pom.xml
@@ -220,11 +220,14 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.10.1</version>
|
||||
<version>3.11.0</version>
|
||||
<configuration>
|
||||
<source>${project.build.jdk}</source>
|
||||
<target>${project.build.jdk}</target>
|
||||
<encoding>${project.build.sourceEncoding}</encoding>
|
||||
<compilerArgs>
|
||||
<arg>-parameters</arg>
|
||||
</compilerArgs>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user