This commit is contained in:
liuchengqian 2023-03-07 20:26:26 +08:00
parent 930427d639
commit 80d0b0ee8d

View File

@ -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();
}
}
}