package com.game.business.task;

import com.game.business.service.IAppGameItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class AppGameItemTask {

    @Autowired
    private IAppGameItemService appGameItemService;

    @Value("${task.switch}")
    private Boolean taskSwitch;

    @Scheduled(cron = "0 0 0 * * ?")
    public void appGameItemTask(){
        if(!taskSwitch){
            return;
        }
        appGameItemService.emptyLotteryCount();
    }
}
