|
|
@ -5,6 +5,7 @@ import com.fanruan.api.data.ConnectionKit; |
|
|
|
import com.fanruan.api.util.StringKit; |
|
|
|
import com.fanruan.api.util.StringKit; |
|
|
|
import com.fr.data.impl.Connection; |
|
|
|
import com.fr.data.impl.Connection; |
|
|
|
import com.fr.decision.fun.impl.AbstractUniversalServerTableDataProvider; |
|
|
|
import com.fr.decision.fun.impl.AbstractUniversalServerTableDataProvider; |
|
|
|
|
|
|
|
import com.fr.decision.privilege.TransmissionTool; |
|
|
|
import com.fr.json.JSONObject; |
|
|
|
import com.fr.json.JSONObject; |
|
|
|
import com.fr.plugin.db.redis.bean.ParameterBean; |
|
|
|
import com.fr.plugin.db.redis.bean.ParameterBean; |
|
|
|
import com.fr.plugin.db.redis.core.RedisConstants; |
|
|
|
import com.fr.plugin.db.redis.core.RedisConstants; |
|
|
@ -15,6 +16,7 @@ import com.fr.plugin.db.redis.core.script.EngineType; |
|
|
|
import com.fr.plugin.db.redis.util.RedisUtils; |
|
|
|
import com.fr.plugin.db.redis.util.RedisUtils; |
|
|
|
import com.fr.script.Calculator; |
|
|
|
import com.fr.script.Calculator; |
|
|
|
import com.fr.stable.NameReference; |
|
|
|
import com.fr.stable.NameReference; |
|
|
|
|
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
import com.fr.web.struct.Atom; |
|
|
|
import com.fr.web.struct.Atom; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -44,7 +46,7 @@ public class RedisScriptUniversalTableDataImpl extends AbstractUniversalServerTa |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
data.put(RedisConstants.ORDER, redisScriptTableData.getOrderValue().getValue()); |
|
|
|
data.put(RedisConstants.ORDER, redisScriptTableData.getOrderValue().getValue()); |
|
|
|
} |
|
|
|
} |
|
|
|
data.put(RedisConstants.SCRIPT, redisScriptTableData.getScript()); |
|
|
|
data.put(RedisConstants.SCRIPT, TransmissionTool.encrypt(redisScriptTableData.getScript()).replaceAll(System.getProperty("line.separator"), StringUtils.EMPTY)); |
|
|
|
data.put(RedisConstants.ENGINE, redisScriptTableData.getEngineType().getType()); |
|
|
|
data.put(RedisConstants.ENGINE, redisScriptTableData.getEngineType().getType()); |
|
|
|
data.put(RedisConstants.PARAMETERS, ParameterBean.createParameterBeans(redisScriptTableData.getParameters(Calculator.createCalculator()))); |
|
|
|
data.put(RedisConstants.PARAMETERS, ParameterBean.createParameterBeans(redisScriptTableData.getParameters(Calculator.createCalculator()))); |
|
|
|
return data; |
|
|
|
return data; |
|
|
@ -54,7 +56,7 @@ public class RedisScriptUniversalTableDataImpl extends AbstractUniversalServerTa |
|
|
|
public RedisScriptTableData deserialize(RedisScriptTableData oldTableData, JSONObject data) { |
|
|
|
public RedisScriptTableData deserialize(RedisScriptTableData oldTableData, JSONObject data) { |
|
|
|
RedisScriptTableData newTableData = new RedisScriptTableData(); |
|
|
|
RedisScriptTableData newTableData = new RedisScriptTableData(); |
|
|
|
String databaseName = data.getString(RedisConstants.DATABASE); |
|
|
|
String databaseName = data.getString(RedisConstants.DATABASE); |
|
|
|
String script = data.getString(RedisConstants.SCRIPT); |
|
|
|
String script = TransmissionTool.decrypt(data.getString(RedisConstants.SCRIPT)); |
|
|
|
if (StringKit.isNotEmpty(databaseName) && ConnectionKit.getConnection(databaseName) != null) { |
|
|
|
if (StringKit.isNotEmpty(databaseName) && ConnectionKit.getConnection(databaseName) != null) { |
|
|
|
newTableData.setDatabase(ConnectionKit.createNameConnection(databaseName)); |
|
|
|
newTableData.setDatabase(ConnectionKit.createNameConnection(databaseName)); |
|
|
|
} |
|
|
|
} |
|
|
|