替换Jedis-使用RedissonClient的StringCodec编解码器
This commit is contained in:
@@ -1,21 +0,0 @@
|
||||
package com.accompany.common.redis;
|
||||
|
||||
public class RedisScript {
|
||||
|
||||
//params 红包map的key 红包索引的 key 领取者的key uid 红包id 到期时间
|
||||
//返回状态 -1 已经领取 -2过期
|
||||
public static final String RECIVE_RED_PACKET = "local uid = ARGV[1] " + "local reId = ARGV[2] "
|
||||
+ "local indexKey = KEYS[1] " + "local mapKey = KEYS[2] " + "local reciveKey = KEYS[3] "
|
||||
+ "local expire = ARGV[3] " + " " + "local hasRecive = redis.call('get',reciveKey) "
|
||||
+ "if hasRecive == false or hasRecive == nil then "
|
||||
+ " local redIndex = redis.call('rpop',indexKey) " + " "
|
||||
+ " if redIndex== false or redIndex == nil then " + " return -2 " + " else "
|
||||
+ " local value = redis.call('hget',mapKey,redIndex) "
|
||||
+ " if value == false or value == nil then " + " return -2 " + " end "
|
||||
+ " redis.call('hdel',mapKey,redIndex) " + " redis.call('set',reciveKey,uid) "
|
||||
+ " redis.call('expireat',reciveKey,expire) " + " return value " + " end "
|
||||
+ "else " + " return -1 " + "end ";
|
||||
|
||||
public static final int RECIVE_RED_PACKET_KEY_COUNT = 3;
|
||||
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@@ -141,7 +141,7 @@ public class PrivatePhotoService extends BaseService{
|
||||
}
|
||||
|
||||
private void deletePhotoCache(Long pid, Long uid) {
|
||||
jedisService.hdelete(RedisKey.private_photo.getKey() + uid, String.valueOf(pid), null);
|
||||
jedisService.hdelete(RedisKey.private_photo.getKey() + uid, String.valueOf(pid));
|
||||
jedisService.hdel(RedisKey.user_summary.getKey(), uid.toString());
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user