资源简介
钉钉企业微应用官方Demo,用Java语言开发,封装好了各种库,方便二次开发
代码片段和文件信息
package com.alibaba.dingtalk.openapi.demo;
import com.alibaba.dingtalk.openapi.demo.auth.AuthHelper;
import com.alibaba.dingtalk.openapi.demo.department.DepartmentHelper;
import com.alibaba.dingtalk.openapi.demo.media.MediaHelper;
import com.alibaba.dingtalk.openapi.demo.message.LightAppMessageDelivery;
import com.alibaba.dingtalk.openapi.demo.message.MessageHelper;
import com.alibaba.dingtalk.openapi.demo.user.UserHelper;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONobject;
import com.dingtalk.open.client.api.model.corp.*;
import com.dingtalk.open.client.api.model.corp.MessageBody.OABody.Body;
import com.dingtalk.open.client.api.model.corp.MessageBody.OABody.Body.Form;
import com.dingtalk.open.client.api.model.corp.MessageBody.OABody.Body.Rich;
import com.dingtalk.open.client.api.model.corp.MessageBody.OABody.Head;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
/**
* 本地测试方法钉钉API
*/
public class Demo {
public static String TO_USER = ““;
public static String TO_PARTY = ““;
public static String AGENT_ID = ““;
public static void main(String[] args) throws Exception {
try {
List departments = new ArrayList();
departments = DepartmentHelper.listDepartments(AuthHelper.getAccessToken() “1“);
JSONobject usersJSON = new JSONobject();
System.out.println(“depart num:“ + departments.size());
for (int i = 0; i < departments.size(); i++) {
JSONobject userDepJSON = new JSONobject();
System.out.println(“dep:“ + departments.get(i).toString());
long offset = 0;
int size = 5;
CorpUserList corpUserList = new CorpUserList();
while (true) {
corpUserList = UserHelper.getDepartmentUser(AuthHelper.getAccessToken() Long.valueOf(departments.get(i).getId())
offset size null);
System.out.println(JSON.toJSONString(corpUserList));
if (Boolean.TRUE.equals(corpUserList.isHasMore())) {
offset += size;
} else {
break;
}
}
if (corpUserList.getUserlist().size() == 0) {
continue;
}
for (int j = 0; j < corpUserList.getUserlist().size(); j++) {
String user = JSON.toJSONString(corpUserList.getUserlist().get(j));
userDepJSON.put(j + ““ JSONobject.parseobject(user CorpUserDetail.class));
}
usersJSON.put(departments.get(i).getName() userDepJSON);
System.out.println(“user:“ + usersJSON.toString());
}
System.out.println(“depart:“ + usersJSON.toJSONString());
// 获取access token
String accessToken = AuthHelper.getAccessToken();
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-05-22 12:36 openapi-demo-java-master\
文件 364 2018-05-22 12:36 openapi-demo-java-master\.gitignore
文件 2563 2018-05-22 12:36 openapi-demo-java-master\README.md
目录 0 2018-05-22 12:36 openapi-demo-java-master\lib\
文件 50573 2018-05-22 12:36 openapi-demo-java-master\lib\client-sdk.api-1.0.2.jar
文件 7797 2018-05-22 12:36 openapi-demo-java-master\lib\client-sdk.common-1.0.0-SNAPSHOT.jar
文件 42170 2018-05-22 12:36 openapi-demo-java-master\lib\client-sdk.core-1.0.0-SNAPSHOT.jar
文件 17604 2018-05-22 12:36 openapi-demo-java-master\lib\client-sdk.example-1.0.0-SNAPSHOT.jar
文件 3009 2018-05-22 12:36 openapi-demo-java-master\lib\client-sdk.spring-1.0.0-SNAPSHOT.jar
文件 12350 2018-05-22 12:36 openapi-demo-java-master\lib\lippi-oapi-encrpt.jar
文件 732573 2018-05-22 12:36 openapi-demo-java-master\lib\taobao-sdk-java-auto_1479188381469-20170724.jar
文件 9570 2018-05-22 12:36 openapi-demo-java-master\pom.xm
目录 0 2018-05-22 12:36 openapi-demo-java-master\src\
目录 0 2018-05-22 12:36 openapi-demo-java-master\src\main\
目录 0 2018-05-22 12:36 openapi-demo-java-master\src\main\java\
目录 0 2018-05-22 12:36 openapi-demo-java-master\src\main\java\com\
目录 0 2018-05-22 12:36 openapi-demo-java-master\src\main\java\com\alibaba\
目录 0 2018-05-22 12:36 openapi-demo-java-master\src\main\java\com\alibaba\dingtalk\
目录 0 2018-05-22 12:36 openapi-demo-java-master\src\main\java\com\alibaba\dingtalk\openapi\
目录 0 2018-05-22 12:36 openapi-demo-java-master\src\main\java\com\alibaba\dingtalk\openapi\demo\
文件 12350 2018-05-22 12:36 openapi-demo-java-master\src\main\java\com\alibaba\dingtalk\openapi\demo\Demo.java
文件 760 2018-05-22 12:36 openapi-demo-java-master\src\main\java\com\alibaba\dingtalk\openapi\demo\Env.java
文件 414 2018-05-22 12:36 openapi-demo-java-master\src\main\java\com\alibaba\dingtalk\openapi\demo\OApiException.java
目录 0 2018-05-22 12:36 openapi-demo-java-master\src\main\java\com\alibaba\dingtalk\openapi\demo\auth\
文件 6632 2018-05-22 12:36 openapi-demo-java-master\src\main\java\com\alibaba\dingtalk\openapi\demo\auth\AuthHelper.java
目录 0 2018-05-22 12:36 openapi-demo-java-master\src\main\java\com\alibaba\dingtalk\openapi\demo\department\
文件 2806 2018-05-22 12:36 openapi-demo-java-master\src\main\java\com\alibaba\dingtalk\openapi\demo\department\DepartmentHelper.java
目录 0 2018-05-22 12:36 openapi-demo-java-master\src\main\java\com\alibaba\dingtalk\openapi\demo\eventchange\
文件 2889 2018-05-22 12:36 openapi-demo-java-master\src\main\java\com\alibaba\dingtalk\openapi\demo\eventchange\eventChangeHelper.java
目录 0 2018-05-22 12:36 openapi-demo-java-master\src\main\java\com\alibaba\dingtalk\openapi\demo\media\
文件 1790 2018-05-22 12:36 openapi-demo-java-master\src\main\java\com\alibaba\dingtalk\openapi\demo\media\MediaHelper.java
............此处省略99个文件信息
- 上一篇:串口接收GPS
- 下一篇:java实现坦克大战联机
相关资源
-
Android ja
vasc ript打开webview图片、支 - 基于Java的网络教学系统
- 超市进销存系统需求分析与设计实现
- JAVA3D官方
- 基于java的汽车租赁管理系统
- 丰巢科技Java面试题
- Android测试网速源码
- JAVA mysql web 图书管理系统
- Android USB 串口助手源代码
- java操作Excel需要的jar包
- Java实现拼图游戏源码
- Android RTMP推流工具(仅APK没有源码)
- java进销存管理系统源码
- Java+GUI编程实现“21点”游戏(含文档
- 2019年最新版修订版Java程序员面试宝典
- 2019年最新版修订版Java程序员面试宝典
- Android4.4原生动态壁纸源码打包
- 230JSP基于SSM人事管理OA办公系统毕业设
- 精通Java并发编程第2版.zip
- kafka java依赖包
- Maven: The Definitive Guide pdf
- Jsp仿淘宝网项目源代码
- 杨晓峰-java核心技术36讲(完结.pdf
- Linux系统安装区块链以太坊服务go-et
- java源代码,java源代码
- Java代码 MySql导出到SqlLite
- android手机安全卫士--源码
- JAVA商品库存管理系统
- jsp+servlet+javabean实现数据库增删改查操
- JAVAEE6 API 文档
评论
共有 条评论