Compare commits
No commits in common. "af54377bb263880b4b1dfc74b55e77c24bbe3e82" and "08bbd247a4e16d3c82e958d00a613ea8fff69be3" have entirely different histories.
af54377bb2
...
08bbd247a4
@ -6,7 +6,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|||||||
|
|
||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
public class QQBotApplication {
|
public class QQBotApplication {
|
||||||
public static final String version="QQBot v.1.3.2";
|
public static final String version="QQBot v.1.3.1";
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
System.out.println("version = " + version);
|
System.out.println("version = " + version);
|
||||||
SpringApplication.run(QQBotApplication.class, args);
|
SpringApplication.run(QQBotApplication.class, args);
|
||||||
|
@ -14,7 +14,6 @@ import java.io.IOException;
|
|||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
@ -138,11 +137,9 @@ public class RedisTools {
|
|||||||
jedis.close();
|
jedis.close();
|
||||||
return tmp;
|
return tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean exists(Object key,String value){
|
public static boolean exists(Object key,String value){
|
||||||
return exists(QQBOT_USER,key,value);
|
return exists(QQBOT_USER,key,value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean exists(int db,Object key, String value) {
|
public static boolean exists(int db,Object key, String value) {
|
||||||
if (isNotInstallRedis) {
|
if (isNotInstallRedis) {
|
||||||
return false;
|
return false;
|
||||||
@ -188,45 +185,13 @@ public class RedisTools {
|
|||||||
|
|
||||||
public static boolean list_isExist(String listName, String value) {
|
public static boolean list_isExist(String listName, String value) {
|
||||||
Jedis jedis = getRedis();
|
Jedis jedis = getRedis();
|
||||||
|
jedis.select(QQBOT_USER);
|
||||||
boolean flag = jedis.sismember(listName, value);
|
boolean flag = jedis.sismember(listName, value);
|
||||||
jedis.close();
|
jedis.close();
|
||||||
return flag;
|
return flag;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getHashMap(String hashKey, String key) {
|
|
||||||
Jedis jedis = getRedis();
|
|
||||||
return jedis.hget(hashKey, key);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Map<String, String> getHashMap(String hashKey) {
|
|
||||||
return getRedis().hgetAll(hashKey);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean setHashMap(String hashKey, String key, String value) {
|
|
||||||
Jedis jedis = getRedis();
|
|
||||||
long l = jedis.hsetnx(hashKey, key, value);
|
|
||||||
jedis.close();
|
|
||||||
return l > 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean removeHashMap(String hashKey, String key) {
|
|
||||||
Jedis jedis = getRedis();
|
|
||||||
long l = jedis.hdel(hashKey, key);
|
|
||||||
jedis.close();
|
|
||||||
return l > 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean removeHashMap(String hashKey) {
|
|
||||||
Jedis jedis = getRedis();
|
|
||||||
long del = jedis.del(hashKey);
|
|
||||||
return del > 0;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Jedis getRedis() {
|
public static Jedis getRedis() {
|
||||||
Jedis jedis = new Jedis(host, port);
|
return new Jedis(host, port);
|
||||||
jedis.select(QQBOT_USER);
|
|
||||||
return jedis;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean remove(String key, int index) {
|
public static boolean remove(String key, int index) {
|
||||||
@ -235,9 +200,13 @@ public class RedisTools {
|
|||||||
}
|
}
|
||||||
Jedis jedis = getRedis();
|
Jedis jedis = getRedis();
|
||||||
jedis.select(index);
|
jedis.select(index);
|
||||||
long i = jedis.del(key);
|
Long i = jedis.del(key);
|
||||||
jedis.close();
|
jedis.close();
|
||||||
return i > 0;
|
if (i > 0) {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class PropertyUtil {
|
private static class PropertyUtil {
|
||||||
@ -355,6 +324,7 @@ public class RedisTools {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static void bot(String value) {
|
public static void bot(String value) {
|
||||||
switch (value) {
|
switch (value) {
|
||||||
case "getip":
|
case "getip":
|
||||||
@ -365,11 +335,9 @@ public class RedisTools {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void processOut(InputStream inputStream) {
|
public static void processOut(InputStream inputStream) {
|
||||||
processOut(inputStream,null,true);
|
processOut(inputStream,null,true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void processOut(InputStream inputStream, ObjectInterface objectInterface, boolean isOutQQBot){
|
public static void processOut(InputStream inputStream, ObjectInterface objectInterface, boolean isOutQQBot){
|
||||||
String tmp;
|
String tmp;
|
||||||
StringBuilder str = new StringBuilder();
|
StringBuilder str = new StringBuilder();
|
||||||
@ -391,7 +359,6 @@ public class RedisTools {
|
|||||||
QQBotManager.getInstance().sendMessage(str.toString());
|
QQBotManager.getInstance().sendMessage(str.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
RedisTools.pullMsg("msg", "abc");
|
RedisTools.pullMsg("msg", "abc");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user