public abstract class PLAbstractService extends Object
POLYV直播相关的接口调用基础类
| 限定符和类型 | 字段和说明 |
|---|---|
protected static String |
CONTENTS_TAG |
protected static String |
DELETE_METHOD |
protected static String |
GET_METHOD |
protected static String |
POST_METHOD |
protected static String |
PUT_METHOD |
| 构造器和说明 |
|---|
PLAbstractService() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
destroyProxy()
销毁代理
|
protected PLChannelCommonResult |
getPLChannelCommonResult(String url,
String urlParam,
Map<String,String> params,
String method)
已过时。
|
protected PLChannelCommonResult |
getPLChannelCommonResultV1(String url,
String urlParam,
Map<String,String> params,
String method)
已过时。
|
protected PLCommonResult |
getPLCommonResult(String url,
String urlParam,
Map<String,String> params,
String method)
放回公用对象时共用方法
|
protected <T extends PLBaseBody> |
getPLCommonResult(String url,
String urlParam,
Map<String,String> params,
String method,
T t)
放回公用对象时共用方法(包含请求体参数)
|
protected PLCommonResult |
getPLCommonResultV1(String url,
String urlParam,
Map<String,String> params,
String method)
放回公用对象时共用方法
|
protected <T extends PLBaseResult> |
getResult(WrappedResponse response,
T result)
把请求对象转换为Result对象
|
protected <T extends PLBaseResult> |
getResult(WrappedResponseV1 response,
T result)
把v1接口请求对象转换为Result对象
|
void |
initForwardProxy(String host,
int port,
String scheme)
设置正向代理
|
protected HttpClientUtil |
initHttpClient()
实例化HttpClient对象
|
void |
initReverseProxy(String host,
int port,
String scheme)
设置反向代理
|
void |
initReverseProxy(String host,
int port,
String ipAddress,
String scheme)
设置反向代理(带IP地址)
|
protected WrappedResponse |
request(String url,
Map<String,String> params,
String method)
请求接口(包括v2, v3)
|
protected <T extends PLBaseBody> |
request(String url,
Map<String,String> params,
String method,
T t)
请求接口(带请求体参数,包括v2, v3)
|
protected WrappedResponseV1 |
requestV1(String url,
Map<String,String> params,
String method)
请求V1接口
|
protected WrappedResponse request(String url, Map<String,String> params, String method)
url - 请求URLparams - 请求参数集合method - 请求方式protected <T extends PLBaseBody> WrappedResponse request(String url, Map<String,String> params, String method, T t)
T - 类型url - 请求URLparams - 请求参数集合method - 请求方式t - 请求体对象protected WrappedResponseV1 requestV1(String url, Map<String,String> params, String method)
url - 请求URLparams - 请求参数集合method - 请求方式protected HttpClientUtil initHttpClient()
protected <T extends PLBaseResult> T getResult(WrappedResponse response, T result)
T - 自定义类(继承PLBaseResult类)response - 响应对象result - 响应结果protected <T extends PLBaseResult> T getResult(WrappedResponseV1 response, T result)
T - 自定义类(继承PLBaseResult类)response - 响应对象result - 响应结果@Deprecated protected PLChannelCommonResult getPLChannelCommonResult(String url, String urlParam, Map<String,String> params, String method)
url - 请求地址urlParam - 动态地址的地址参数params - 请求参数method - 请求方法@Deprecated protected PLChannelCommonResult getPLChannelCommonResultV1(String url, String urlParam, Map<String,String> params, String method)
url - 请求地址urlParam - 动态地址的地址参数params - 请求参数method - 请求方法protected PLCommonResult getPLCommonResult(String url, String urlParam, Map<String,String> params, String method)
url - 请求地址urlParam - 动态地址的地址参数params - 请求参数method - 请求方法protected <T extends PLBaseBody> PLCommonResult getPLCommonResult(String url, String urlParam, Map<String,String> params, String method, T t)
T - 类型url - 请求地址urlParam - 动态地址的地址参数params - 请求参数method - 请求方法t - 请求体对象protected PLCommonResult getPLCommonResultV1(String url, String urlParam, Map<String,String> params, String method)
url - 请求地址urlParam - 动态地址的地址参数params - 请求参数method - 请求方法public void initForwardProxy(String host, int port, String scheme)
设置正向代理
host - 代理hostport - 代理端口scheme - http/httpspublic void initReverseProxy(String host, int port, String ipAddress, String scheme)
设置反向代理(带IP地址)
host - 代理hostport - 代理端口ipAddress - 代理IP地址scheme - http/httpspublic void initReverseProxy(String host, int port, String scheme)
设置反向代理
host - 代理hostport - 代理端口scheme - http/httpspublic void destroyProxy()
销毁代理
Copyright © 2019. All rights reserved.