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 +++++++++++++++++++++++ 1 files changed, 23 insertions(+), 0 deletions(-) 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