# 介绍
争取 做最好用的 企业微信 SDK, 帮助开发者 以最方便 最省时间的方式接入企业微信。qiye-wechat-sdk 基于 Figen 封装, 覆盖 企业微信 所有API
## Quick Start
### Spring Boot 项目
Spring Boot 项目 使用步骤如下:
1. 引入maven依赖
```xml
<dependency>
<groupId>chat.qiye.wechat</groupId>
<artifactId>qiye-wechat-spring-boot-starter</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
```
2. 在 application.yaml 中加入 如下配置
```yaml
qiye:
wechat:
corp-id: ww5f09c98e13dfce02
apps:
- app-id: 1000015
agent-id: 1000015
app-type: app
secret: VYa3q7u-XkhQno-ROferY3mD16eFy_-h62pHJ0qM58I
- app-id: contact
agent-id: 88
app-type: contact
secret: okDLF2MXt3QRGfAQ2cENzNUxfLd3c-_vn60etURj0SY
```
3. 使用 相关 Api Bean
```java
@RestController
public class DeptController {
@Resource
ContactDeptApi contactDeptApi;
@GetMapping("/list")
public ContactDeptListResp list(@RequestParam(defaultValue = "0") Integer id) {
return contactDeptApi.list(id);
}
}
```
### 普通java项目 配置
普通 的Java 项目使用步骤如下:
1. 引入maven依赖
```xml
<dependency>
<groupId>chat.qiye.wechat</groupId>
<artifactId>qiye-wechat-sdk</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-1.2-api</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</dependency>
```
2. 在 resources 目录下 放一个 qiye-wechat.properties 配置文件
```properties
# 应用配置
qiye.wecaht.appId=1000015
qiye.wecaht.agentId=1000015
qiye.wecaht.secret=VYa3q7u-XkhQno-ROferY3mD16eFy_-h62pHJ0qM58I
qiye.wecaht.corpId=ww5f09c98e13dfce02
qiye.wecaht.homeUrl=http://baidu.com
qiye.wecaht.eventToken=ss
qiye.wecaht.eventEncodingAesKey=sddd
# 系统 应用配置格式, 系统应用ID参考 chat.qiye.wechat.sdk.constant.AppTypeEnum
# qiye.wecaht.系统应用ID.appId=contact
# qiye.wecaht.系统应用ID.agentId=88
# qiye.wecaht.系统应用ID.secret=okDLF2M1tkQRGfAQ2cENzNUxfLd3c-_vn60etURj0SY
# qiye.wecaht.系统应用ID.corpId=ww5f09c98e13dfce02 # 可选,未配置使用 qiye.wecaht.corpId
# qiye.wecaht.系统应用ID.homeUrl=http://baidu.com
# qiye.wecaht.系统应用ID.eventToken=ss
# qiye.wecaht.系统应用ID.eventEncodingAesKey=sddd
# 系统-通讯录应用
qiye.wecaht.contact.appId=contact
qiye.wecaht.contact.agentId=88
qiye.wecaht.contact.secret=okDLF2MXt3QRGfAQ2cENzNUxfLd3c-_vn60etURj0SY
qiye.wecaht.contact.corpId=ww5f09c98e13dfce02
qiye.wecaht.contact.homeUrl=http://baidu.com
qiye.wecaht.contact.eventToken=ss
qiye.wecaht.contact.eventEncodingAesKey=sddd
```
3. API调用
```java
public class MainClass {
public static void main(String[] args) {
// 获取Api实例, 所有封装的Api 都在 chat.qiye.wechat.sdk.api 包下,并以Api结尾
ContactDeptApi contactDeptApi = ApiFactory.getApiBean(ContactDeptApi.class, new ApiConfigurationDefaultProvider());
// 查询 通讯录 部门列表
List<ContactDeptVo> deptVoList = contactDeptApi.list(0).getDepartment();
System.out.println("DeptList:" + deptVoList);
// 创建部门
ContactDeptVo contactDeptVo = new ContactDeptVo();
contactDeptVo.setId(2);
contactDeptVo.setName("测试部");
contactDeptVo.setNameEn("test");
contactDeptVo.setParentid(1);
ContactDeptCreateResp resp = contactDeptApi.create(contactDeptVo);
if (resp.success()) {
RespStatus ret = contactDeptApi.delete(resp.getId());
System.out.println("delete result:" + ret);
}
}
}
```
## 进阶配置
## 多个企业微信内部应用
## 多个企业微信服务商应用
## 系统应用ID
系统应用 默认是 没有应用ID 但是 系统应用有单独的 secret,为了能够识别 系统应用的 secret 特此 对系统应用的id 进行统一定义,在配置文件中 配置时,需遵守如下名称
```java
DEFAULT("app", "自建应用"),
APP_CONTACT("contact", "通讯录"),
APP_CUSTOMER("customer", "客户关系"),
APP_CUSTOMER_SERVICE("customer_service", "微信客服"),
APP_MEETING("meeting", "会议"),
APP_SCHEDULE("schedule", "日程"),
APP_PUBLIC_PHONE("public_phone", "公费电话"),
APP_WX_DRIVE("wx_drive", "微盘"),
APP_LIVING("living", "直播"),
APP_CHECK_IN("check_in", "打卡"),
APP_APPROVAL("approval", "审批"),
APP_REPORT("report", "汇报"),
APP_MEETING_ROOM("meeting_room", "会议室"),
APP_PSTNCC("pstncc", "紧急通知"),
APP_SCHOOL_CONTACT("school_contact", "家校通讯录");
```
没有合适的资源?快使用搜索试试~ 我知道了~
基于 Feign 实现的企业微信 JAVA SDK, 覆盖 企业微信 所有API,spring-boot-starter 支持 ...

共583个文件
java:560个
xml:8个
gitkeep:7个

0 下载量 182 浏览量
2025-08-22
10:26:02
上传
评论
收藏 428KB ZIP 举报
温馨提示
基于 Feign 实现的企业微信 JAVA SDK, 覆盖 企业微信 所有API,spring-boot-starter 支持 可快速接入(1).zip
资源推荐
资源详情
资源评论































收起资源包目录





































































































共 583 条
- 1
- 2
- 3
- 4
- 5
- 6
资源评论


智慧安全方案
- 粉丝: 3926
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助


最新资源
- 区块链的未来发展和应用场景到底是什么样的?.docx
- 网络经济时代人力资源管理.ppt
- 计算机网络使用工程与建设实训初版.doc
- 信息化教学背景下医学类学生自主学习能力培养探索.docx
- 2017-2018学年高中数学第一章算法初步1.1算法与程序框图1.1.3第二课时循环结构新人教B必修3.ppt
- 单片机LED汉字显示屏设计方案与实现.doc
- JAVA学生信息管理系统的设计方案及实现.doc
- 中国计算机病毒疫情调查技术分析报告.docx
- 大数据背景下企业人力资源管理的改进研究.docx
- 基于单片机的多路数据采集系统研究设计.doc
- 区块链技术在会计行业中的应用探索.docx
- 电信通信毕业论文.doc
- 中国大数据产业生态日臻完善.docx
- 电子商务与物流技能训练.doc
- 医院工程网络六类布线系统总体技术解决方案.doc
- 品牌战略与电子商务互联网背景下我国环保企业发展问题研究.docx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈



安全验证
文档复制为VIP权益,开通VIP直接复制
