1234567891011121314151617181920212223242526272829 |
- 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<String,String> redisTemplate;
-
- /**
- * 实时数据入redis
- * @param wellId
- * @param datas
- */
- public void put(String wellId,Map<String,String> datas) {
- HashOperations<String, String, String> ops=redisTemplate.opsForHash();
- ops.putAll(wellId, datas);
- }
- }
|