package com.gs.xky.task; import com.gs.xky.service.XkyService; import lombok.RequiredArgsConstructor; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; import java.io.IOException; @Component @RequiredArgsConstructor public class ScheduledTasks { private final XkyService xkyService; /** * 每五分钟执行一次 * 获取设备最近的一条记录 * * @return void * @author tjx * @description TODO * @date 2024/9/27 21:48 */ @Scheduled(cron = "0 0/5 * * * ?") public void getDeviceRealTimeData() throws IOException { xkyService.GetSaveDetail(); } }