# DtJava
**Repository Path**: Nkrr/DtJava
## Basic Information
- **Project Name**: DtJava
- **Description**: DtJava(钉钉 Java SDK),DingTalk(钉钉)的后端开发SDK。
- **Primary Language**: Java
- **License**: Apache-2.0
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 6
- **Created**: 2021-02-19
- **Last Updated**: 2021-02-19
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# DtJava
## 介绍
DtJava(DingTalk Java SDK-钉钉SDK) 封装了钉钉凭证、通讯录管理、消息通知等服务端接口,让开发者可以使用简单的配置,提供简洁的 API 以供方便快速地调用钉钉接口。
注意:目前SDK主要是以企业内建应用为主,ISV应用后面会陆续支持。
## 封装进度(企业内建应用)
- [x] 获取凭证
- [x] 身份验证
- [x] 通讯录管理(只读)
- [x] 消息通知-工作消息通知
- [x] HTTP事件回调
## 环境要求
- Java8+
## 安装
* 通过Maven方式安装使用
```xml
com.github.tingyugetc520
dt-java
0.0.1-SNAPSHOT
```
目前仅发布了0.0.1-SNAPSHOT版本。
由于尚处于初期开发阶段,所以未发布到Maven中央仓库,在项目中使用时需要在项目中添加如下的仓库配置。
```xml
github-dt-java-repo
The Maven Repository on Github
https://tingyugetc520.github.io/DtJava/maven-repo/
true
always
```
* 直接下载源码使用
```git
git clone https://github.com/tingyugetc520/DtJava.git
```
源码下载完成后,放置在您的项目中使用,同时请注意相关依赖的问题。
## 使用
可前往[查看DEMO项目](https://github.com/tingyugetc520/dtjava-demo)
```java
// 钉钉应用配置
DtDefaultConfigImpl config = new DtDefaultConfigImpl();
config.setCorpId("corpId");
config.setAgentId(agentId);
config.setAppKey("appKey");
config.setAppSecret("appSecret");
// DtService为SDK使用入口,后续接口使用均需要DtService
DtServiceImpl dtService = new DtServiceImpl();
dtService.setDtConfigStorage(config);
// 查询用户
DtUser user = dtService.getUserService().getById(userId);
log.info("dt user:{}", user);
// 发送工作消息通知
DtCorpConversationMessage message = DtCorpConversationMessage.builder()
.agentId(config.getAgentId())
.userIds(Lists.newArrayList("userId"))
.msg(DtMessage.TEXT().content("this is content").build())
.build();
dtService.getCorpConversationMsgService().send(message);
```
更多的示例可 [查看DEMO项目](https://github.com/tingyugetc520/dtjava-demo) ,包括事件消息回调处理等等。
## 文档
后续补充