/**
 * Copyright 2008-2009. Chongqing Communications Industry Services Co.,Ltd Information Technology Branch. All rights reserved.
 * <a>http://www.crunii.com</a>
 */
package com.crunii.micro.service.sysmgr.task;

import com.crunii.micro.service.sysmgr.service.LoginService;
import com.crunii.micro.service.sysmgr.service.ThemeService;
import com.crunii.micro.service.sysmgr.service.VisitLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author shenhs create 2023/7/12 17:21
 */
@Component
public class SysTask {

	@Autowired
	private LoginService loginService;

	@Autowired
	private VisitLogService visitLogService;

	@Scheduled(cron = "0 0/2 * * * ?")
	public void saveLoginLog(){
		loginService.saveLoginLog();
	}

	@Scheduled(cron = "0 0/2 * * * ?")
	public void saveTsmPageVisitLog(){
		visitLogService.saveTsmPageVisitLog();
	}

	@Scheduled(cron = "0 0 1 * * ?")
	public void cleanLog(){
		visitLogService.cleanLog();
	}
}
