forked from fanruan/design
Fangjie Hu
8 years ago
3 changed files with 16 additions and 60 deletions
@ -1,37 +0,0 @@
|
||||
package com.fr.dependservice; |
||||
|
||||
import com.fr.base.FRContext; |
||||
import com.fr.general.FRLogger; |
||||
import com.fr.plugin.dependence.PluginServiceCreator; |
||||
|
||||
import java.util.HashMap; |
||||
|
||||
/** |
||||
* Created by hufan on 2016/9/9. |
||||
*/ |
||||
public abstract class PluginService implements PluginServiceCreator { |
||||
@Override |
||||
public String remoteServiceAction(String req) throws Exception { |
||||
HashMap<String, String> para = new HashMap<String, String>(); |
||||
para.put("op", "fr_remote_design"); |
||||
para.put("cmd", "design_get_plugin_service_data"); |
||||
para.put("serviceID", getServiceID()); |
||||
para.put("req", req); |
||||
return PluginServiceUtils.getDataFormRemote(para); |
||||
} |
||||
/** |
||||
* 服务ID |
||||
* @return |
||||
*/ |
||||
protected abstract String getServiceID(); |
||||
|
||||
/** |
||||
* 获取数据 |
||||
* @param req |
||||
* @return |
||||
*/ |
||||
@Override |
||||
public String fetchServiceData(String req) throws Exception { |
||||
return FRContext.getCurrentEnv().pluginServiceAction(this, req); |
||||
} |
||||
} |
@ -1,18 +0,0 @@
|
||||
package com.fr.dependservice; |
||||
|
||||
import com.fr.base.FRContext; |
||||
import com.fr.env.RemoteEnv; |
||||
import com.fr.general.IOUtils; |
||||
|
||||
import java.io.InputStream; |
||||
import java.util.HashMap; |
||||
|
||||
/** |
||||
* Created by hufan on 2016/9/9. |
||||
*/ |
||||
public class PluginServiceUtils { |
||||
public static String getDataFormRemote(HashMap<String, String> para) throws Exception { |
||||
InputStream inputStream = ((RemoteEnv)FRContext.getCurrentEnv()).getDataFormRemote(para); |
||||
return IOUtils.inputStream2String(inputStream); |
||||
} |
||||
} |
Loading…
Reference in new issue