cjl
2023-12-14 b157e41411b77abcbb0e9d3d59fabc1d951b47ad
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*
package com.moral.api.task;
 
import com.moral.api.utils.WcharTest;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
 
import java.awt.*;
import java.util.Date;
 
*/
/**
 * @ClassName jobTask
 * @Description TODO
 * @Author @cjl
 * @Date 2023-12-07 15:08
 * @Version 1.0
 *//*
 
@Component
@EnableScheduling
@Slf4j
public class jobTask {
    @Scheduled(cron = "0/20 * * * * ?")
    public void startTask(){
        String friendNickName = "文件传输助手";// "文件传输助手";
        String msg="系统正在定时播报,每二十秒播报一次";
        try {
            WcharTest.sendMsgforSp(friendNickName,msg);
        } catch (Exception e) {
            log.error("error result ",e);
            throw new RuntimeException(e);
        }
        System.out.println("每隔20秒执行一次:" + new Date());
    }
}
*/