package com.jxy.system.task;

import com.jxy.common.redis.service.RedisService;
import com.jxy.system.mapper.SysUserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;

import java.util.Map;

/**
 * @Description TODO
 * @Date 2023/8/7 14:57
 * @Author 杜懿
 */
@Configuration
@EnableScheduling
public class TestTask {

    @Autowired
    private RedisService redisService;

    @Autowired
    private SysUserMapper sysUserMapper;

    //@Scheduled(cron = "0 24 0/4 * * ?")
    //@Scheduled(cron = "0 0/1 * * * ?")
    public void CapRealData(){


        Map<Long, String> map = sysUserMapper.getUserInfoMap();

        System.out.println("所有用户数据："+map);

        System.out.println(map.get(15));

        System.out.println(map.get(32));
        //if(list.size() > 0){
        //    redisService.deleteObject("CapRealData");
        //    redisService.setCacheList("CapRealData",list);
        //}
    }

}
