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