package org.springblade.gateway.login_gateway.scheduled;

import lombok.extern.slf4j.Slf4j;
import org.springblade.gateway.common_gateway.util.PlatformSettingUtil;
import org.springblade.sing.user.service.ILoginUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;

/**
 * @Author: Silent
 * @Description
 * @Date: Created in 11:30 2021/11/10
 * @Modified By:
 */
//@Component
@Slf4j
public class UserScheduled {
	@Autowired
	private ILoginUserService loginUserService;
	@Autowired
	private PlatformSettingUtil platformSettingUtil;

	@Scheduled(cron = "0 0 0 * * ?")
	public void updateUserVote(){
//		ActiveSettingDto activeSetting = platformSettingUtil.getActiveSetting();
//		if(ObjectUtils.isNotEmpty(activeSetting) && ObjectUtils.isNotEmpty(activeSetting.getUserFreeVoteCount())){
//			loginUserService.update(Wrappers.<LoginUser>lambdaUpdate().set(LoginUser::getVoteCount,activeSetting));
//		}else{
//			log.warn("没有找到活动配置，无法更用户每天票数...");
//		}
	}
}
