From 0fea532b07be89978343cb4aede3693af99f5656 Mon Sep 17 00:00:00 2001
From: Your Name <you@example.com>
Date: 星期二, 25 七月 2023 23:04:41 +0800
Subject: [PATCH] Merge branch 'master' of http://git.homecommunity.cn/supervip/MicroCommunity

---
 java110-utils/src/main/java/com/java110/utils/cache/CommonCache.java |   44 +++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 43 insertions(+), 1 deletions(-)

diff --git a/java110-utils/src/main/java/com/java110/utils/cache/CommonCache.java b/java110-utils/src/main/java/com/java110/utils/cache/CommonCache.java
old mode 100644
new mode 100755
index 153b1e7..051e6ae
--- a/java110-utils/src/main/java/com/java110/utils/cache/CommonCache.java
+++ b/java110-utils/src/main/java/com/java110/utils/cache/CommonCache.java
@@ -1,13 +1,29 @@
 package com.java110.utils.cache;
 
-import redis.clients.jedis.Jedis;
+import com.java110.utils.util.DateUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import com.java110.utils.cache.Jedis;
 
 /**
  * Created by wuxw on 2018/5/5.
  */
 public class CommonCache extends BaseCache {
 
+    private final static Logger logger = LoggerFactory.getLogger(MappingCache.class);
+
     public final static int defaultExpireTime = 5 * 60;
+    public final static int RESEND_DEFAULT_EXPIRETIME = 1 * 60;
+
+    public final static int DEFAULT_EXPIRETIME_TWO_MIN = 1 * 60;
+
+
+    //鏀粯榛樿鍥炶瘽
+    public final static int PAY_DEFAULT_EXPIRE_TIME = 2 * 60 * 60;
+
+    public static final String RECEIPT_CODE = "_RECEIPT_CODE";// 鏀舵嵁缂栧彿
+
+
 
     /**
      * 鑾峰彇鍊�(鐢ㄦ埛ID)
@@ -16,6 +32,8 @@
      */
     public static String getValue(String key) {
         Jedis redis = null;
+        long startTime = DateUtil.getCurrentDate().getTime();
+
         try {
             redis = getJedis();
             return redis.get(key);
@@ -23,6 +41,7 @@
             if (redis != null) {
                 redis.close();
             }
+            logger.debug( key + " redis 鑰楁椂锛�" + (DateUtil.getCurrentDate().getTime() - startTime));
         }
     }
 
@@ -34,6 +53,8 @@
     public static String getAndRemoveValue(String key) {
         Jedis redis = null;
         String value = "";
+        long startTime = DateUtil.getCurrentDate().getTime();
+
         try {
             redis = getJedis();
             value = redis.get(key);
@@ -42,6 +63,8 @@
             if (redis != null) {
                 redis.close();
             }
+            logger.debug( key + "getAndRemoveValue redis 鑰楁椂锛�" + (DateUtil.getCurrentDate().getTime() - startTime));
+
         }
         return value;
     }
@@ -65,6 +88,25 @@
 
     }
 
+
+    /**
+     * 淇濆瓨鏁版嵁
+     *
+     * @param key
+     */
+    public static void setValue(String key, String value) {
+        Jedis redis = null;
+        try {
+            redis = getJedis();
+            redis.set(key, value);
+        } finally {
+            if (redis != null) {
+                redis.close();
+            }
+        }
+
+    }
+
     /**
      * 鍒犻櫎璁板綍
      *

--
Gitblit v1.8.0