public abstract class AuthingBaseClient extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
protected String |
endpoint
endpoint
|
protected org.apache.http.impl.client.CloseableHttpClient |
HTTP_CLIENT |
protected static cn.hutool.log.Log |
log |
protected static String |
PATH_PREFIX |
protected String |
userPoolId
user pool id
|
protected String |
userPoolSecret
user pool secret
|
protected static String |
VERSION
开放平台协议版本
|
| 构造器和说明 |
|---|
AuthingBaseClient()
构造方式一
|
AuthingBaseClient(String endpoint)
构造方式二
|
AuthingBaseClient(String endpoint,
org.apache.http.impl.client.CloseableHttpClient client)
构造方式
|
AuthingBaseClient(String endpoint,
String userPoolId,
String userPoolSecret)
构造方式三
|
| 限定符和类型 | 方法和说明 |
|---|---|
protected String |
buildExt(OpenapiRequest request,
String token) |
<R> R |
execute(OpenapiRequest request,
Class<R> clazz,
String token)
执行 http 请求
|
<R> R |
execute(OpenapiRequest request,
Class<R> clazz,
String token,
String traceId)
执行 http 请求,可以携带请求唯一标识
|
protected Map<String,String> |
getAddedHeaders() |
String |
getEndpoint() |
String |
getUserPoolId() |
String |
getUserPoolSecret() |
void |
setEndpoint(String endpoint) |
static void |
setPublicKey(String publicKey)
设置密码加密的公钥
|
void |
setUserPoolId(String userPoolId) |
void |
setUserPoolSecret(String userPoolSecret) |
protected final org.apache.http.impl.client.CloseableHttpClient HTTP_CLIENT
protected static final cn.hutool.log.Log log
protected String endpoint
protected String userPoolId
protected String userPoolSecret
public AuthingBaseClient(String endpoint, org.apache.http.impl.client.CloseableHttpClient client)
client - http clientendpoint - endpointpublic AuthingBaseClient()
public AuthingBaseClient(String endpoint)
endpoint - 调用地址 https://ip:portpublic static void setPublicKey(String publicKey)
publicKey - rsa 公钥public <R> R execute(OpenapiRequest request, Class<R> clazz, String token)
R - 响应对象的类型request - 请求对象clazz - 响应对象的类型token - token 可以是用户池 token 也可以是应用登录时用户的 tokenpublic <R> R execute(OpenapiRequest request, Class<R> clazz, String token, String traceId) throws RuntimeException
R - 响应对象的类型request - 请求对象clazz - 响应对象的类型token - token,可以是用户池 token 也可以是应用登录时用户的 tokentraceId - 请求唯一标识,requestIdRuntimeExceptionprotected String buildExt(OpenapiRequest request, String token)
public String getEndpoint()
public void setEndpoint(String endpoint)
public String getUserPoolId()
public void setUserPoolId(String userPoolId)
public String getUserPoolSecret()
public void setUserPoolSecret(String userPoolSecret)
Copyright © 2021. All rights reserved.