|  | @@ -0,0 +1,42 @@
 | 
	
		
			
				|  |  | +package com.fs.app.task;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +import com.fs.common.core.redis.RedisCache;
 | 
	
		
			
				|  |  | +import com.fs.course.mapper.FsCourseWatchLogMapper;
 | 
	
		
			
				|  |  | +import com.fs.course.service.IFsCourseWatchLogService;
 | 
	
		
			
				|  |  | +import lombok.extern.slf4j.Slf4j;
 | 
	
		
			
				|  |  | +import org.springframework.beans.factory.annotation.Autowired;
 | 
	
		
			
				|  |  | +import org.springframework.scheduling.annotation.Scheduled;
 | 
	
		
			
				|  |  | +import org.springframework.stereotype.Component;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +@Component
 | 
	
		
			
				|  |  | +@Slf4j
 | 
	
		
			
				|  |  | +public class UserCourseWatchCountTask {
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    @Autowired
 | 
	
		
			
				|  |  | +    private FsCourseWatchLogMapper courseWatchLogMapper;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    @Autowired
 | 
	
		
			
				|  |  | +    RedisCache redisCache;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    @Autowired
 | 
	
		
			
				|  |  | +    private IFsCourseWatchLogService courseWatchLogService;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    /**
 | 
	
		
			
				|  |  | +     * 每天两点进行会员看课统计
 | 
	
		
			
				|  |  | +     */
 | 
	
		
			
				|  |  | +    @Scheduled(cron = "0 0 2 * * ?")  // 2点0分0秒执行
 | 
	
		
			
				|  |  | +    public void userCourseCountTask() {
 | 
	
		
			
				|  |  | +        try {
 | 
	
		
			
				|  |  | +            log.info("会员看课统计任务执行----------开始");
 | 
	
		
			
				|  |  | +            //
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            log.info("会员看课统计任务执行----------结束");
 | 
	
		
			
				|  |  | +        } catch (Exception e) {
 | 
	
		
			
				|  |  | +            log.error("会员看课统计任务执行----------定时任务执行失败", e);
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +}
 |