|
@ -0,0 +1,13 @@ |
|
|
|
|
|
package com.iflytop.gd.app.service.scheduled; |
|
|
|
|
|
|
|
|
|
|
|
import org.springframework.scheduling.annotation.Scheduled; |
|
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
|
|
|
@Service |
|
|
|
|
|
public class FetchTemperatureScheduledTask { |
|
|
|
|
|
@Scheduled(fixedRate = 30000) |
|
|
|
|
|
public void fetchTemperature() { |
|
|
|
|
|
System.out.println("Fetching temperature task is running: " + System.currentTimeMillis()); |
|
|
|
|
|
// 任务逻辑 |
|
|
|
|
|
} |
|
|
|
|
|
} |