|
|
|
@ -5,6 +5,7 @@ import com.fanruan.api.data.ConnectionKit;
|
|
|
|
|
import com.fanruan.api.util.StringKit; |
|
|
|
|
import com.fr.data.impl.Connection; |
|
|
|
|
import com.fr.decision.fun.impl.AbstractUniversalServerTableDataProvider; |
|
|
|
|
import com.fr.decision.privilege.TransmissionTool; |
|
|
|
|
import com.fr.json.JSONObject; |
|
|
|
|
import com.fr.plugin.db.redis.bean.ParameterBean; |
|
|
|
|
import com.fr.plugin.db.redis.core.RedisConstants; |
|
|
|
@ -44,7 +45,7 @@ public class RedisScriptUniversalTableDataImpl extends AbstractUniversalServerTa
|
|
|
|
|
} else { |
|
|
|
|
data.put(RedisConstants.ORDER, redisScriptTableData.getOrderValue().getValue()); |
|
|
|
|
} |
|
|
|
|
data.put(RedisConstants.SCRIPT, redisScriptTableData.getScript()); |
|
|
|
|
data.put(RedisConstants.SCRIPT, TransmissionTool.encrypt(redisScriptTableData.getScript())); |
|
|
|
|
data.put(RedisConstants.ENGINE, redisScriptTableData.getEngineType().getType()); |
|
|
|
|
data.put(RedisConstants.PARAMETERS, ParameterBean.createParameterBeans(redisScriptTableData.getParameters(Calculator.createCalculator()))); |
|
|
|
|
return data; |
|
|
|
@ -54,7 +55,7 @@ public class RedisScriptUniversalTableDataImpl extends AbstractUniversalServerTa
|
|
|
|
|
public RedisScriptTableData deserialize(RedisScriptTableData oldTableData, JSONObject data) { |
|
|
|
|
RedisScriptTableData newTableData = new RedisScriptTableData(); |
|
|
|
|
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) { |
|
|
|
|
newTableData.setDatabase(ConnectionKit.createNameConnection(databaseName)); |
|
|
|
|
} |
|
|
|
|