From 4d156ad861b7c877f86ae8ad6827f78615a732b7 Mon Sep 17 00:00:00 2001 From: Yutousama <583819556@qq.com> Date: Fri, 22 Apr 2022 00:05:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B6=A9=E5=9B=BE=E6=A8=A1=E5=9D=97=EF=BC=9A?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=AF=8F=E6=97=A5=E7=BB=9F=E8=AE=A1=E6=B2=A1?= =?UTF-8?q?=E6=95=88=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/yutou/qqbot/models/setu/GetSeTu.java | 3 ++- src/main/java/com/yutou/qqbot/utlis/RedisTools.java | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/yutou/qqbot/models/setu/GetSeTu.java b/src/main/java/com/yutou/qqbot/models/setu/GetSeTu.java index 8766ee7..55a18e0 100644 --- a/src/main/java/com/yutou/qqbot/models/setu/GetSeTu.java +++ b/src/main/java/com/yutou/qqbot/models/setu/GetSeTu.java @@ -42,7 +42,7 @@ public class GetSeTu extends Model { super.onTime(qq, time); if ("00:00:00".equals(time)) { del(); - } else if ("23:59:00".equals(time)) { + } else if (RedisTools.get("Setu_time","23:59:00").equals(time)) { send(); } } @@ -62,6 +62,7 @@ public class GetSeTu extends Model { redis.select(RedisTools.QQBOT_USER); Set keys = redis.keys("Setu_*"); redis.close(); + Log.i("进入涩图打印"); for (String key : keys) { String ret = RedisTools.get(key); MessageChainBuilder builder = null; diff --git a/src/main/java/com/yutou/qqbot/utlis/RedisTools.java b/src/main/java/com/yutou/qqbot/utlis/RedisTools.java index 2808695..6608e9b 100644 --- a/src/main/java/com/yutou/qqbot/utlis/RedisTools.java +++ b/src/main/java/com/yutou/qqbot/utlis/RedisTools.java @@ -106,6 +106,14 @@ public class RedisTools { return get(key+"", QQBOT_USER); } + public static String get(Object key,String defValue){ + String ret=get(key); + if(StringUtils.isEmpty(ret)){ + return defValue; + } + return ret; + } + public static boolean remove(String key) { return remove(key,QQBOT_USER); }