com.gitee.easyopen.bean.Callers Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of easyopen Show documentation
Show all versions of easyopen Show documentation
一个简单易用的接口开放平台,平台封装了常用的参数校验、结果返回等功能,开发者只需实现业务代码即可。https://gitee.com/durcframework/easyopen
package com.gitee.easyopen.bean;
import com.gitee.easyopen.ApiMeta;
import java.lang.reflect.InvocationTargetException;
/**
* @author tanghc
*/
public class Callers {
public static Object call(ApiMeta apiMeta, Object methodArgu) throws InvocationTargetException, IllegalAccessException {
Object invokeResult;
if (methodArgu == null) {
invokeResult = apiMeta.getMethod().invoke(apiMeta.getHandler());
} else {
invokeResult = apiMeta.getMethod().invoke(apiMeta.getHandler(), methodArgu);
}
return invokeResult;
}
}