| 限定符和类型 | 方法和说明 |
|---|---|
<T,E> T |
DtService.execute(RequestExecutor<T,E> executor,
String uri,
E data)
Service没有实现某个API的时候,可以用这个,
比
BaseService.get(java.lang.String, java.lang.String)和BaseService.post(java.lang.String, java.lang.String)方法更灵活,可以自己构造RequestExecutor用来处理不同的参数和不同的返回类型。 |
String |
BaseService.get(String url,
String queryParam)
当本Service没有实现某个API的时候,可以用这个,针对所有钉钉API中的GET请求.
|
String |
DtService.getAccessToken()
获取access_token, 不强制刷新access_token
|
String |
DtService.getAccessToken(boolean forceRefresh)
获取access_token,本方法线程安全
且在多线程同时刷新时只刷新一次,避免触发调用次数频繁限制
非必要情况下尽量不要主动调用此方法
|
DtAgentAuthScope |
DtAgentService.getAuthScope()
获取应用的通讯录权限范围
详情请见: https://ding-doc.dingtalk.com/document/app/obtain-corpsecret-authorization-scope
|
DtUser |
DtUserService.getById(String userId)
获取用户
|
DtOauth2UserInfo |
DtOAuth2Service.getUserInfo(String code)
用oauth2获取用户信息
|
List<DtDepart> |
DtDepartmentService.list(Long id)
获取部门列表
|
List<DtDepart> |
DtDepartmentService.list(Long id,
Boolean fetchChild)
部门管理接口 - 获取部门列表.
|
List<DtUser> |
DtUserService.listByDepartment(Long departId,
Integer offset,
Integer size,
String order)
获取部门成员详情
文档地址:https://ding-doc.dingtalk.com/document/app/obtain-department-members-details
|
List<DtUser> |
DtUserService.listSimpleByDepartment(Long departId,
Integer offset,
Integer size,
String order)
获取部门成员
文档地址:https://ding-doc.dingtalk.com/document/app/obtain-department-members
|
String |
BaseService.post(String url,
com.google.gson.JsonObject jsonObject)
当本Service没有实现某个API的时候,可以用这个,针对所有钉钉API中的POST请求.
|
String |
BaseService.post(String url,
Object obj)
当本Service没有实现某个API的时候,可以用这个,针对所有钉钉API中的POST请求.
|
String |
BaseService.post(String url,
String postData)
当本Service没有实现某个API的时候,可以用这个,针对所有钉钉API中的POST请求.
|
DtCorpConversationMsgSendResult |
DtCorpConversationMessageService.send(DtCorpConversationMessage message) |
| 限定符和类型 | 方法和说明 |
|---|---|
<T,E> T |
BaseDtServiceImpl.execute(RequestExecutor<T,E> executor,
String uri,
E data)
发送请求,在这里执行的策略是当发生access_token过期时才去刷新,然后重新执行请求,而不是全局定时请求.
|
protected <T,E> T |
BaseDtServiceImpl.executeInternal(RequestExecutor<T,E> executor,
String uri,
E data) |
String |
BaseDtServiceImpl.get(String url,
String queryParam) |
String |
BaseDtServiceImpl.getAccessToken() |
String |
DtServiceOkHttpImpl.getAccessToken(boolean forceRefresh) |
DtAgentAuthScope |
DtAgentServiceImpl.getAuthScope() |
DtUser |
DtUserServiceImpl.getById(String userId) |
DtOauth2UserInfo |
DtOAuth2ServiceImpl.getUserInfo(String code) |
List<DtDepart> |
DtDepartmentServiceImpl.list(Long id) |
List<DtDepart> |
DtDepartmentServiceImpl.list(Long id,
Boolean fetchChild) |
List<DtUser> |
DtUserServiceImpl.listByDepartment(Long departId,
Integer offset,
Integer size,
String order) |
List<DtUser> |
DtUserServiceImpl.listSimpleByDepartment(Long departId,
Integer offset,
Integer size,
String order) |
String |
BaseDtServiceImpl.post(String url,
com.google.gson.JsonObject jsonObject) |
String |
BaseDtServiceImpl.post(String url,
Object obj) |
String |
BaseDtServiceImpl.post(String url,
String postData) |
DtCorpConversationMsgSendResult |
DtCorpConversationMessageServiceImpl.send(DtCorpConversationMessage message) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
DtErrorExceptionHandler.handle(DtErrorException e) |
| 限定符和类型 | 方法和说明 |
|---|---|
Boolean |
DtMessageHandler.handle(DtEventMessage message,
Map<String,Object> context,
DtService dtService)
处理消息,当消息处理成功时可以返回true,是被返回false
未处理消息则可以返回null,比如仅仅是记录了一下日志而已
此时不论是返回false还是true都会有问题,返回true则会认为消息处理成功返回false则会认为消息处理失败,然而消息实际未处理
此时返回null,但依然会返回钉钉失败的响应,在后续业务方可以拉取失败消息来重新处理
|
boolean |
DtMessageInterceptor.intercept(DtEventMessage message,
Map<String,Object> context,
DtService dtService)
拦截消息
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
DtLogExceptionHandler.handle(DtErrorException e) |
| 限定符和类型 | 方法和说明 |
|---|---|
Boolean |
DtCheckUrlMessageHandler.handle(DtEventMessage message,
Map<String,Object> context,
DtService dtService) |
| 限定符和类型 | 方法和说明 |
|---|---|
T |
RequestExecutor.execute(String uri,
E data)
执行http请求.
|
String |
OkHttpSimplePostRequestExecutor.execute(String uri,
String postEntity) |
String |
OkHttpSimpleGetRequestExecutor.execute(String uri,
String queryParam) |
String |
OkHttpSimplePostRequestExecutor.handleResponse(String responseContent) |
protected String |
OkHttpSimpleGetRequestExecutor.handleResponse(String responseContent) |
Copyright © 2021. All rights reserved.