From b9b037c273b76a3d686e6f876ab98600f7818db0 Mon Sep 17 00:00:00 2001 From: lau572 <1010031226@qq.com> Date: Mon, 17 Jun 2024 17:53:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=81=E4=B8=9A=E5=BE=AE=E4=BF=A1redis?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ruoyi/common/core/redis/RedisCache.java | 11 +++++++++++ .../com/zc/business/constant/RedisKeyConstants.java | 6 ++++++ 2 files changed, 17 insertions(+) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/redis/RedisCache.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/redis/RedisCache.java index f79ddf43..2f468cb8 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/redis/RedisCache.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/redis/RedisCache.java @@ -67,6 +67,17 @@ public class RedisCache return redisTemplate.expire(key, timeout, unit); } + /** + * 获取剩余有效时间 + * + * @param key Redis键 + * @return 剩余时间 + */ + public Long getExpire(final String key) + { + return redisTemplate.getExpire(key); + } + /** * 获得缓存的基本对象。 * diff --git a/zc-business/src/main/java/com/zc/business/constant/RedisKeyConstants.java b/zc-business/src/main/java/com/zc/business/constant/RedisKeyConstants.java index 573eb12b..cddabc1c 100644 --- a/zc-business/src/main/java/com/zc/business/constant/RedisKeyConstants.java +++ b/zc-business/src/main/java/com/zc/business/constant/RedisKeyConstants.java @@ -39,4 +39,10 @@ public class RedisKeyConstants * 监控物联服务器 */ public static final String MONITOR_IOT_SERVER = "monitor:iotServer:"; + + + /** + * 企业微信access_token + */ + public static final String QYWX_ACCESS_TOKEN = "qywx:accessToken"; }