package com.jxy.marketall.task;

import com.jxy.common.redis.service.RedisService;
import com.jxy.marketall.dto.DailyMsgCountDto;
import com.jxy.marketall.mapper.MessageMapper;
import com.jxy.marketall.vo.QueryVo;
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.List;


/**
 * @Description TODO
 * @Date 2022/7/7 18:03
 * @Author 杜懿
 */
@Configuration
@EnableScheduling
public class MongoTask {

    @Autowired
    private MessageMapper messageMapper;

    @Autowired
    private RedisService redisService;

    /** 数据 */
    //@Scheduled(cron = "0 2 0/8 * * ?")
    @Scheduled(cron = "0 0/2 * * * ?")
    public void DailyMsgCountToRedis(){
        //if(list.size() > 0){
        //    存入redis 先删除原有数据再重新插入数据
            //redisService.deleteObject("dailyMsgCount");
            //redisService.setCacheList("dailyMsgCount",list);
       //}
    }

}
