commit | author | age
|
a18bfa
|
1 |
package com.changhong.epc.form.execute.impl; |
Z |
2 |
|
|
3 |
import com.changhong.autoform.core.tool.MD5; |
|
4 |
import com.changhong.epc.constter.system.SystemClients; |
|
5 |
import com.changhong.epc.constter.system.run.EpcRestInterface; |
|
6 |
import com.iemsoft.framework.cloud.core.base.ResMsg; |
|
7 |
import com.iemsoft.framework.cloud.core.tools.JSONTool; |
|
8 |
import com.iemsoft.framework.cloud.core.tools.SpringUtil; |
|
9 |
import com.iemsoft.framework.cloud.ribbon.RestInterface; |
|
10 |
|
|
11 |
import java.util.HashMap; |
|
12 |
import java.util.Map; |
|
13 |
|
|
14 |
public class ConstantMdCode implements SystemClients{ |
|
15 |
|
|
16 |
private static Map<String, Object> cache = new HashMap<>(); |
|
17 |
public Object getPostRest(String url,Map<String,Object> parm){ |
|
18 |
String key = MD5.toMD5(JSONTool.toJson(parm)+url); |
|
19 |
if(cache.get(key) != null){ |
|
20 |
return cache.get(key); |
|
21 |
} |
|
22 |
RestInterface restInterface = SpringUtil.getBean(SERVER_ADMIN.getBeanName(), RestInterface.class); |
|
23 |
Object data = restInterface.post(url, parm, ResMsg.class, EpcRestInterface.getEpcHeads()).getData(); |
|
24 |
cache.put(key, data); |
|
25 |
return data; |
|
26 |
} |
|
27 |
} |