package com.hb.proj.gather.rep; import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.redis.core.HashOperations; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.stereotype.Component; /** * 采集数据在redis中的持久化 * @author cwen * */ @Component public class RedisRepComponent { @Autowired private RedisTemplate redisTemplate; /** * 实时数据入redis * @param wellId * @param datas */ public void put(String wellId,Map datas) { HashOperations ops=redisTemplate.opsForHash(); ops.putAll(wellId, datas); } }