public class DefaultApiClient extends Object
| 限定符和类型 | 方法和说明 |
|---|---|
protected void |
afterDoExecute(GtApiProxyFactory.ApiParam apiParam,
Map<String,Object> header,
String body,
String result)
调用接口后调用此方法
|
protected void |
beforeExecute(GtApiProxyFactory.ApiParam apiParam,
Map<String,Object> header,
String body)
执行http调用之前调用此方法
|
static DefaultApiClient |
build(GtApiConfiguration apiConfiguration,
IJson json) |
void |
close()
释放
cache中的对象,但是此对象仍然可以使用,直到没有内存引用被回收 |
ApiResult<?> |
execute(GtApiProxyFactory.ApiParam apiParam)
1.
|
protected void |
handleException(GtApiProxyFactory.ApiParam apiParam,
Map<String,Object> header,
String body,
ApiException e)
调用远程接口报错后调用此方法
|
protected void |
postExecute(GtApiProxyFactory.ApiParam apiParam,
Map<String,Object> header,
String body,
String result)
调用远程接口后调用此方法,如果报错则不会调用
|
void |
setAuthApiAndAuth(AuthApi authApi) |
void |
setJson(IJson json) |
public static DefaultApiClient build(GtApiConfiguration apiConfiguration, IJson json)
protected void beforeExecute(GtApiProxyFactory.ApiParam apiParam, Map<String,Object> header, String body)
apiParam - 请求参数header - 请求headerbody - 请求bodypublic ApiResult<?> execute(GtApiProxyFactory.ApiParam apiParam)
apiParam - protected void postExecute(GtApiProxyFactory.ApiParam apiParam, Map<String,Object> header, String body, String result)
apiParam - http请求的参数header - http请求的headerbody - http请求的bodyprotected void handleException(GtApiProxyFactory.ApiParam apiParam, Map<String,Object> header, String body, ApiException e)
apiParam - http请求的参数header - http请求的headerbody - http请求的bodye - http请求抛出的异常protected void afterDoExecute(GtApiProxyFactory.ApiParam apiParam, Map<String,Object> header, String body, String result)
apiParam - http请求的参数header - http请求的headerbody - http请求的bodyresult - http请求的返回值public void setJson(IJson json)
public void close()
cache中的对象,但是此对象仍然可以使用,直到没有内存引用被回收public void setAuthApiAndAuth(AuthApi authApi)
Copyright © 2022. All rights reserved.