优化
This commit is contained in:
parent
930427d639
commit
80d0b0ee8d
@ -1,14 +1,17 @@
|
|||||||
package com.xkrs.common;
|
package com.xkrs.common;
|
||||||
|
|
||||||
import com.xkrs.straw.utils.FirePointSubscribeManager;
|
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.context.annotation.Configuration;
|
||||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||||
import org.springframework.scheduling.annotation.Scheduled;
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新订阅计划任务
|
* 定时任务
|
||||||
*/
|
*/
|
||||||
@Configuration
|
@Configuration
|
||||||
@EnableScheduling
|
@EnableScheduling
|
||||||
@ -23,4 +26,16 @@ public class StaticScheduleTask {
|
|||||||
firePointSubscribeManager.autoSync();
|
firePointSubscribeManager.autoSync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//每小时更新一次订阅
|
||||||
|
@Scheduled(cron = "0 0 * * * ?")
|
||||||
|
private void testPushWeiXinMessage() {
|
||||||
|
try {
|
||||||
|
WDWxSendMsgUtil.sendMsg("18447024917@chatroom", "微信发消息测试 " + DateTimeUtils.localDateTimeToString(LocalDateTime.now()), 0);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user