From 1af53ffcffe21574285a8c46dceddabbd46762b9 Mon Sep 17 00:00:00 2001 From: richie Date: Tue, 12 Nov 2019 14:40:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=9B=86=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/plugin/db/redis/bean/ParameterBean.java | 7 +++---- .../java/com/fr/plugin/db/redis/util/RedisUtils.java | 11 +++++------ 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/fr/plugin/db/redis/bean/ParameterBean.java b/src/main/java/com/fr/plugin/db/redis/bean/ParameterBean.java index adabb39..53614ca 100644 --- a/src/main/java/com/fr/plugin/db/redis/bean/ParameterBean.java +++ b/src/main/java/com/fr/plugin/db/redis/bean/ParameterBean.java @@ -1,7 +1,6 @@ package com.fr.plugin.db.redis.bean; import com.fanruan.api.util.StringKit; -import com.fr.base.ParameterTypeHandler; import com.fr.stable.ParameterProvider; import java.util.ArrayList; @@ -12,12 +11,12 @@ import java.util.List; * @version 10.0.4 * Created by Elijah on 2019/10/30 */ -public class ParameterBean{ +public class ParameterBean { public static final String TYPE = "type"; public static final String NAME = "name"; public static final String VALUE = "value"; - private String type = ParameterTypeHandler.String.name(); + private String type = "String"; private String name; private String value; @@ -69,7 +68,7 @@ public class ParameterBean{ public static List createParameterBeans(ParameterProvider[] parameterProviders) { List parameterBeans = new ArrayList(); - for (ParameterProvider parameterProvider: parameterProviders) { + for (ParameterProvider parameterProvider : parameterProviders) { parameterBeans.add(ParameterBean.createBean(parameterProvider)); } return parameterBeans; diff --git a/src/main/java/com/fr/plugin/db/redis/util/RedisUtils.java b/src/main/java/com/fr/plugin/db/redis/util/RedisUtils.java index 8a52b93..15257fa 100644 --- a/src/main/java/com/fr/plugin/db/redis/util/RedisUtils.java +++ b/src/main/java/com/fr/plugin/db/redis/util/RedisUtils.java @@ -6,7 +6,6 @@ import com.fanruan.api.util.ArrayKit; import com.fanruan.api.util.GeneralKit; import com.fanruan.api.util.RenderKit; import com.fanruan.api.util.StringKit; -import com.fr.base.Parameter; import com.fr.json.JSONArray; import com.fr.plugin.db.redis.core.order.OrderValue; import com.fr.plugin.db.redis.help.ScriptBridge; @@ -74,18 +73,18 @@ public class RedisUtils { } } - public static ParameterProvider[] analyzeParameter(JSONArray existParameters, OrderValue orderValue, String ...parameterTexts) { - Parameter[] oldParameters = new Parameter[existParameters.size()]; + public static ParameterProvider[] analyzeParameter(JSONArray existParameters, OrderValue orderValue, String... parameterTexts) { + ParameterProvider[] oldParameters = new ParameterProvider[existParameters.size()]; for (int i = 0; i < existParameters.size(); i++) { - oldParameters[i] = Parameter.getParameterFromJson(existParameters.getJSONObject(i)); + oldParameters[i] = ParameterKit.json2Parameter(existParameters.getJSONObject(i)); } ParameterProvider[] newParameters = ParameterKit.analyzeAndUnionSameParameters(parameterTexts, oldParameters); ParameterProvider[] newOrderParameters = orderValue.analyze4Parameters(); Map parameterProviderMap = new HashMap(); - for (ParameterProvider parameterProvider: oldParameters) { + for (ParameterProvider parameterProvider : oldParameters) { parameterProviderMap.put(parameterProvider.getName(), parameterProvider); } - for (ParameterProvider parameterProvider: newOrderParameters) { + for (ParameterProvider parameterProvider : newOrderParameters) { if (parameterProviderMap.containsKey(parameterProvider.getName())) { parameterProvider.setValue(parameterProviderMap.get(parameterProvider.getName()).getValue()); }