提交 | 用户 | age
|
a51ba7
|
1 |
package com.platform.verification; |
C |
2 |
|
|
3 |
|
|
4 |
import com.alibaba.fastjson.JSONObject; |
|
5 |
import com.hx.redis.RedisUtil; |
ee3e39
|
6 |
import com.hx.redisson.config.RedissonUtil; |
a51ba7
|
7 |
import com.hx.util.DateUtil; |
C |
8 |
import com.hx.util.StringUtils; |
|
9 |
import com.hx.util.rsa.RSAUtil; |
|
10 |
import com.platform.entity.ThirtApplication; |
|
11 |
import com.platform.resultTool.PlatformCode; |
|
12 |
import com.platform.resultTool.PlatformResult; |
|
13 |
|
|
14 |
import java.text.SimpleDateFormat; |
|
15 |
import java.util.Date; |
|
16 |
|
|
17 |
/**应用转化 |
|
18 |
* @author CJH |
|
19 |
* @date 2021-10-20 |
|
20 |
*/ |
|
21 |
public class ApplicationTool { |
|
22 |
|
|
23 |
/**获取应用在redis上面的数据 |
|
24 |
* @param appId 用户的APPID ` |
|
25 |
* @param redisUtil redisUtil |
|
26 |
* @return |
|
27 |
*/ |
|
28 |
public static ThirtApplication jsonToEntity(String appId, RedisUtil redisUtil){ |
|
29 |
|
|
30 |
if (StringUtils.isEmpty(appId)) { |
|
31 |
return null; |
|
32 |
} |
|
33 |
|
|
34 |
JSONObject thirtApplication = (JSONObject) redisUtil.get(appId); |
|
35 |
|
|
36 |
//校验appid是否存在 |
|
37 |
if(thirtApplication == null){ |
|
38 |
return null; |
|
39 |
} |
|
40 |
ThirtApplication application = JSONObject.parseObject(thirtApplication.toString(),ThirtApplication.class); |
|
41 |
|
|
42 |
return application; |
|
43 |
} |
|
44 |
|
ee3e39
|
45 |
/**获取应用在redis上面的数据 |
C |
46 |
* @param appId 用户的APPID ` |
|
47 |
* @param redissonUtil RedissonUtil |
|
48 |
* @return |
|
49 |
*/ |
|
50 |
public static ThirtApplication jsonToEntity(String appId, RedissonUtil redissonUtil){ |
|
51 |
|
|
52 |
if (StringUtils.isEmpty(appId)) { |
|
53 |
return null; |
|
54 |
} |
|
55 |
|
|
56 |
JSONObject thirtApplication = (JSONObject) redissonUtil.get(appId); |
|
57 |
|
|
58 |
//校验appid是否存在 |
|
59 |
if(thirtApplication == null){ |
|
60 |
return null; |
|
61 |
} |
|
62 |
ThirtApplication application = JSONObject.parseObject(thirtApplication.toString(),ThirtApplication.class); |
|
63 |
|
|
64 |
return application; |
|
65 |
} |
|
66 |
|
a51ba7
|
67 |
} |