package com.liquidnet.client.admin.zhengzai.sweet.utils;

import com.liquidnet.common.cache.redis.util.RedisUtil;
import com.liquidnet.service.sweet.constant.SweetConstant;
import com.liquidnet.service.sweet.dto.vo.IntegralActivityVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class SweetRedisAdminUtils {

    @Autowired
    private MongoTemplate mongoTemplate;
    @Autowired
    private RedisUtil redisUtil;

    public void setIntegralActivityList(List<IntegralActivityVo> voList) {
        String redisKey = SweetConstant.REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_LIST;
        boolean set = redisUtil.set(redisKey, voList, 15);
    }
    public void setIntegralActivityInfo(IntegralActivityVo integralActivityVo) {
        String redisKey = SweetConstant.REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_INFO.concat(integralActivityVo.getIntegralActivityId());
        boolean set = redisUtil.set(redisKey, integralActivityVo, 15);
    }

}
