From 80d0b0ee8d19142a2f48bfdf2cc568e1d6d2e5c9 Mon Sep 17 00:00:00 2001 From: liuchengqian Date: Tue, 7 Mar 2023 20:26:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/xkrs/common/StaticScheduleTask.java | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/xkrs/common/StaticScheduleTask.java b/src/main/java/com/xkrs/common/StaticScheduleTask.java index d6e2fc0..b3b7289 100644 --- a/src/main/java/com/xkrs/common/StaticScheduleTask.java +++ b/src/main/java/com/xkrs/common/StaticScheduleTask.java @@ -1,14 +1,17 @@ package com.xkrs.common; import com.xkrs.straw.utils.FirePointSubscribeManager; +import com.xkrs.utils.DateTimeUtils; +import com.xkrs.utils.WDWxSendMsgUtil; import org.springframework.context.annotation.Configuration; import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.scheduling.annotation.Scheduled; import javax.annotation.Resource; +import java.time.LocalDateTime; /** - * 更新订阅计划任务 + * 定时任务 */ @Configuration @EnableScheduling @@ -23,4 +26,16 @@ public class StaticScheduleTask { firePointSubscribeManager.autoSync(); } + //每小时更新一次订阅 + @Scheduled(cron = "0 0 * * * ?") + private void testPushWeiXinMessage() { + try { + WDWxSendMsgUtil.sendMsg("18447024917@chatroom", "微信发消息测试 " + DateTimeUtils.localDateTimeToString(LocalDateTime.now()), 0); + } catch (Exception e) { + e.printStackTrace(); + } + + } + + } \ No newline at end of file