新增查看授权信息

This commit is contained in:
2021-12-07 22:31:33 +08:00
parent 3eec3a51a3
commit dbb7e3ea68
5 changed files with 36 additions and 12 deletions

View File

@@ -17,6 +17,7 @@ import java.util.Set;
public class RedisTools {
public static final int QQBOT_USER = 3;
private static boolean isNotInstallRedis = false;
private static String host;
private static int port;
@@ -78,11 +79,11 @@ public class RedisTools {
}
public static boolean set(Object key, String value) {
return set(3, key+"", value);
return set(QQBOT_USER, key+"", value);
}
public static boolean set(String key, String value, long timeout) {
return set(key, value, timeout,3);
return set(key, value, timeout,QQBOT_USER);
}
public static String get(String key, int dbIndex) {
@@ -102,11 +103,11 @@ public class RedisTools {
}
public static String get(Object key) {
return get(key+"", 3);
return get(key+"", QQBOT_USER);
}
public static boolean remove(String key) {
return remove(key,3);
return remove(key,QQBOT_USER);
}
public static void removeLoginState(String uid) {
@@ -127,7 +128,7 @@ public class RedisTools {
return tmp;
}
public static boolean exists(Object key,String value){
return exists(3,key,value);
return exists(QQBOT_USER,key,value);
}
public static boolean exists(int db,Object key, String value) {
if (isNotInstallRedis) {
@@ -194,13 +195,9 @@ public class RedisTools {
}
public static void pullMsg(String channel, String msg) {
Log.i("1");
Jedis jedis = getPoolRedis();
Log.i("2");
jedis.publish(channel, msg);
Log.i("3");
jedis.close();
Log.i("4");
}
private static boolean init = false;