Application.java
1.14 KB
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 vion;
import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import vion.third.DingMod;
@SpringBootApplication
@MapperScan("vion.mapper")
@EnableScheduling
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
@Autowired
private DingMod dingMod;
private final static Logger logger = LoggerFactory.getLogger(Application.class);
@Scheduled(cron = "${third.run.cron:0 0 2 * * ?}")
public void startJob() {
try {
logger.info("启动");
//定时获取钉钉用户列表
dingMod.getDeptList();
dingMod.getDingUserList();
logger.info("启动完成");
} catch (Exception e) {
e.printStackTrace();
}
}
}