package com.changhong.epc.form.execute.impl;
|
|
import com.changhong.autoform.core.tool.MD5;
|
import com.changhong.epc.constter.system.SystemClients;
|
import com.changhong.epc.constter.system.run.EpcRestInterface;
|
import com.iemsoft.framework.cloud.core.base.ResMsg;
|
import com.iemsoft.framework.cloud.core.tools.JSONTool;
|
import com.iemsoft.framework.cloud.core.tools.SpringUtil;
|
import com.iemsoft.framework.cloud.ribbon.RestInterface;
|
|
import java.util.HashMap;
|
import java.util.Map;
|
|
public class ConstantMdCode implements SystemClients{
|
|
private static Map<String, Object> cache = new HashMap<>();
|
public Object getPostRest(String url,Map<String,Object> parm){
|
String key = MD5.toMD5(JSONTool.toJson(parm)+url);
|
if(cache.get(key) != null){
|
return cache.get(key);
|
}
|
RestInterface restInterface = SpringUtil.getBean(SERVER_ADMIN.getBeanName(), RestInterface.class);
|
Object data = restInterface.post(url, parm, ResMsg.class, EpcRestInterface.getEpcHeads()).getData();
|
cache.put(key, data);
|
return data;
|
}
|
}
|