| | |
| | | |
| | | @Override |
| | | public String set(byte[] key, byte[] value) { |
| | | redisTemplate.opsForValue().set(key, value); |
| | | redisTemplate.opsForValue().set(new String(key), value); |
| | | return ""; |
| | | } |
| | | |
| | |
| | | public String set(String key, String value, String nxxx, String expx, int time) { |
| | | // redisTemplate.opsForValue().set(key, value,nxxx,expx,time); |
| | | // return ""; |
| | | return redisTemplate.execute(new RedisCallback() { |
| | | Object ext = redisTemplate.execute(new RedisCallback() { |
| | | public String doInRedis(RedisConnection connection) { |
| | | //redis.clients.jedis.Jedis jedis = (redis.clients.jedis.Jedis) connection.getNativeConnection(); |
| | | Object nativeConnection = connection.getNativeConnection(); |
| | |
| | | } |
| | | return ""; |
| | | } |
| | | }, true).toString(); |
| | | }, true); |
| | | if (ext == null) { |
| | | return ""; |
| | | } |
| | | return ext.toString(); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | @Override |
| | | public byte[] get(byte[] key) { |
| | | Object value = redisTemplate.opsForValue().get(key); |
| | | Object value = redisTemplate.opsForValue().get(new String(key)); |
| | | if (value == null) { |
| | | return null; |
| | | } |
| | |
| | | |
| | | @Override |
| | | public Long del(byte[] key) { |
| | | redisTemplate.delete(key); |
| | | redisTemplate.delete(new String(key)); |
| | | return 1L; |
| | | } |
| | | |