diff --git a/bean-searcher-solon-plugin/src/main/java/cn/zhxu/bs/solon/BeanSearcherAutoConfiguration.java b/bean-searcher-solon-plugin/src/main/java/cn/zhxu/bs/solon/BeanSearcherAutoConfiguration.java index 5fc07e1c5d22a417b0c7416f2673ed6856cd3e83..ff9457a04e76d801f864600f5b77ce5a498f7b0c 100644 --- a/bean-searcher-solon-plugin/src/main/java/cn/zhxu/bs/solon/BeanSearcherAutoConfiguration.java +++ b/bean-searcher-solon-plugin/src/main/java/cn/zhxu/bs/solon/BeanSearcherAutoConfiguration.java @@ -12,8 +12,8 @@ import cn.zhxu.bs.group.GroupResolver; import cn.zhxu.bs.solon.BeanSearcherProperties.Sql; import cn.zhxu.bs.convertor.*; import cn.zhxu.bs.implement.*; -import cn.zhxu.bs.solon.beans.ObjectProvider; import cn.zhxu.bs.util.LRUCache; +import cn.zhxu.xjson.JsonKit; import org.noear.solon.annotation.Bean; import org.noear.solon.annotation.Condition; import org.noear.solon.annotation.Configuration; @@ -22,25 +22,24 @@ import org.noear.solon.core.AopContext; import javax.sql.DataSource; import java.time.ZoneId; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.function.Consumer; + @Configuration public class BeanSearcherAutoConfiguration { @Inject AopContext context; - @Bean - public PageExtractor pageExtractor(BeanSearcherProperties config) { - if(context.hasWrap(PageExtractor.class)){ - return null; - } + //放到这儿,减少注入处理代码 + @Inject + BeanSearcherProperties config; + @Bean + @Condition(onMissingBean = PageExtractor.class) + public PageExtractor pageExtractor() { BeanSearcherProperties.Params.Pagination conf = config.getParams().getPagination(); String type = conf.getType(); BasePageExtractor extractor; @@ -48,8 +47,7 @@ public class BeanSearcherAutoConfiguration { PageSizeExtractor p = new PageSizeExtractor(); p.setPageName(conf.getPage()); extractor = p; - } else - if (BeanSearcherProperties.Params.Pagination.TYPE_OFFSET.equals(type)) { + } else if (BeanSearcherProperties.Params.Pagination.TYPE_OFFSET.equals(type)) { PageOffsetExtractor p = new PageOffsetExtractor(); p.setOffsetName(conf.getOffset()); extractor = p; @@ -77,12 +75,9 @@ public class BeanSearcherAutoConfiguration { } @Bean - public Dialect dialect(BeanSearcherProperties config) { - if(context.hasWrap(Dialect.class)){ - return null; - } - - BeanSearcherProperties.Sql.Dialect dialect = config.getSql().getDialect(); + @Condition(onMissingBean = Dialect.class) + public Dialect dialect() { + Sql.Dialect dialect = config.getSql().getDialect(); if (dialect == null) { throw new IllegalConfigException("Invalid config: [bean-searcher.sql.dialect] can not be null."); } @@ -101,10 +96,9 @@ public class BeanSearcherAutoConfiguration { } @Bean - public FieldOpPool fieldOpPool(Dialect dialect, ObjectProvider> fieldOps) { - if(context.hasWrap(FieldOpPool.class)){ - return null; - } + @Condition(onMissingBean = FieldOpPool.class) + public FieldOpPool fieldOpPool(Dialect dialect) { + List fieldOps = context.getBeansOfType(FieldOp.class); FieldOpPool pool = new FieldOpPool(); ifAvailable(fieldOps, ops -> ops.forEach(pool::addFieldOp)); @@ -113,20 +107,14 @@ public class BeanSearcherAutoConfiguration { } @Bean + @Condition(onMissingBean = ExprParser.Factory.class) public ExprParser.Factory parserFactory() { - if(context.hasWrap(ExprParser.Factory.class)){ - return null; - } - return new DefaultParserFactory(); } @Bean - public GroupResolver groupResolver(BeanSearcherProperties config, ExprParser.Factory parserFactory) { - if(context.hasWrap(GroupResolver.class)){ - return null; - } - + @Condition(onMissingBean = GroupResolver.class) + public GroupResolver groupResolver(ExprParser.Factory parserFactory) { DefaultGroupResolver groupResolver = new DefaultGroupResolver(); BeanSearcherProperties.Params.Group conf = config.getParams().getGroup(); groupResolver.setEnabled(conf.isEnable()); @@ -137,71 +125,48 @@ public class BeanSearcherAutoConfiguration { } @Bean + @Condition(onMissingBean = BoolParamConvertor.class) public BoolParamConvertor boolParamConvertor() { - if(context.hasWrap(BoolParamConvertor.class)){ - return null; - } - return new BoolParamConvertor(); } @Bean + @Condition(onMissingBean = NumberParamConvertor.class) public NumberParamConvertor numberParamConvertor() { - if(context.hasWrap(NumberParamConvertor.class)){ - return null; - } - return new NumberParamConvertor(); } @Bean + @Condition(onMissingBean = DateParamConvertor.class) public DateParamConvertor dateParamConvertor() { - if(context.hasWrap(DateParamConvertor.class)){ - return null; - } - return new DateParamConvertor(); } @Bean + @Condition(onMissingBean = TimeParamConvertor.class) public TimeParamConvertor timeParamConvertor() { - if(context.hasWrap(TimeParamConvertor.class)){ - return null; - } - return new TimeParamConvertor(); } @Bean + @Condition(onMissingBean = DateTimeParamConvertor.class) public DateTimeParamConvertor dateTimeParamConvertor() { - if(context.hasWrap(DateTimeParamConvertor.class)){ - return null; - } - return new DateTimeParamConvertor(); } @Bean - public SizeLimitParamFilter sizeLimitParamFilter(BeanSearcherProperties config) { - if(context.hasWrap(SizeLimitParamFilter.class)){ - return null; - } - + @Condition(onMissingBean = SizeLimitParamFilter.class) + public SizeLimitParamFilter sizeLimitParamFilter() { return new SizeLimitParamFilter(config.getParams().getFilter().getMaxParaMapSize()); } @Bean + @Condition(onMissingBean = ParamResolver.class) public ParamResolver paramResolver(PageExtractor pageExtractor, FieldOpPool fieldOpPool, List paramFilters, List convertors, - GroupResolver groupResolver, - BeanSearcherProperties config) { - - if(context.hasWrap(ParamResolver.class)){ - return null; - } - + GroupResolver groupResolver) { DefaultParamResolver paramResolver = new DefaultParamResolver(convertors, paramFilters); paramResolver.setPageExtractor(pageExtractor); paramResolver.setFieldOpPool(fieldOpPool); @@ -222,26 +187,21 @@ public class BeanSearcherAutoConfiguration { } @Bean + @Condition(onMissingBean = SqlResolver.class) public SqlResolver sqlResolver(Dialect dialect) { - if(context.hasWrap(SqlResolver.class)){ - return null; - } - return new DefaultSqlResolver(dialect); } @Bean - public SqlExecutor sqlExecutor(ObjectProvider dataSource, - ObjectProvider> namedDataSources, - ObjectProvider slowListener, - BeanSearcherProperties config) { - if(context.hasWrap(SqlExecutor.class)){ - return null; - } + @Condition(onMissingBean = SqlExecutor.class) + public SqlExecutor sqlExecutor() { + DataSource dataSource = context.getBean(DataSource.class); + List namedDataSources = context.getBeansOfType(NamedDataSource.class); + SqlExecutor.SlowListener slowListener = context.getBean(SqlExecutor.SlowListener.class); - DefaultSqlExecutor executor = new DefaultSqlExecutor(dataSource.getIfAvailable()); + DefaultSqlExecutor executor = new DefaultSqlExecutor(dataSource); ifAvailable(namedDataSources, ndsList -> { - for (NamedDataSource nds: ndsList) { + for (NamedDataSource nds : ndsList) { executor.setDataSource(nds.getName(), nds.getDataSource()); } }); @@ -251,42 +211,30 @@ public class BeanSearcherAutoConfiguration { } @Bean - @Condition(hasProperty = "${bean-searcher.field-convertor.use-number}=true") + @Condition(onMissingBean = NumberFieldConvertor.class, + onProperty = "${bean-searcher.field-convertor.use-number:true}=true") public NumberFieldConvertor numberFieldConvertor() { - if(context.hasWrap(NumberFieldConvertor.class)){ - return null; - } - return new NumberFieldConvertor(); } @Bean - @Condition(hasProperty = "${bean-searcher.field-convertor.use-str-num}=true") + @Condition(onMissingBean = StrNumFieldConvertor.class, + onProperty = "${bean-searcher.field-convertor.use-str-num:true}=true") public StrNumFieldConvertor strNumFieldConvertor() { - if(context.hasWrap(StrNumFieldConvertor.class)){ - return null; - } - return new StrNumFieldConvertor(); } @Bean - @Condition(hasProperty = "${bean-searcher.field-convertor.use-bool-num}=true") + @Condition(onMissingBean = BoolNumFieldConvertor.class, + onProperty = "${bean-searcher.field-convertor.use-bool-num:true}=true") public BoolNumFieldConvertor boolNumFieldConvertor() { - if(context.hasWrap(BoolNumFieldConvertor.class)){ - return null; - } - return new BoolNumFieldConvertor(); } @Bean - @Condition(hasProperty = "${bean-searcher.field-convertor.use-bool}=true") - public BoolFieldConvertor boolFieldConvertor(BeanSearcherProperties config) { - if(context.hasWrap(BoolFieldConvertor.class)){ - return null; - } - + @Condition(onMissingBean = BoolFieldConvertor.class, + onProperty = "${bean-searcher.field-convertor.use-bool:true}=true") + public BoolFieldConvertor boolFieldConvertor() { String[] falseValues = config.getFieldConvertor().getBoolFalseValues(); BoolFieldConvertor convertor = new BoolFieldConvertor(); if (falseValues != null) { @@ -296,12 +244,9 @@ public class BeanSearcherAutoConfiguration { } @Bean - @Condition(hasProperty = "${bean-searcher.field-convertor.use-date}=true") - public DateFieldConvertor dateFieldConvertor(BeanSearcherProperties config) { - if(context.hasWrap(DateFieldConvertor.class)){ - return null; - } - + @Condition(onMissingBean = DateFieldConvertor.class, + onProperty = "${bean-searcher.field-convertor.use-date:true}=true") + public DateFieldConvertor dateFieldConvertor() { DateFieldConvertor convertor = new DateFieldConvertor(); ZoneId zoneId = config.getFieldConvertor().getZoneId(); if (zoneId != null) { @@ -311,22 +256,16 @@ public class BeanSearcherAutoConfiguration { } @Bean - @Condition(hasProperty = "${bean-searcher.field-convertor.use-time}=true") + @Condition(onMissingBean = TimeFieldConvertor.class, + onProperty = "${bean-searcher.field-convertor.use-time:true}=true") public TimeFieldConvertor timeFieldConvertor() { - if(context.hasWrap(TimeFieldConvertor.class)){ - return null; - } - return new TimeFieldConvertor(); } @Bean - @Condition(hasProperty = "${bean-searcher.field-convertor.use-enum}=true") - public EnumFieldConvertor enumFieldConvertor(BeanSearcherProperties config) { - if(context.hasWrap(EnumFieldConvertor.class)){ - return null; - } - + @Condition(onMissingBean = EnumFieldConvertor.class, + onProperty = "${bean-searcher.field-convertor.use-enum:true}=true") + public EnumFieldConvertor enumFieldConvertor() { BeanSearcherProperties.FieldConvertor conf = config.getFieldConvertor(); EnumFieldConvertor convertor = new EnumFieldConvertor(); convertor.setFailOnError(conf.isEnumFailOnError()); @@ -335,14 +274,13 @@ public class BeanSearcherAutoConfiguration { } - @Bean - @Condition(hasProperty = "${bean-searcher.field-convertor.use-list}=true") - public ListFieldConvertor listFieldConvertor(BeanSearcherProperties config, - ObjectProvider>> convertorsProvider) { - if(context.hasWrap(ListFieldConvertor.class) == false){ - return null; - } + @Condition(onMissingBean = ListFieldConvertor.class, + onProperty = "${bean-searcher.field-convertor.use-list:true}=true") + public ListFieldConvertor listFieldConvertor() { + List tmp = context.getBeansOfType(ListFieldConvertor.Convertor.class); + List> convertorsProvider = new ArrayList<>(); + tmp.forEach(c -> convertorsProvider.add(c)); BeanSearcherProperties.FieldConvertor conf = config.getFieldConvertor(); ListFieldConvertor convertor = new ListFieldConvertor(conf.getListItemSeparator()); @@ -351,24 +289,19 @@ public class BeanSearcherAutoConfiguration { } @Bean - public BeanReflector beanReflector(ObjectProvider> convertorsProvider) { - if(context.hasWrap(BeanReflector.class) == false){ - return null; - } + @Condition(onMissingBean = BeanReflector.class) + public BeanReflector beanReflector() { + List convertorsProvider = context.getBeansOfType(BFieldConvertor.class); - List convertors = convertorsProvider.getIfAvailable(); - if (convertors != null) { - return new DefaultBeanReflector(convertors); + if (convertorsProvider != null) { + return new DefaultBeanReflector(convertorsProvider); } return new DefaultBeanReflector(); } @Bean - public DbMapping dbMapping(BeanSearcherProperties config) { - if(context.hasWrap(DbMapping.class) == false){ - return null; - } - + @Condition(onMissingBean = DbMapping.class) + public DbMapping dbMapping() { DefaultDbMapping mapping = new DefaultDbMapping(); Sql.DefaultMapping conf = config.getSql().getDefaultMapping(); mapping.setTablePrefix(conf.getTablePrefix()); @@ -383,10 +316,9 @@ public class BeanSearcherAutoConfiguration { } @Bean - public MetaResolver metaResolver(DbMapping dbMapping, ObjectProvider snippetResolver) { - if(context.hasWrap(MetaResolver.class) == false){ - return null; - } + @Condition(onMissingBean = MetaResolver.class) + public MetaResolver metaResolver(DbMapping dbMapping) { + SnippetResolver snippetResolver = context.getBean(SnippetResolver.class); DefaultMetaResolver metaResolver = new DefaultMetaResolver(dbMapping); ifAvailable(snippetResolver, metaResolver::setSnippetResolver); @@ -394,17 +326,16 @@ public class BeanSearcherAutoConfiguration { } @Bean - @Condition(hasProperty = "${bean-searcher.use-bean-searcher}=true") + @Condition(onMissingBean = BeanSearcher.class, + onProperty = "${bean-searcher.use-bean-searcher:true}=true") public BeanSearcher beanSearcher(MetaResolver metaResolver, ParamResolver paramResolver, SqlResolver sqlResolver, SqlExecutor sqlExecutor, - BeanReflector beanReflector, - ObjectProvider> interceptors, - ObjectProvider> processors) { - if(context.hasWrap(BeanSearcher.class) == false){ - return null; - } + BeanReflector beanReflector) { + + List interceptors = context.getBeansOfType(SqlInterceptor.class); + List processors = context.getBeansOfType(ResultFilter.class); DefaultBeanSearcher searcher = new DefaultBeanSearcher(); searcher.setMetaResolver(metaResolver); @@ -418,12 +349,9 @@ public class BeanSearcherAutoConfiguration { } @Bean - @Condition(hasProperty = "${bean-searcher.field-convertor.use-date-format}=true") - public DateFormatFieldConvertor dateFormatFieldConvertor(BeanSearcherProperties config) { - if(context.hasWrap(DateFormatFieldConvertor.class) == false){ - return null; - } - + @Condition(onMissingBean = DateFormatFieldConvertor.class, + onProperty = "${bean-searcher.field-convertor.use-date-format:true}=true") + public DateFormatFieldConvertor dateFormatFieldConvertor() { BeanSearcherProperties.FieldConvertor conf = config.getFieldConvertor(); Map dateFormats = conf.getDateFormats(); ZoneId zoneId = conf.getZoneId(); @@ -442,41 +370,36 @@ public class BeanSearcherAutoConfiguration { } @Bean - @Condition(hasProperty = "${bean-searcher.field-convertor.use-b2-m}=true") - public B2MFieldConvertor b2mFieldConvertor(ObjectProvider> convertors) { - if(context.hasWrap(B2MFieldConvertor.class) == false){ - return null; - } + @Condition(onMissingBean = B2MFieldConvertor.class, + onProperty = "${bean-searcher.field-convertor.use-b2-m}=true") + public B2MFieldConvertor b2mFieldConvertor() { + List convertors = context.getBeansOfType(BFieldConvertor.class); - List list = convertors.getIfAvailable(); - if (list != null) { - return new B2MFieldConvertor(list); + if (convertors != null) { + return new B2MFieldConvertor(convertors); } return new B2MFieldConvertor(Collections.emptyList()); } - @Bean - @Condition(hasProperty = "${bean-searcher.use-map-searcher}=true") + @Bean //@Primary + @Condition(onMissingBean = MapSearcher.class, + onProperty = "${bean-searcher.use-map-searcher:true}=true") public MapSearcher mapSearcher(MetaResolver metaResolver, ParamResolver paramResolver, SqlResolver sqlResolver, - SqlExecutor sqlExecutor, - ObjectProvider> convertors, - ObjectProvider> interceptors, - ObjectProvider> resultFilters) { - - if(context.hasWrap(MapSearcher.class) == false){ - return null; - } + SqlExecutor sqlExecutor) { + List convertors = context.getBeansOfType(MFieldConvertor.class); + List interceptors = context.getBeansOfType(SqlInterceptor.class); + List resultFilters = context.getBeansOfType(ResultFilter.class); DefaultMapSearcher searcher = new DefaultMapSearcher(); searcher.setMetaResolver(metaResolver); searcher.setParamResolver(paramResolver); searcher.setSqlResolver(sqlResolver); searcher.setSqlExecutor(sqlExecutor); - List list = convertors.getIfAvailable(); - if (list != null) { - List newList = new ArrayList<>(list); + + if (convertors != null) { + List newList = new ArrayList<>(convertors); // 让 DateFormatFieldConvertor 排在前面 newList.sort((o1, o2) -> { if (o1 instanceof DateFormatFieldConvertor) { @@ -494,13 +417,20 @@ public class BeanSearcherAutoConfiguration { return searcher; } - private void ifAvailable(ObjectProvider provider, Consumer consumer) { - // 为了兼容 1.x 的 SpringBoot,最低兼容到 v1.4 - // 不直接使用 ObjectProvider.ifAvailable 方法 - T dependency = provider.getIfAvailable(); - if (dependency != null) { - consumer.accept(dependency); - } + // + // 在 springboot 那边,是用单独类处理的;在 solon 这边,用函数 + // + @Bean + @Condition(onClass = JsonKit.class, + onProperty = "${bean-searcher.field-convertor.use-json:true}=true") + public JsonFieldConvertor jsonFieldConvertor() { + BeanSearcherProperties.FieldConvertor conf = config.getFieldConvertor(); + return new JsonFieldConvertor(conf.isJsonFailOnError()); } -} + private void ifAvailable(T provider, Consumer consumer) { + if (provider != null) { + consumer.accept(provider); + } + } +} \ No newline at end of file diff --git a/bean-searcher-solon-plugin/src/main/java/cn/zhxu/bs/solon/JsonFieldConvertorConfig.java b/bean-searcher-solon-plugin/src/main/java/cn/zhxu/bs/solon/JsonFieldConvertorConfig.java deleted file mode 100644 index 572e9091d1323909d79e33f1d2d37232c8c17986..0000000000000000000000000000000000000000 --- a/bean-searcher-solon-plugin/src/main/java/cn/zhxu/bs/solon/JsonFieldConvertorConfig.java +++ /dev/null @@ -1,30 +0,0 @@ -package cn.zhxu.bs.solon; - -import cn.zhxu.bs.convertor.JsonFieldConvertor; -import cn.zhxu.xjson.JsonKit; -import org.noear.solon.annotation.Bean; -import org.noear.solon.annotation.Condition; -import org.noear.solon.annotation.Configuration; -import org.noear.solon.annotation.Inject; -import org.noear.solon.core.AopContext; - -/** - * 注解 @ConditionalOnClass 不能与 @Bean 放在一起,否则当没有条件中的 Class 时,会出现错误: - * java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy - */ -@Condition(hasClass = JsonKit.class, hasProperty = "${bean-searcher.field-convertor.use-json}=true") -@Configuration -public class JsonFieldConvertorConfig { - @Inject - AopContext context; - - @Bean - public JsonFieldConvertor jsonFieldConvertor(BeanSearcherProperties config) { - if(context.hasWrap(JsonFieldConvertor.class) == false){ - return null; - } - - BeanSearcherProperties.FieldConvertor conf = config.getFieldConvertor(); - return new JsonFieldConvertor(conf.isJsonFailOnError()); - } -} \ No newline at end of file diff --git a/bean-searcher-solon-plugin/src/main/java/cn/zhxu/bs/solon/beans/BeansException.java b/bean-searcher-solon-plugin/src/main/java/cn/zhxu/bs/solon/beans/BeansException.java deleted file mode 100644 index b9f7de6ef142a681c7954a9d1b6cbd13587f129f..0000000000000000000000000000000000000000 --- a/bean-searcher-solon-plugin/src/main/java/cn/zhxu/bs/solon/beans/BeansException.java +++ /dev/null @@ -1,17 +0,0 @@ -package cn.zhxu.bs.solon.beans; - -import org.noear.solon.lang.Nullable; - -/** - * @author noear 2023/2/18 created - */ -public abstract class BeansException extends RuntimeException { - public BeansException(String msg) { - super(msg); - } - - public BeansException(@Nullable String msg, @Nullable Throwable cause) { - super(msg, cause); - } -} - diff --git a/bean-searcher-solon-plugin/src/main/java/cn/zhxu/bs/solon/beans/ObjectFactory.java b/bean-searcher-solon-plugin/src/main/java/cn/zhxu/bs/solon/beans/ObjectFactory.java deleted file mode 100644 index 9f595ac23d4804c9f2cebe8e887ed82cc51d5ac8..0000000000000000000000000000000000000000 --- a/bean-searcher-solon-plugin/src/main/java/cn/zhxu/bs/solon/beans/ObjectFactory.java +++ /dev/null @@ -1,10 +0,0 @@ -package cn.zhxu.bs.solon.beans; - -/** - * @author noear 2023/2/18 created - */ -@FunctionalInterface -public interface ObjectFactory { - T getObject() throws BeansException; -} - diff --git a/bean-searcher-solon-plugin/src/main/java/cn/zhxu/bs/solon/beans/ObjectProvider.java b/bean-searcher-solon-plugin/src/main/java/cn/zhxu/bs/solon/beans/ObjectProvider.java deleted file mode 100644 index a72fd5a2447b785d40e0ab8452dd5c75cb742f33..0000000000000000000000000000000000000000 --- a/bean-searcher-solon-plugin/src/main/java/cn/zhxu/bs/solon/beans/ObjectProvider.java +++ /dev/null @@ -1,60 +0,0 @@ -package cn.zhxu.bs.solon.beans; - -import org.noear.solon.lang.Nullable; - -import java.util.Iterator; -import java.util.function.Consumer; -import java.util.function.Supplier; -import java.util.stream.Stream; - -/** - * @author noear 2023/2/18 created - */ - -public interface ObjectProvider extends ObjectFactory, Iterable { - T getObject(Object... args) throws BeansException; - - @Nullable - T getIfAvailable() throws BeansException; - - default T getIfAvailable(Supplier defaultSupplier) throws BeansException { - T dependency = this.getIfAvailable(); - return dependency != null ? dependency : defaultSupplier.get(); - } - - default void ifAvailable(Consumer dependencyConsumer) throws BeansException { - T dependency = this.getIfAvailable(); - if (dependency != null) { - dependencyConsumer.accept(dependency); - } - - } - - @Nullable - T getIfUnique() throws BeansException; - - default T getIfUnique(Supplier defaultSupplier) throws BeansException { - T dependency = this.getIfUnique(); - return dependency != null ? dependency : defaultSupplier.get(); - } - - default void ifUnique(Consumer dependencyConsumer) throws BeansException { - T dependency = this.getIfUnique(); - if (dependency != null) { - dependencyConsumer.accept(dependency); - } - - } - - default Iterator iterator() { - return this.stream().iterator(); - } - - default Stream stream() { - throw new UnsupportedOperationException("Multi element access not supported"); - } - - default Stream orderedStream() { - throw new UnsupportedOperationException("Ordered element access not supported"); - } -} \ No newline at end of file diff --git a/bean-searcher-solon-plugin/src/main/java/cn/zhxu/bs/solon/integration/XPluginImpl.java b/bean-searcher-solon-plugin/src/main/java/cn/zhxu/bs/solon/integration/XPluginImpl.java index e4d66820971436a87e34770678b54d1755412e44..15530db609d1365ef96a22dffc516c18d90ebb0d 100644 --- a/bean-searcher-solon-plugin/src/main/java/cn/zhxu/bs/solon/integration/XPluginImpl.java +++ b/bean-searcher-solon-plugin/src/main/java/cn/zhxu/bs/solon/integration/XPluginImpl.java @@ -3,12 +3,12 @@ package cn.zhxu.bs.solon.integration; import cn.zhxu.bs.solon.BeanSearcherAutoConfiguration; import cn.zhxu.bs.solon.BeanSearcherProperties; -import cn.zhxu.bs.solon.JsonFieldConvertorConfig; import org.noear.solon.core.AopContext; import org.noear.solon.core.Plugin; /** - * @author noear 2023/2/18 created + * @author noear + * @since 2.1 */ public class XPluginImpl implements Plugin { @Override @@ -18,7 +18,6 @@ public class XPluginImpl implements Plugin { //容器加载完成后再执行,确保用户的 Bean 优先 context.beanOnloaded(x -> { x.beanMake(BeanSearcherAutoConfiguration.class); - x.beanMake(JsonFieldConvertorConfig.class); }); } } diff --git a/pom.xml b/pom.xml index 2552f34201fc2205d59b71f0159aaeaa1f137b2f..10c99ef256ce9f9e23075244323d740ff3955116 100644 --- a/pom.xml +++ b/pom.xml @@ -15,8 +15,8 @@ bean-searcher - bean-searcher-boot-starter bean-searcher-solon-plugin + bean-searcher-boot-starter @@ -25,7 +25,7 @@ 2.0.6 1.4.2 3.0.2 - 2.1.3 + 2.1.4-M1 UTF-8