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