package com.vincent.rsf.openApi.tv; import lombok.extern.slf4j.Slf4j; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; import javax.annotation.Resource; /** * 定时拉 RCS 站点数据写入 Redis,电视机侧沿用既有 WebSocket 推送 */ @Slf4j @Component @ConditionalOnProperty(prefix = "tv-monitor.rcs-station-poll", name = "enabled", havingValue = "true") public class TvRcsStationPollSchedule { @Resource private TvRcsStationPollService tvRcsStationPollService; @Scheduled(cron = "${tv-monitor.rcs-station-poll.cron:0/5 * * * * ?}") public void pollRcsStationToTvRedis() { tvRcsStationPollService.pollOnce(); } }