记得上下班打卡 | git大法好,push需谨慎

Commit 518c1e00 authored by 张国柄's avatar 张国柄

~config:redis.key+prefix;

parent 614c05f8
......@@ -51,16 +51,12 @@ public abstract class AbstractRedisUtil {
* @param time 时间(秒)
* @return
*/
public boolean expire(String key, long time) {
key = this.fillingKey(key);
private boolean expire(String key, long time) {
if (time > 0) {
this.getRedisConfig().getRedisTemplateByDb(this.getIndex(key)).expire(key, time, TimeUnit.SECONDS);
}
return true;
}
......@@ -71,7 +67,6 @@ public abstract class AbstractRedisUtil {
* @param key 键 不能为null
* @return 时间(秒) 返回0代表为永久有效
*/
public long getExpire(String key) {
key = this.fillingKey(key);
......@@ -85,7 +80,6 @@ public abstract class AbstractRedisUtil {
* @param key 键
* @return true 存在 false不存在
*/
public boolean hasKey(String key) {
key = this.fillingKey(key);
......@@ -111,15 +105,11 @@ public abstract class AbstractRedisUtil {
}
}
/**
* 删除缓存(多db情况需要单独实现批量删除-该方法慎重使用)
*
* @param key 可以传一个值 或多个
*/
@SuppressWarnings("unchecked")
public void del(String... key) {
if (key != null && key.length > 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment