| | |
| | | package com.gs.dingtalk.task; |
| | | |
| | | |
| | | import com.gs.dingtalk.service.SendDingtalkService; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | |
| | | @Component |
| | | @RequiredArgsConstructor |
| | | public class ScheduledTasks { |
| | | |
| | | private SendDingtalkService sendDingtalkService; |
| | | |
| | | /** |
| | | * 每五分钟执行一次 |
| | |
| | | * @date 2024/9/27 21:48 |
| | | */ |
| | | @Scheduled(cron = "0 0/5 * * * ?") |
| | | public void getDeviceRealTimeData() { |
| | | public void getDeviceRealTimeData() throws Exception { |
| | | sendDingtalkService.sendDingTalkFiveMinute(); |
| | | } |
| | | |
| | | //0/5 * * * * ? * |
| | | @Scheduled(cron = "0/5 * * * * ?") |
| | | public void chatSendMessage() throws Exception { |
| | | sendDingtalkService.chatSendMessage(); |
| | | } |
| | | |
| | | @Scheduled(cron = "0 0/30 * * * ?") |
| | | public void sendDingTalkthirtyMinute() throws Exception { |
| | | sendDingtalkService.sendDingTalkthirtyMinute(); |
| | | } |
| | | } |