|
|
|
@ -2,11 +2,14 @@ package com.fr.plugin.db.redis.util;
|
|
|
|
|
|
|
|
|
|
import com.eclipsesource.v8.V8Object; |
|
|
|
|
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.plugin.db.redis.help.ScriptBridge; |
|
|
|
|
import com.fr.stable.ParameterProvider; |
|
|
|
|
import redis.clients.jedis.Jedis; |
|
|
|
|
|
|
|
|
|
import java.lang.reflect.InvocationTargetException; |
|
|
|
|
import java.lang.reflect.Method; |
|
|
|
|
import java.util.HashMap; |
|
|
|
|
import java.util.Map; |
|
|
|
@ -20,6 +23,7 @@ public class RedisUtils {
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 关闭redis客户端 |
|
|
|
|
* |
|
|
|
|
* @param jedis redis客户端对象 |
|
|
|
|
*/ |
|
|
|
|
public static void close(Jedis jedis) { |
|
|
|
@ -49,4 +53,20 @@ public class RedisUtils {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static String getName(Object target) { |
|
|
|
|
if (target == null) { |
|
|
|
|
return StringKit.EMPTY; |
|
|
|
|
} |
|
|
|
|
try { |
|
|
|
|
Method method = target.getClass().getMethod("getName"); |
|
|
|
|
return GeneralKit.objectToString(method.invoke(target)); |
|
|
|
|
} catch (NoSuchMethodException e) { |
|
|
|
|
return StringKit.EMPTY; |
|
|
|
|
} catch (IllegalAccessException e) { |
|
|
|
|
return StringKit.EMPTY; |
|
|
|
|
} catch (InvocationTargetException e) { |
|
|
|
|
return StringKit.EMPTY; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|