完善BT下载器,机器人可以控制刷新下载了

This commit is contained in:
yutou
2021-04-08 15:40:59 +08:00
parent 07a239ab1e
commit bdc74957aa
17 changed files with 89 additions and 59 deletions

View File

@@ -41,7 +41,7 @@ public class RedisTools {
Jedis jedis = getRedis();
jedis.select(dbIndex);
String ret = jedis.set(key, value);
System.out.println("Redis set =" + ret);
com.yutou.nas.utils.Log.i("Redis set =" + ret);
jedis.close();
} catch (Exception e) {
// TODO: handle exception
@@ -176,13 +176,13 @@ public class RedisTools {
}
public static void pullMsg(String channel, String msg) {
System.out.println("1");
com.yutou.nas.utils.Log.i("1");
Jedis jedis = getPoolRedis();
System.out.println("2");
com.yutou.nas.utils.Log.i("2");
jedis.publish(channel, msg);
System.out.println("3");
com.yutou.nas.utils.Log.i("3");
jedis.close();
System.out.println("4");
com.yutou.nas.utils.Log.i("4");
}
private static boolean init = false;
@@ -191,7 +191,7 @@ public class RedisTools {
if (init)
return;
init = true;
System.out.println("初始化订阅");
com.yutou.nas.utils.Log.i("初始化订阅");
new Thread(new Runnable() {
@Override
public void run() {
@@ -207,7 +207,7 @@ public class RedisTools {
@Override
public void onPMessage(String pattern, String channel, String message) {
super.onPMessage(pattern, channel, message);
System.out.println("onPMessage: channel=" + channel + " msg=" + message + " pattern=" + pattern);
com.yutou.nas.utils.Log.i("onPMessage: channel=" + channel + " msg=" + message + " pattern=" + pattern);
switch (channel) {
case "system":
switch (message) {
@@ -234,7 +234,7 @@ public class RedisTools {
@Override
public void onMessage(String channel, String message) {
super.onMessage(channel, message);
System.out.println("onMessage: channel=" + channel + " msg=" + message);
com.yutou.nas.utils.Log.i("onMessage: channel=" + channel + " msg=" + message);
}
public static void system(String type, String value) {
@@ -288,9 +288,9 @@ public class RedisTools {
} catch (Exception e) {
e.printStackTrace();
}
System.out.println("cmd > " + str);
com.yutou.nas.utils.Log.i("cmd > " + str);
QQBotManager.getInstance().sendMessage(str.toString());
System.out.println("线程结束");
com.yutou.nas.utils.Log.i("线程结束");
}
public static void main(String[] args) {
RedisTools.pullMsg("msg", "abc");