public abstract class BaseDtServiceImpl extends Object implements DtService
| 限定符和类型 | 字段和说明 |
|---|---|
protected DtConfigStorage |
configStorage |
protected Object |
globalAccessTokenRefreshLock
全局的是否正在刷新access token的锁.
|
| 构造器和说明 |
|---|
BaseDtServiceImpl() |
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
checkSignature(String signature,
String timestamp,
String nonce,
String data)
验证推送过来的消息的正确性
|
<T,E> T |
execute(RequestExecutor<T,E> executor,
String uri,
E data)
发送请求,在这里执行的策略是当发生access_token过期时才去刷新,然后重新执行请求,而不是全局定时请求.
|
protected <T,E> T |
executeInternal(RequestExecutor<T,E> executor,
String uri,
E data) |
String |
get(String url,
String queryParam)
当本Service没有实现某个API的时候,可以用这个,针对所有钉钉API中的GET请求.
|
String |
getAccessToken()
获取access_token, 不强制刷新access_token
|
DtAgentService |
getAgentService()
agent service
|
DtCorpConversationMessageService |
getCorpConversationMsgService() |
DtDepartmentService |
getDepartmentService()
获取部门相关接口的服务类对象
|
DtOAuth2Service |
getOauth2Service()
获取Oauth2相关接口的服务类对象
|
protected abstract RequestExecutor<String,String> |
getOkHttpSimpleGetRequestExecutor()
okHttp get请求
|
protected abstract RequestExecutor<String,String> |
getOkHttpSimplePostRequestExecutor()
okHttp post请求
|
DtUserService |
getUserService()
获取用户相关接口的服务类对象
|
String |
post(String url,
com.google.gson.JsonObject jsonObject)
当本Service没有实现某个API的时候,可以用这个,针对所有钉钉API中的POST请求.
|
String |
post(String url,
Object obj)
当本Service没有实现某个API的时候,可以用这个,针对所有钉钉API中的POST请求.
|
String |
post(String url,
String postData)
当本Service没有实现某个API的时候,可以用这个,针对所有钉钉API中的POST请求.
|
void |
setDtConfigStorage(DtConfigStorage dtConfigStorage)
注入
DtConfigStorage 的实现 |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAccessToken, getDtConfigStorage, initHttpprotected final Object globalAccessTokenRefreshLock
protected DtConfigStorage configStorage
public boolean checkSignature(String signature, String timestamp, String nonce, String data)
DtService验证推送过来的消息的正确性
checkSignature 在接口中 DtServicesignature - 消息签名timestamp - 时间戳nonce - 随机数data - 传输过来的数据public String getAccessToken() throws DtErrorException
DtServicegetAccessToken 在接口中 DtServiceDtErrorException - the error exceptionDtService.getAccessToken(boolean)public String get(String url, String queryParam) throws DtErrorException
BaseServiceget 在接口中 BaseServiceurl - 请求接口地址queryParam - 参数DtErrorException - 异常public String post(String url, String postData) throws DtErrorException
BaseServicepost 在接口中 BaseServiceurl - 请求接口地址postData - 请求参数json值DtErrorException - 异常public String post(String url, com.google.gson.JsonObject jsonObject) throws DtErrorException
BaseServicepost 在接口中 BaseServiceurl - 请求接口地址jsonObject - 请求对象DtErrorException - 异常public String post(String url, Object obj) throws DtErrorException
BaseServicepost 在接口中 BaseServiceurl - 请求接口地址obj - 请求对象DtErrorException - 异常protected abstract RequestExecutor<String,String> getOkHttpSimpleGetRequestExecutor()
protected abstract RequestExecutor<String,String> getOkHttpSimplePostRequestExecutor()
public <T,E> T execute(RequestExecutor<T,E> executor, String uri, E data) throws DtErrorException
execute 在接口中 DtServiceT - 请求值类型E - 返回值类型executor - 执行器uri - 请求地址data - 参数DtErrorException - the error exceptionprotected <T,E> T executeInternal(RequestExecutor<T,E> executor, String uri, E data) throws DtErrorException
DtErrorExceptionpublic void setDtConfigStorage(DtConfigStorage dtConfigStorage)
DtServiceDtConfigStorage 的实现setDtConfigStorage 在接口中 DtServicedtConfigStorage - 配置对象public DtDepartmentService getDepartmentService()
DtServicegetDepartmentService 在接口中 DtServicepublic DtOAuth2Service getOauth2Service()
DtServicegetOauth2Service 在接口中 DtServicepublic DtUserService getUserService()
DtServicegetUserService 在接口中 DtServicepublic DtAgentService getAgentService()
DtServicegetAgentService 在接口中 DtServicepublic DtCorpConversationMessageService getCorpConversationMsgService()
getCorpConversationMsgService 在接口中 DtServiceCopyright © 2021. All rights reserved.