|
|
@@ -1,6 +1,6 @@
|
|
|
package com.shkpr.service.customgateway.zydma.manager;
|
|
|
|
|
|
-import com.shkpr.service.customgateway.zydma.components.IotCollector;
|
|
|
+import com.shkpr.service.customgateway.zydma.components.DataCollector;
|
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
|
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
@@ -8,21 +8,21 @@ import org.springframework.stereotype.Component;
|
|
|
import javax.annotation.PostConstruct;
|
|
|
|
|
|
/**
|
|
|
- * 物联网管理
|
|
|
+ * 数据管理
|
|
|
*
|
|
|
* @author 欧阳劲驰
|
|
|
* @serial 1.0.0
|
|
|
*/
|
|
|
@Component
|
|
|
-public class IotManager {
|
|
|
+public class DataManager {
|
|
|
final
|
|
|
ThreadPoolTaskExecutor taskScheduler;
|
|
|
final
|
|
|
- IotCollector iotCollector;
|
|
|
+ DataCollector dataCollector;
|
|
|
|
|
|
- public IotManager(ThreadPoolTaskExecutor taskScheduler, IotCollector iotCollector) {
|
|
|
+ public DataManager(ThreadPoolTaskExecutor taskScheduler, DataCollector dataCollector) {
|
|
|
this.taskScheduler = taskScheduler;
|
|
|
- this.iotCollector = iotCollector;
|
|
|
+ this.dataCollector = dataCollector;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -30,8 +30,8 @@ public class IotManager {
|
|
|
*/
|
|
|
@PostConstruct
|
|
|
public void init() {
|
|
|
- //采集流量数据
|
|
|
- taskScheduler.execute(() -> iotCollector.collectFlow(4 * 24));
|
|
|
+ //采集物联网平台
|
|
|
+ taskScheduler.execute(() -> dataCollector.collectIotPlatform(4 * 24));
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -39,7 +39,7 @@ public class IotManager {
|
|
|
*/
|
|
|
@Scheduled(cron = "0 */15 0,6,12,18 * * ?")
|
|
|
public void minuteTask() {
|
|
|
- //采集流量数据
|
|
|
- taskScheduler.execute(() -> iotCollector.collectFlow(2 * 6));
|
|
|
+ //采集物联网平台
|
|
|
+ taskScheduler.execute(() -> dataCollector.collectIotPlatform(2 * 6));
|
|
|
}
|
|
|
}
|