From 0f65031aea13d5ba54cf8bb4e8352766fb5e7f6e Mon Sep 17 00:00:00 2001 From: zhouhao Date: Tue, 25 Jan 2022 11:03:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hsweb-core/pom.xml | 15 +++++++++++++++ .../web/starter/jackson/CustomTypeFactory.java | 9 +++++---- .../hsweb-system-authorization-api/pom.xml | 6 ++++++ 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/hsweb-core/pom.xml b/hsweb-core/pom.xml index 4b139f724..a52747697 100644 --- a/hsweb-core/pom.xml +++ b/hsweb-core/pom.xml @@ -20,18 +20,22 @@ javassist 3.28.0-GA + com.fasterxml.jackson.core jackson-databind + org.hswebframework hsweb-utils + org.springframework spring-context + org.springframework spring-web @@ -106,5 +110,16 @@ reactor-extra + + com.google.guava + guava + + + + jctools-core + org.jctools + 2.1.2 + + \ No newline at end of file diff --git a/hsweb-starter/src/main/java/org/hswebframework/web/starter/jackson/CustomTypeFactory.java b/hsweb-starter/src/main/java/org/hswebframework/web/starter/jackson/CustomTypeFactory.java index 16036ece2..5813e1df9 100644 --- a/hsweb-starter/src/main/java/org/hswebframework/web/starter/jackson/CustomTypeFactory.java +++ b/hsweb-starter/src/main/java/org/hswebframework/web/starter/jackson/CustomTypeFactory.java @@ -4,6 +4,7 @@ import com.fasterxml.jackson.databind.JavaType; import com.fasterxml.jackson.databind.type.*; import com.fasterxml.jackson.databind.util.ArrayBuilders; import com.fasterxml.jackson.databind.util.LRUMap; +import com.fasterxml.jackson.databind.util.LookupCache; import org.hswebframework.web.api.crud.entity.EntityFactory; public class CustomTypeFactory extends TypeFactory { @@ -11,18 +12,18 @@ public class CustomTypeFactory extends TypeFactory { private EntityFactory entityFactory; public CustomTypeFactory(EntityFactory factory) { - super(new LRUMap<>(64, 1024)); + super((LookupCache)new LRUMap<>(64, 1024)); this.entityFactory = factory; } - protected CustomTypeFactory(LRUMap typeCache, TypeParser p, + protected CustomTypeFactory(LookupCache typeCache, TypeParser p, TypeModifier[] mods, ClassLoader classLoader) { super(typeCache, p, mods, classLoader); } @Override - public TypeFactory withCache(LRUMap cache) { + public TypeFactory withCache(LookupCache cache) { return new CustomTypeFactory(cache, _parser, _modifiers, _classLoader); } @@ -33,7 +34,7 @@ public class CustomTypeFactory extends TypeFactory { @Override public TypeFactory withModifier(TypeModifier mod) { - LRUMap typeCache = _typeCache; + LookupCache typeCache = _typeCache; TypeModifier[] mods; if (mod == null) { // mostly for unit tests mods = null; diff --git a/hsweb-system/hsweb-system-authorization/hsweb-system-authorization-api/pom.xml b/hsweb-system/hsweb-system-authorization/hsweb-system-authorization-api/pom.xml index 09ea0ad14..ea917461f 100644 --- a/hsweb-system/hsweb-system-authorization/hsweb-system-authorization-api/pom.xml +++ b/hsweb-system/hsweb-system-authorization/hsweb-system-authorization-api/pom.xml @@ -34,6 +34,12 @@ commons-codec commons-codec + + org.hswebframework.web + hsweb-commons-crud + ${project.version} + compile + \ No newline at end of file