From ee3e392a7590c8c0daf66c4b49cc6884b57dd2d5 Mon Sep 17 00:00:00 2001
From: chenjiahe <763432473@qq.com>
Date: 星期四, 11 八月 2022 12:00:32 +0800
Subject: [PATCH] 新增redisson的方法

---
 src/main/java/com/platform/verification/ApplicationTool.java |   23 +++++++++++++++++++++++
 pom.xml                                                      |    6 ++++++
 2 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/pom.xml b/pom.xml
index d9081a6..0f8534c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -22,6 +22,12 @@
             <version>1.0-SNAPSHOT</version>
         </dependency>
 
+        <dependency>
+            <groupId>com.hx.gitee</groupId>
+            <artifactId>hx-redisson</artifactId>
+            <version>1.0-SNAPSHOT</version>
+        </dependency>
+
     </dependencies>
 
     <build>
diff --git a/src/main/java/com/platform/verification/ApplicationTool.java b/src/main/java/com/platform/verification/ApplicationTool.java
index 1d35829..1d8c13e 100644
--- a/src/main/java/com/platform/verification/ApplicationTool.java
+++ b/src/main/java/com/platform/verification/ApplicationTool.java
@@ -3,6 +3,7 @@
 
 import com.alibaba.fastjson.JSONObject;
 import com.hx.redis.RedisUtil;
+import com.hx.redisson.config.RedissonUtil;
 import com.hx.util.DateUtil;
 import com.hx.util.StringUtils;
 import com.hx.util.rsa.RSAUtil;
@@ -41,4 +42,26 @@
         return application;
     }
 
+    /**鑾峰彇搴旂敤鍦╮edis涓婇潰鐨勬暟鎹�
+     * @param appId 鐢ㄦ埛鐨凙PPID `
+     * @param redissonUtil RedissonUtil
+     * @return
+     */
+    public static ThirtApplication jsonToEntity(String appId, RedissonUtil redissonUtil){
+
+        if (StringUtils.isEmpty(appId)) {
+            return null;
+        }
+
+        JSONObject thirtApplication = (JSONObject) redissonUtil.get(appId);
+
+        //鏍¢獙appid鏄惁瀛樺湪
+        if(thirtApplication == null){
+            return null;
+        }
+        ThirtApplication application = JSONObject.parseObject(thirtApplication.toString(),ThirtApplication.class);
+
+        return application;
+    }
+
 }

--
Gitblit v1.8.0