|
@@ -41,7 +41,8 @@ public class RedisUtil {
|
|
* @param o
|
|
* @param o
|
|
*/
|
|
*/
|
|
public void setOrg(Long orgId, Object o) {
|
|
public void setOrg(Long orgId, Object o) {
|
|
- redisTemplate.opsForValue().set(SystemConstant.ORG + orgId, o, SystemConstant.REDIS_EXPIRE_TIME, TimeUnit.SECONDS);
|
|
|
|
|
|
+ redisTemplate.opsForValue()
|
|
|
|
+ .set(SystemConstant.ORG + orgId, o, SystemConstant.REDIS_EXPIRE_TIME, TimeUnit.SECONDS);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -80,7 +81,8 @@ public class RedisUtil {
|
|
* @param o
|
|
* @param o
|
|
*/
|
|
*/
|
|
public void setOrgCode(String orgCode, Object o) {
|
|
public void setOrgCode(String orgCode, Object o) {
|
|
- redisTemplate.opsForValue().set(SystemConstant.ORG + orgCode, o, SystemConstant.REDIS_EXPIRE_TIME, TimeUnit.SECONDS);
|
|
|
|
|
|
+ redisTemplate.opsForValue()
|
|
|
|
+ .set(SystemConstant.ORG + orgCode, o, SystemConstant.REDIS_EXPIRE_TIME, TimeUnit.SECONDS);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -146,7 +148,8 @@ public class RedisUtil {
|
|
* @param o
|
|
* @param o
|
|
*/
|
|
*/
|
|
public void setUser(Long userId, Object o) {
|
|
public void setUser(Long userId, Object o) {
|
|
- redisTemplate.opsForValue().set(SystemConstant.USER + userId, o, SystemConstant.REDIS_EXPIRE_TIME, TimeUnit.SECONDS);
|
|
|
|
|
|
+ redisTemplate.opsForValue()
|
|
|
|
+ .set(SystemConstant.USER + userId, o, SystemConstant.REDIS_EXPIRE_TIME, TimeUnit.SECONDS);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -225,7 +228,6 @@ public class RedisUtil {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* 设置hash
|
|
* 设置hash
|
|
*
|
|
*
|
|
@@ -297,7 +299,7 @@ public class RedisUtil {
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
public void releaseLock(String key) {
|
|
public void releaseLock(String key) {
|
|
- redisTemplate.expire(key, 100, TimeUnit.MILLISECONDS);
|
|
|
|
|
|
+ redisTemplate.expire(key, 0, TimeUnit.MILLISECONDS);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -379,7 +381,8 @@ public class RedisUtil {
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
public Integer getRedisSequence() {
|
|
public Integer getRedisSequence() {
|
|
- RedisAtomicInteger entityIdCounter = new RedisAtomicInteger(SystemConstant.REDIS_MONITOR_SEQUENCE, redisTemplate.getConnectionFactory());
|
|
|
|
|
|
+ RedisAtomicInteger entityIdCounter = new RedisAtomicInteger(SystemConstant.REDIS_MONITOR_SEQUENCE,
|
|
|
|
+ redisTemplate.getConnectionFactory());
|
|
return entityIdCounter.incrementAndGet();
|
|
return entityIdCounter.incrementAndGet();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -390,7 +393,8 @@ public class RedisUtil {
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
public Integer getRedisActivityCodeSequence(Long key) {
|
|
public Integer getRedisActivityCodeSequence(Long key) {
|
|
- RedisAtomicInteger entityIdCounter = new RedisAtomicInteger(SystemConstant.REDIS_ACTIVITY_CODE_SEQUENCE + key, redisTemplate.getConnectionFactory());
|
|
|
|
|
|
+ RedisAtomicInteger entityIdCounter = new RedisAtomicInteger(SystemConstant.REDIS_ACTIVITY_CODE_SEQUENCE + key,
|
|
|
|
+ redisTemplate.getConnectionFactory());
|
|
return entityIdCounter.incrementAndGet();
|
|
return entityIdCounter.incrementAndGet();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -402,7 +406,8 @@ public class RedisUtil {
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
public Integer setRedisActivityCodeSequence(Long key, int initialValue) {
|
|
public Integer setRedisActivityCodeSequence(Long key, int initialValue) {
|
|
- RedisAtomicInteger entityIdCounter = new RedisAtomicInteger(SystemConstant.REDIS_ACTIVITY_CODE_SEQUENCE + key, redisTemplate.getConnectionFactory(), initialValue);
|
|
|
|
|
|
+ RedisAtomicInteger entityIdCounter = new RedisAtomicInteger(SystemConstant.REDIS_ACTIVITY_CODE_SEQUENCE + key,
|
|
|
|
+ redisTemplate.getConnectionFactory(), initialValue);
|
|
return entityIdCounter.get();
|
|
return entityIdCounter.get();
|
|
}
|
|
}
|
|
|
|
|