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 SchedulEarlyMorning {

    @Autowired
    private VisitorMainService visitorMainService;

    // 每天凌晨1点执行
    @Scheduled(cron = "0 0 1 * * ?")
    public void executeMorning() {
        log.info("Early Morning");
        visitorMainService.loopCheckVisitorData();
    }

}
