package ink.wgink.common.rpc.rest.proxy;

import ink.wgink.common.rpc.rest.handler.RestRemoteHandler;

import java.lang.reflect.Proxy;

/**
 * @ClassName: RestRemoteProxy
 * @Description: Rest远程调用代理
 * @Author: wanggeng
 * @Date: 2021/9/18 5:40 下午
 * @Version: 1.0
 */
public class RestRemoteProxy {

    public static <T> T getInstance(Class<T> cls) {
        RestRemoteHandler restRemoteHandler = new RestRemoteHandler();
        Object o = Proxy.newProxyInstance(cls.getClassLoader(), new Class[]{cls}, restRemoteHandler);
        return (T) o;
    }

}
