package cn.pluss.platform.job;

import cn.pluss.platform.mapper.UserRewardInfoMapper;
import cn.pluss.platform.userApp.UserAppService;
import cn.pluss.platform.userAreaRewardFlow.UserAreaRewardFlowService;
import cn.pluss.platform.userRewardInfo.UserRewardInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.Scheduled;

import javax.annotation.Resource;

/**
 *
 *统计用户区域奖励
 *@author: bzg
 *@time: 2022/2/28 17:19
 */
@Slf4j
@Configuration
@ConditionalOnProperty(prefix = "scheduling", name = "enabled", havingValue = "true")
public class CalcUserAreaRewardJob {


    @Resource
    private UserAreaRewardFlowService userAreaRewardFlowService;


    @Scheduled(cron = "0 5 0 * * ?")
    public void calcUserAreaRewardTask(){
        log.info("~~~~~~~~统计用户区域奖励定时任务开始~~~~~~~~~~~~~");
        userAreaRewardFlowService.calcUserAreaRewardFlow();
        log.info("~~~~~~~~统计用户区域奖励定时任务结束~~~~~~~~~~~~");
    }
}
