package cn.ey.biz.module.system.dal.redis.contract;

import com.alibaba.fastjson.JSON;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Repository;
import javax.annotation.Resource;
import java.util.Map;
import java.util.Set;

@Repository
public class ContractRedisDAO {

    @Resource
    private StringRedisTemplate stringRedisTemplate;

    public  final String CONTRACT_USER_SL = "SYSTEM.CONTRACT_USER_SL";

    public void updateArchivedEP(Map<String,Object> map) {
        Set<String> keys = map.keySet();
        for(String key:keys){
            Object value = map.get(key);
            stringRedisTemplate.opsForValue().set(CONTRACT_USER_SL+key,JSON.toJSONString(value));
        }
    }

    public String getRedisSl(String  Name) {
          return  stringRedisTemplate.opsForValue().get(CONTRACT_USER_SL+Name);
    }


}
