yeg
6 天以前 a04222c873e5e55f48c8d33b5c0bc46fa524ac8d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package com.battery.business.runtime;
 
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import com.battery.business.service.ITestDataReceptionService;
 
/**
 * 按固定周期触发数据接收,由业务服务按测试接收状态和采样来源保存成功观测。
 *
 * <p>它不限定 profile:真实来源的接收路径也必须在非开发 profile 下运行。
 * 开发模拟器专属的调度(模拟器发现轮询、采集器状态同步)仍只在 dev-simulator 下额外启用。
 */
@Component
public class TestDataReceptionScheduler
{
    private final ITestDataReceptionService reception;
 
    public TestDataReceptionScheduler(ITestDataReceptionService reception) { this.reception = reception; }
 
    /** 每秒触发一次数据接收,由业务服务保存成功观测;只推进请求和保存,不向设备发送控制命令。 */
    @Scheduled(fixedDelay = 1000)
    public void capture() { reception.captureReceivedData(); }
}