包名小写

main
wenhua.zhou 2 years ago
parent cca355204b
commit 71e8495a28

@ -7,19 +7,17 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import java.text.SimpleDateFormat;
import java.util.Date;
@Component
@Slf4j
public class MyTimerTask {
// private static final Logger logger = LoggerFactory.getLogger(MyTimerTask.class);
public class ReportSchedule {
// private static final Logger logger = LoggerFactory.getLogger(ReportSchedule.class);
@Autowired
MqttServiceImpl mqttServiceimpl;
@Scheduled(initialDelay = 1000, fixedRate = 1000 * 3600) //通过@Scheduled声明该方法是计划任务使用fixedRate属性每隔固定时间执行
public void init() {
log.info("运行定时任务:{}", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
public void reportRecord() {
log.info("运行定时任务");
mqttServiceimpl.reportRecord();
}
Loading…
Cancel
Save