You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
1014 B

11 months ago
package com.yingji.quartz;
import com.yingji.service.AccidentService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.transaction.annotation.Transactional;
11 months ago
import javax.annotation.Resource;
/**
* 120
*
* @author wu
* @since 2024/5/10 10:05
*/
@Configuration
@Transactional(rollbackFor = Exception.class)
11 months ago
public class AccidentQuartz {
public static final Logger log = LoggerFactory.getLogger(AccidentQuartz.class);
@Resource
private AccidentService accidentService;
@Async
@Scheduled(cron = "*/10 * * * * ? ")
11 months ago
public void savaData() {
String accessToken = accidentService.getAuthorizeToken();
accidentService.getAccidentUrl(accessToken);
log.info("=================120定时任务结束===============");
}
}