1 Star 0 Fork 6

luohan / DtJava

forked from tingyugetc520 / DtJava 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
README.md 2.10 KB
一键复制 编辑 原始数据 按行查看 历史
tingyugetc520 提交于 2021-04-15 20:18 . 更新readme

DtJava

介绍

DtJava(DingTalk Java SDK-钉钉SDK) 封装了钉钉凭证、通讯录管理、消息通知等服务端接口,让开发者可以使用简单的配置,提供简洁的 API 以供方便快速地调用钉钉接口。

注意:目前SDK主要是以企业内建应用为主,ISV应用后面会陆续支持。

文档

查看wiki首页

Demo示例可 查看DEMO项目 ,包括事件消息回调处理等等。

安装

  • 通过Maven方式安装使用
<dependency>
    <groupId>com.github.tingyugetc520</groupId>
    <artifactId>dt-java</artifactId>
    <version>0.1.2</version>
</dependency>

目前已发布0.1.2版本

  • 直接下载源码使用
git clone https://github.com/tingyugetc520/DtJava.git

源码下载完成后,放置在您的项目中使用,同时请注意相关依赖的问题。

使用

可前往查看DEMO项目

// 钉钉应用配置
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项目 ,包括事件消息回调处理等等。

封装进度(企业内建应用)

  • HTTP代理,支持正向代理与反向代理
  • 获取凭证
  • 身份验证
  • 通讯录管理(只读)
  • 消息通知-工作消息通知
  • HTTP事件回调
Java
1
https://gitee.com/luohanzju/DtJava.git
git@gitee.com:luohanzju/DtJava.git
luohanzju
DtJava
DtJava
master

搜索帮助