package com.zhongshu.card.server.core.time;

import com.zhongshu.card.server.core.service.visitor.VisitorMainService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @author TRX
 * @date 2025/2/11
 */
@Slf4j
@EnableScheduling
@Component
public class SchedulOneHour {

    @Autowired
    private VisitorMainService visitorMainService;

    // 每小时
    @Scheduled(cron = "0 0 */1 * * ?")
    public void execute() {
        log.info("every hour");
        visitorMainService.loopCheckVisitorData();
    }

}
