package com.fuint.common.job;

import com.fuint.common.service.AlertService;
import com.xxl.job.core.handler.annotation.XxlJob;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;

@Configuration
public class ScheduleTask {

    private AlertService alertService;

    public ScheduleTask(AlertService alertService) {
        this.alertService = alertService;
    }

    // 每天23:30执行
//    @Scheduled( cron = "*/10 * * * * *")
    @XxlJob("dailySalesCheck")
    public void dailySalesCheck() {
        alertService.checkDailySalesAndAlert();
    }
}