154 Commits

Author SHA1 Message Date
Binary Wang
7198a58e9c Merge pull request #2988 from Wechat-Group/develop
发布最新正式版4.5.0
2023-04-22 23:16:12 +08:00
Binary Wang
e72991c0b5 🔖 发布 4.5.0 正式版本 2023-03-06 13:25:29 +08:00
0katekate0
9e190fef36 🎨 #2985【企业微信】增加会话存档常量类型支持 2023-04-22 15:51:15 +08:00
Binary Wang
e2e4d345b0 🎨 修复部分pom依赖版本号,支持jdk8 2023-04-22 15:39:56 +08:00
Binary Wang
7ba18434a1 🎨 增加部分缺失参数 2023-04-19 22:45:00 +08:00
Binary Wang
a3919af9a9 🎨 修复pom文件 2023-04-19 22:34:52 +08:00
Binary Wang
a4fc7c9a7c 🎨 修复单元测试 2023-04-19 22:29:32 +08:00
Binary Wang
15b2cefaf8 🎨 修复错误的字段 2023-04-19 22:22:31 +08:00
Binary Wang
25ac89c3bf 🎨 修复pom文件 2023-04-19 22:18:12 +08:00
0katekate0
c065ad212f 🎨 #2980【微信支付】增加部分回调相关的单元测试代码 2023-04-19 22:06:00 +08:00
zhen
9d5e22f7c8 🎨 优化变量命名 2023-04-19 22:04:35 +08:00
ID_Wangqiang
22a29c51c0 🆕 #2981 【企业微信】增加根据邮箱获取用户Userid的接口方法 2023-04-19 22:03:26 +08:00
dependabot[bot]
087870ed0c ⬆️ Bump jetty-server from 9.4.43.v20210629 to 10.0.14 (#2982) 2023-04-19 22:02:19 +08:00
陈明
b5a760d4ca 🎨 修复代码,避免 String 与 Integer 强转报错 2023-04-19 13:47:50 +00:00
The Wolf Chasing Dreams
e0e03d82ff 🐛 #2973 【小程序】修改获取url link接口请求类中的expireTime属性类型为Long 2023-04-10 15:21:37 +08:00
沸点108
43a3a1e5a0 🆕 #2963 【企业微信】新增企业微信服务商帐号ID转换相关的接口 2023-03-29 16:21:00 +08:00
codecrab
6e96d7cf55 🎨 【企业微信】添加AttachmentBuilder,可以更方便的创建新客户欢迎语的附件信息 2023-03-29 16:19:13 +08:00
四叶草
722c2cfe2b 🎨 代码模板添加开发者字段 2023-03-27 08:27:26 +00:00
沸点108
36028b8d5b 🆕 #2962 【企业微信】 增加构造第三方应用oauth2链接的方法 2023-03-26 21:57:01 +08:00
heiheihei
bae84e1d6b :art:【小程序】路由规则使用异步时,当前的appId没有传入到子线程,导致wxMaService在子线程中无法取到父线程的appId。 (#2961) 2023-03-24 11:33:17 +08:00
沸点108
ee94e6d03b 🆕 #2958 【企业微信】增加第三放服务商应用消息推送时转换加密的XML格式方法 2023-03-22 19:16:56 +08:00
Binary Wang
a726e37ba5 🎨 修复错误引用的代码 2023-03-12 21:00:52 +08:00
heiheihei
185df6e16d 🎨 添加redis微信消息重复检查相关类 2023-03-12 20:55:47 +08:00
CharlesWone
a19112b320 🐛 #2946 【微信支付】消费者投诉模块查询投诉单接口修复错误的字段类型 2023-03-08 17:01:46 +08:00
plex
cb6e9c85ac 🎨 fix typo of javadoc 2023-03-08 09:33:21 +08:00
Binary Wang
a4bc5389b9 🔖 发布 4.4.9.B 测试版本 2023-03-05 22:57:23 +08:00
1ibo
a9b8667053 🆕 #2942【企业微信】增加企业互联相关接口 2023-03-05 21:10:24 +08:00
ChengKeJ
3acf55a0d2 🆕 #2937【企业微信】发送机器人消息支持模板卡片消息,客服消息支持以客服纬度查询 2023-02-21 17:14:20 +08:00
Binary Wang
677b2cf432 🎨 update some image 2023-02-21 16:29:21 +08:00
墨染
87322e6d78 :new:【微信支付】增加品牌红包商家转账到零钱发放、查询批次、查询明细等接口 2023-02-21 08:15:52 +00:00
四叶草
26057b0844 🎨 【微信支付】修改退款结果类,实现序列化,解决rpc调用报错;【开放平台】代码模板添加审核相关字段 2023-02-18 14:57:17 +00:00
luckyxz
59074bae86 :new:【微信支付】支持服务商模式的扣款服务接口 2023-02-18 14:56:01 +00:00
WuLang
b83435281d 🎨 新增okhttp实现接口请求的单例模式代码 2023-02-18 22:52:02 +08:00
Binary Wang
a47bc221f5 🎨 替换图片地址为https的 2023-02-10 14:58:47 +08:00
ChengKeJ
f84ccb3cdd 🎨 #2923【企业微信】模版卡片消息增加更新为新的卡片功能 2023-02-07 17:00:52 +08:00
wangmeng3486
3def66bc78 🆕 #2924【企业微信】增加会议相关的接口 2023-02-07 16:57:20 +08:00
bef154020f 🎨 修复ComplaintDetailResult里的userTagList字段注释 2023-02-03 00:01:40 +08:00
dependabot[bot]
71334bf630 ⬆️ Bump testng from 7.1.0 to 7.7.0 (#2922)
Bumps [testng](https://github.com/cbeust/testng) from 7.1.0 to 7.7.0.
- [Release notes](https://github.com/cbeust/testng/releases)
- [Changelog](https://github.com/cbeust/testng/blob/master/CHANGES.txt)
- [Commits](https://github.com/cbeust/testng/commits/7.7.0)

---
updated-dependencies:
- dependency-name: org.testng:testng
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-28 14:39:53 +08:00
Binary Wang
4ee7728091 🎨 升级XStream版本,修复漏洞CVE-2022-41966 2023-01-28 14:29:15 +08:00
NotePlus
b7dc0d6526 🎨 #2919 【微信支付】特约商户进件提交申请单主体资料中的主体类型枚举增加政府类型 2023-01-28 06:28:43 +00:00
Binary Wang
9818ba3ab7 🐛 #2921 【小程序】修改使用okhttp及jodd方式请求创建直播间接口报错的问题 2023-01-28 14:27:20 +08:00
Binary Wang
112f7c100e 🔖 发布 4.4.8.B 测试版本 2022-12-07 23:50:17 +08:00
大林哥
abae2cfce9 🎨 【企业微信】微信客服消息增加视频号商品和订单消息类型 2023-01-10 13:27:56 +00:00
Binary Wang
6ccbf900db 🎨 优化部分代码 2023-01-10 14:37:59 +08:00
wangmeng3486
64e29af498 🐛 #2908 【企业微信】修复用户接口直属领导参数没有被正常序列化的问题 2023-01-09 13:47:29 +08:00
Binary Wang
521ea08ba9 🎨 优化部分代码,移除校验 2023-01-09 09:32:37 +08:00
源三岁
1557894954 🎨 【公众号】补充对订阅通知类型的消息的支持 2022-12-30 18:17:32 +08:00
Binary Wang
e425817e69 🎨 尝试去掉无用的validation-api依赖 2022-12-30 18:17:17 +08:00
NotePlus
0d1320a48f :new:【微信支付】增加查询结算账户、查询分账结果、查询分账回退结果和申请分账账单等V3接口 2022-12-25 14:38:26 +00:00
rodgerYoung
87c33ac776 🎨 spring boot 3.0 starter注入方式添加 2022-12-22 20:13:36 +08:00
Binary Wang
90556820ba 🔖 发布 4.4.7.B 测试版本 2022-12-07 21:49:58 +08:00
Binary Wang
b7ceeed557 🎨 优化重构OA审批模板相关接口及类定义 2022-12-17 15:18:24 +08:00
yiyingcanfeng
baa8a6da37 🆕 #2905【企业微信】增加OA模块创建审批模板、更新审批模板的接口 2022-12-17 15:10:00 +08:00
Binary Wang
901fceba27 🎨 小程序代码提交审核代码重构优化,删除重复定义类 2022-12-17 15:05:35 +08:00
LinZhaoguan
e0a39c8d68 🎨 #2903 【微信支付】优化服务商模式的微信支付分相关代码
1.优化请求参数赋值逻辑
2.新增服务商模式的”授权/解除授权服务回调通知结果“实体类
2022-12-17 14:39:20 +08:00
taoxhsmile
749f326f94 🎨 WxCpAgent 增加 字段customizedPublishStatus 2022-12-17 14:38:26 +08:00
Well
90d8098d93 🎨 #2897 【微信支付】普通商户商家转账到零钱接口增加转账场景ID的参数 2022-12-17 14:29:25 +08:00
NotePlus
b35645ee67 :new:【微信支付】新增查询特约商户设置的允许服务商分账的最大比例的V3接口 2022-12-11 07:48:34 +00:00
源三岁
a3a8295262 🎨 补充部分订阅通知事件常量 2022-12-11 07:46:56 +00:00
th3ee9ine
8088c4ada8 🐛 #2894 【企业微信】修复update_taskcard 方法传参错误的问题 2022-12-11 15:29:03 +08:00
oneice
c443dc1fd1 🎨 #2893 【公众号】自定义菜单查询接口返回结果类增加缺失的 mediaId 和 articleId 字段 2022-12-08 20:15:29 +08:00
Binary Wang
c0a7376e22 👷 Add .circleci/config.yml 2022-12-08 09:36:12 +08:00
Binary Wang
5776914faa 🔖 发布 4.4.6.B 测试版本 2022-12-07 20:38:26 +08:00
Binary Wang
d2571d094b 🎨 优化部分代码 2022-12-07 19:15:50 +08:00
liming1019
d3552245a5 🎨 #2888 【小程序】自定义交易组件商品上传API增加部分参数 2022-12-07 15:31:22 +08:00
竹子
57859d8d80 🎨 #2886 【微信支付】投诉单查询详情接口返回实体类增加投诉单关联服务单信息的相关属性 2022-12-07 15:31:22 +08:00
枫飘满林
6205568948 🎨 修改委托代扣协议xml标识 2022-12-06 14:40:48 +00:00
Binary Wang
327e6ffa05 🐛 修复错误的字段类型 2022-12-06 19:38:33 +08:00
Binary Wang
d68956df72 🎨 增加缺失的注解 2022-12-06 19:38:17 +08:00
Binary Wang
c7ade5b2d5 🎨 优化部分javadoc 2022-12-02 18:31:46 +08:00
NotePlus
07c4615d7e 🐛 【微信支付】修复特约商户进件-提交申请单接口证件持有人类型类型定义错误和证件居住地址参数名错误的问题 2022-12-02 10:29:27 +00:00
binarywang
99a55e6bc9 🎨 v3api加入support_fapiao字段 2022-12-02 10:08:18 +00:00
miemie
3ced24eb9e v3api加入support_fapiao字段 2022-11-28 22:07:51 +08:00
dazer007
431e83bf4f 🎨 将JedisWxRedisOps标记为过时 2022-11-21 08:59:16 +08:00
ricky_gu
3f6e5d8d51 🐛 #2880 【企业微信】修复审批应用设置推送消息会被误判为重复消息的问题 2022-11-19 20:04:16 +08:00
大林哥
c702f787f7 :art:【企业微信】微信客服事件消息增加撤回消息msgId字段 2022-11-16 13:54:06 +00:00
Binary Wang
0721b01cdb 🔖 发布 4.4.5.B 测试版本 2022-11-13 14:16:31 +08:00
Binary Wang
e636362585 🎨 #2878 【企业微信】OA提交审批申请接口增加提单者提单部门id(choose_department)的请求参数 2022-11-13 13:50:11 +08:00
Binary Wang
ace4f9a278 🎨 重构优化代码 2022-11-11 20:49:27 +08:00
playersun
60fdf91ce7 🎨 修复模板消息行业枚举”其它“文字错误问题(官方文档和接口实际返回不一致) 2022-11-11 20:17:49 +08:00
Binary Wang
d94b42b6ee 🎨 #2798 【开放平台】小程序模版开发上传代码并生成体验版接口增加requiredPrivateInfos参数的支持 2022-11-11 19:35:17 +08:00
Binary Wang
1e13645f72 🎨 【企业微信】重构规范化客户联系聊天敏感词管理的相关接口和文档 2022-11-08 16:31:21 +08:00
Grit
43a460a28b 🎨 #2874 【企业微信】微信客服发送菜单消息菜单项支持纯文本内容 2022-11-08 16:29:49 +08:00
th3ee9ine
c109e81842 🎨 #2873 【企业微信】模板卡片消息支持左图右文样式和按钮型卡片的下拉框样式(企业微信v3.1.18版本引入的新特性) 2022-11-06 11:32:01 +08:00
黄天政
c26b055ccf 🐛 【企业微信】修复corpId2OpenCorpId接口provider_access_token参数错误的问题 2022-11-03 08:59:24 +00:00
Binary Wang
4888d1576b 🔖 发布 4.4.4.B 测试版本 2022-11-01 17:31:52 +08:00
cocoa
48a86940e2 🆕 #2865 【企业微信】第三方应用增加ID转换接口 2022-11-01 17:29:13 +08:00
黄天政
199c109a3d 🎨 获取永久授权码接口返回值增加state属性 2022-11-01 09:19:08 +00:00
Binary Wang
9522585074 🎨 优化部分代码,清理无用代码 2022-10-31 15:25:40 +08:00
Binary Wang
ae08833323 🎨 规范化代码 2022-10-31 11:42:38 +08:00
Binary Wang
bf9c0571f8 🎨 格式化规范化部分测试代码 2022-10-30 14:31:34 +08:00
Alixhan
30264bfaae 🎨 #2858 【企业微信】优化会话存档获取媒体数据的接口 2022-10-30 14:23:08 +08:00
Nobody
edb098500d 🆕 #2856 【企业微信】增加获取应用二维码的接口;【开放平台】增加使用 AppSecret 重置第三方平台 API 调用次数的接口 2022-10-30 14:19:26 +08:00
q7486828035
46921e0e55 🎨 #2861 XStreamInitializer增加自定义加载类的支持方法 2022-10-30 14:15:14 +08:00
nadirvishun
df759717cd 🎨 #2854【企业微信】获取访问用户敏感信息接口中增加地址和企业邮箱字段 2022-10-25 17:45:13 +08:00
imgbot[bot]
31d446a6bd [ImgBot] Optimize images
*Total -- 542.77kb -> 415.52kb (23.44%)

/images/banners/diboot.png -- 366.13kb -> 241.38kb (34.07%)
/images/banners/ccflow.png -- 101.89kb -> 99.52kb (2.33%)
/weixin-java-mp/src/test/resources/1.jpeg -- 74.74kb -> 74.62kb (0.17%)

Signed-off-by: ImgBotApp <ImgBotHelp@gmail.com>

Signed-off-by: ImgBotApp <ImgBotHelp@gmail.com>
Co-authored-by: ImgBotApp <ImgBotHelp@gmail.com>
2022-10-25 17:36:55 +08:00
Alixhan
48a22a0e60 🎨 #2853 【企业微信】配置类中增加会话存档secret的配置项 2022-10-25 17:01:50 +08:00
唐英鹏
512975fb86 🎨 #2851【公众号】群发消息支持多图片群发 2022-10-25 16:45:20 +08:00
zhongjun
62490c77b6 🎨 移动公众号关联小程序接口到 WxOpenMpService 2022-10-25 10:55:02 +08:00
Binary Wang
2eb6180567 🔖 发布 4.4.3.B 测试版本 2022-10-23 23:53:54 +08:00
Binary Wang
4118e8bba6 🎨 优化部分javadoc 2022-10-23 14:46:14 +08:00
杨镇涛
10414d9971 🎨 优化代码,未正确配置 apiV3Key 时,173 行证书更新失败,未做 throw 等阻断动作,导致 verifier 未赋值,后续其它方法使用将出现空指针异常 2022-10-23 14:38:13 +08:00
Binary Wang
c1e7d095ed 🎨 增加一些单元测试代码 2022-10-22 11:52:44 +08:00
Binary Wang
6b21f1a234 🎨 修复错误的字段定义 2022-10-22 11:23:21 +08:00
Binary Wang
69cf2bcb90 🎨 增加代码兼容微信接口实际返回跟官方文档不符的文字 2022-10-22 11:17:16 +08:00
cocoa
a8a5359c9f 🐛 #2799 [ 企业微信】修复第三方服务调用getUserId接口时缺少access_token的问题 2022-10-21 17:49:10 +08:00
freedom9
9b78acd0e5 🆕 #2846 【企业微信】增加待开发应用获取带参授权链接的接口 2022-10-21 17:46:21 +08:00
Binary Wang
b08530917c 优化部分代码格式 2022-10-21 13:56:03 +08:00
oldmanl
791ec8d2db 🆕 #2837 【企业微信】增加撤回应用消息的接口 2022-10-21 13:54:41 +08:00
freedom9
b6ad48dff7 :bug:【企业微信】修复external_userid转换接口的地址 2022-10-14 16:11:54 +08:00
清心
809ff15709 🆕 【微信开放平台】增加申请开通直播的接口 2022-10-13 07:28:02 +00:00
yiyingcanfeng
bb65189fb8 🆕 #2834 【企业微信】新增将代开发应用或第三方应用获取的密文open_userid转换为明文userid的接口 2022-10-13 15:09:52 +08:00
yiyingcanfeng
8a161cfa2c 🆕 #2832【企业微信】新增将代开发应用或第三方应用获取的externaluserid转换成自建应用的externaluserid的接口 2022-10-07 15:49:51 +08:00
橘猫都是P
4ca4dec37e 🎨 #2830 【小程序】交易组件商品spu list接口返回类增加缺失的productId字段 2022-10-03 20:52:30 +08:00
清心
d759317396 🆕 #2831 【开放平台】新增小程序DNS预解析域名相关接口 2022-10-03 12:49:21 +00:00
Binary Wang
3bd517a007 🔖 发布 4.4.2.B 测试版本 2022-09-26 23:56:46 +08:00
Binary Wang
7219c2dbd0 🎨 清理一些jetbrain的校验注解 2022-09-26 23:29:11 +08:00
Nobody
26e2cbcb60 🎨 #2827 【企业微信】新增几个企业微信第三方回调的事件常量 2022-09-26 23:10:02 +08:00
xslong
320bbfe7be 🆕 #2825 【企业微信】增加分配在职成员的客户群的接口 2022-09-26 23:06:42 +08:00
Sun Chen
65134bd1ca 🎨 恢复误修改的代码 2022-09-24 17:19:48 +08:00
Javen
81cb16bf9f 🎨 【微信支付】沙箱环境api地址修改sandboxnew为 xdc/apiv2sandbox 2022-09-24 17:18:57 +08:00
Sun Chen
aa19a2874d 🎨 增加微信推送的自定义交易组件付款通知事件类型OPEN_PRODUCT_ORDER_PAY 2022-09-24 17:18:57 +08:00
Binary Wang
3477e41ad2 🎨 修改类可见范围,并优化部分文档 2022-09-24 17:18:57 +08:00
Nobody
7f7c0a3765 🆕 #2815【开放平台】查询公众号/小程序是否绑定open实现 && 增加授权用户资料变更事件常量 2022-09-19 20:00:16 +08:00
Binary Wang
b8d0baae5b 🔖 发布 4.4.1.B 测试版本 2022-09-14 00:04:21 +08:00
Cocowwy
286596f8a2 🎨 #2811 【公众号】用户管理增加可一次性拉取所有用户数据的接口 2022-09-13 21:41:49 +08:00
liming1019
310e1d91be 🎨 修复小程序支付管理获取订单详情接口请求参数格式错误 2022-09-11 20:33:20 +08:00
Binary Wang
3918005b1f 🎨 修改消息去重时线程池关闭问题 2022-09-02 19:40:02 +08:00
Binary Wang
a435ee5a01 🆕 #2807 【小程序】增加支付管理获取订单详情和申请退款的接口 2022-09-02 19:20:22 +08:00
Binary Wang
7a200c0574 🐛 #2806【企业微信】 修复获取审批数据接口的地址 2022-09-02 19:18:27 +08:00
0katekate0
80cc0e4939 【企业微信】 修复获取审批数据URL 2022-08-31 19:38:18 +08:00
liming
81bb1f3563 申请退款接口 2022-08-31 15:54:44 +08:00
liming
57ff6a80ec 获取订单详情接口 2022-08-31 15:40:30 +08:00
vishun
d19fec73d4 消息去重所用线程池设置为daemon线程,否则jvm关闭后线程池仍不关闭。 2022-08-30 14:21:23 +08:00
Binary Wang
db5826cfcf 🆕 #2801 【小程序】增加新版自定义交易组件之更新售后申请的接口 2022-08-29 18:18:02 +08:00
Binary Wang
dc8b5454e2 🆕 #2797【小程序】增加新版自定义交易组件获取售后单详情的接口 2022-08-28 23:32:26 +08:00
liming
30a0eb8e98 【小程序】增加新版自定义交易组件之更新售后申请API 2022-08-26 11:53:44 +08:00
liming
6e5800181b 【小程序】增加新版自定义交易组件获取售后单详情API 2022-08-25 22:48:17 +08:00
Binary Wang
4d526dbd7a 🎨 批量添加部分javadoc 2022-08-25 16:47:47 +08:00
Binary Wang
152e6a01fa 🐛 #2792【企业微信】修复家校应用接口single_choice属性错误问题 2022-08-25 16:35:56 +08:00
0katekate0
d39062353c [企业微信]fix家校应用single_choice属性字段 #2792 2022-08-25 01:12:32 +08:00
Binary Wang
8c461bbaf2 🎨 accessToken 接口添加 is_snapshotuser 字段 2022-08-24 15:45:15 +08:00
Binary Wang
3e09168019 🐛 unoinId使用Integer类型 2022-08-24 15:44:44 +08:00
imyzt
3abaa2c1d1 🐛 #2788 unoinId 使用 Integer 溢出导致GSON抛出NumberFormatException 2022-08-23 22:04:50 +08:00
陈俊霖
1dfde62772 accessToken 接口添加 is_snapshotuser 字段 2022-08-23 16:17:08 +08:00
Binary Wang
36602d58a5 🎨 fix javadoc by removing @date 2022-08-23 00:37:29 +08:00
Binary Wang
f94e67056d 🎨 ProfitSharingResult类增加分账接收方列表字段解析方法 2022-08-22 22:36:38 +08:00
赖骏劼
066c77c752 @laijj@在ProfitSharingResult扩充reecvice列表对象,方便使用者处理不同分账接收方的数据逻辑 2022-08-22 17:23:55 +08:00
Binary Wang
c3f4943acd 📝 更新版本信息 2022-08-22 09:52:40 +08:00
Binary Wang
e9c351a083 📝 更新版本信息 2022-08-21 23:38:08 +08:00
Binary Wang
dbd02fda8c 发布最新正式版4.4.0 2022-08-21 23:15:45 +08:00
Binary Wang
27081809d6 Merge pull request #2582 from Wechat-Group/develop
发布最新正式版4.3.0
2022-04-10 23:14:12 +08:00
Binary Wang
705256bb19 Merge pull request #2367 from Wechat-Group/develop
发布最新正式版4.2.0
2021-11-01 23:42:54 +08:00
Binary Wang
9004b089a2 Merge pull request #2141 from Wechat-Group/develop
发布最新正式版4.1.0
2021-06-02 20:49:50 +08:00
1218 changed files with 20790 additions and 3736 deletions

11
.circleci/config.yml Normal file
View File

@@ -0,0 +1,11 @@
version: 2.1
jobs:
build:
docker:
- image: cimg/openjdk:11.0
steps:
- checkout
- run:
name: Build
command: mvn -B -DskipTests clean package -Dcheckstyle.skip=true

View File

@@ -4,7 +4,7 @@
[![Github](https://img.shields.io/github/stars/Wechat-Group/WxJava?logo=github&style=flat)](https://github.com/Wechat-Group/WxJava)
[![GitHub release](https://img.shields.io/github/release/Wechat-Group/WxJava.svg)](https://github.com/Wechat-Group/WxJava/releases)
[![Maven Central](https://img.shields.io/maven-central/v/com.github.binarywang/wx-java.svg)](http://mvnrepository.com/artifact/com.github.binarywang/wx-java)
[![Build Status](https://app.travis-ci.com/Wechat-Group/WxJava.svg?branch=develop)](https://app.travis-ci.com/github/Wechat-Group/WxJava)
[![Build Status](https://img.shields.io/circleci/project/github/Wechat-Group/WxJava/develop.svg?sanitize=true)](https://circleci.com/gh/Wechat-Group/WxJava/tree/develop)
[![使用IntelliJ IDEA开发维护](https://img.shields.io/badge/IntelliJ%20IDEA-支持-blue.svg)](https://www.jetbrains.com/?from=WxJava-weixin-java-tools)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
@@ -17,7 +17,7 @@
<tr>
<td align="center" valign="middle" colspan="3">
<a href="http://www.ccflow.org/?from=wxjava" target="_blank">
<img height="120" src="http://binary.ac.cn/images/banners/ccflow.png" alt="">
<img height="120" src="https://ccfast.cc/AD/ccflow2.png" alt="ccflow">
</a>
</td>
</tr>
@@ -31,17 +31,17 @@
<tr>
<td align="left" valign="middle">
<a href="http://mp.weixin.qq.com/mp/homepage?__biz=MzI3MzAwMzk4OA==&hid=1&sn=f31af3bf562b116b061c9ab4edf70b61&scene=18#wechat_redirect" target="_blank">
<img height="120" src="http://binary.ac.cn/images/qrcodes/mp.png" alt="">
<img height="120" src="https://gitee.com/public-res/wx-java-images/raw/main/qrcodes/mp.png" alt="mp qrcode">
</a>
</td>
<td valign="middle">
<a href="https://www.diboot.com/" target="_blank">
<img height="120" src="http://binary.ac.cn/images/banners/diboot.png" alt="diboot低代码开发平台"/>
<img height="120" src="https://gitee.com/public-res/wx-java-images/raw/main/banners/diboot.png" alt="diboot低代码开发平台"/>
</a>
</td>
<td align="right" valign="middle">
<a href="https://promotion.aliyun.com/ntms/act/qwbk.html?userCode=7makzf5h" target="_blank">
<img height="120" src="http://binary.ac.cn/images/banners/aliyun.jpg" alt="">
<img height="120" src="https://gitee.com/public-res/wx-java-images/raw/main/banners/aliyun.jpg" alt="aliyun ad">
</a>
</td>
</tr>
@@ -49,7 +49,7 @@
### 重要信息
1. 项目合作洽谈请联系微信`binary0000`在微信里自行搜索并添加好友请注明来意如有关于SDK问题需讨论请参考下文入群讨论不要加此微信
2. **2022-4-10 发布 [【4.3.0正式版】](https://mp.weixin.qq.com/s/yCsa7nD4_DLjW1RDcrEk6g)**
2. **2022-8-21 发布 [【4.4.0正式版】](https://mp.weixin.qq.com/s/kHg-QHMK6ymbQwTdKFF2lQ)**
3. 贡献源码可以参考视频:[【贡献源码全过程(上集)】](https://mp.weixin.qq.com/s/3xUZSATWwHR_gZZm207h7Q)、[【贡献源码全过程(下集)】](https://mp.weixin.qq.com/s/nyzJwVVoYSJ4hSbwyvTx9A) ,友情提供:[程序员小山与Bug](https://space.bilibili.com/473631007)
4. 新手重要提示本项目仅是一个SDK开发工具包未提供Web实现建议使用 `maven``gradle` 引用本项目即可使用本SDK提供的各种功能详情可参考 **[【Demo项目】](demo.md)** 或本项目中的部分单元测试代码;
5. 微信开发新手请务必阅读【开发文档】([Gitee Wiki](https://gitee.com/binary/weixin-java-tools/wikis/Home) 或者 [Github Wiki](https://github.com/Wechat-Group/WxJava/wiki))的常见问题部分,可以少走很多弯路,节省不少时间。
@@ -80,7 +80,7 @@
<dependency>
<groupId>com.github.binarywang</groupId>
<artifactId>(不同模块参考下文)</artifactId>
<version>4.3.0</version>
<version>4.4.0</version>
</dependency>
```

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 KiB

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 366 KiB

After

Width:  |  Height:  |  Size: 241 KiB

15
pom.xml
View File

@@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.github.binarywang</groupId>
<artifactId>wx-java</artifactId>
<version>4.4.0</version>
<version>4.5.0</version>
<packaging>pom</packaging>
<name>WxJava - Weixin/Wechat Java SDK</name>
<description>微信开发Java SDK</description>
@@ -129,7 +129,8 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<httpclient.version>4.5.13</httpclient.version>
<jetty.version>9.4.43.v20210629</jetty.version>
<jetty.version>9.4.51.v20230217</jetty.version>
<!-- 这个不能用10以上的版本不支持jdk8-->
</properties>
<dependencyManagement>
@@ -185,7 +186,7 @@
<dependency>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
<version>1.4.19</version>
<version>1.4.20</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
@@ -225,7 +226,8 @@
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>7.1.0</version>
<version>7.5</version>
<!-- 这个不能用7.6以上的版本不支持jdk8-->
<scope>test</scope>
<exclusions>
<exclusion>
@@ -320,11 +322,6 @@
<artifactId>bcpkix-jdk15on</artifactId>
<version>1.68</version>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>2.0.1.Final</version>
</dependency>
</dependencies>
</dependencyManagement>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>com.github.binarywang</groupId>
<artifactId>wx-java</artifactId>
<version>4.4.0</version>
<version>4.5.0</version>
</parent>
<packaging>pom</packaging>
<artifactId>wx-java-spring-boot-starters</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<artifactId>wx-java-spring-boot-starters</artifactId>
<groupId>com.github.binarywang</groupId>
<version>4.4.0</version>
<version>4.5.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -9,7 +9,7 @@ import org.springframework.context.annotation.Import;
* 企业微信自动注册
*
* @author yl
* @date 2021/12/6
* created on 2021/12/6
*/
@Configuration
@EnableConfigurationProperties(WxCpProperties.class)

View File

@@ -14,7 +14,7 @@ import org.springframework.context.annotation.Configuration;
* 企业微信平台相关服务自动注册
*
* @author yl
* @date 2021/12/6
* created on 2021/12/6
*/
@Configuration
@RequiredArgsConstructor

View File

@@ -8,7 +8,7 @@ import org.springframework.context.annotation.Import;
* 企业微信存储策略自动配置
*
* @author yl
* @date 2021/12/6
* created on 2021/12/6
*/
@Configuration
@Import({

View File

@@ -10,7 +10,7 @@ import java.io.Serializable;
* 企业微信接入相关配置属性
*
* @author yl
* @date 2021/12/6
* created on 2021/12/6
*/
@Data
@NoArgsConstructor

View File

@@ -8,7 +8,7 @@ import org.apache.commons.lang3.StringUtils;
* WxCpConfigStorage 抽象配置类
*
* @author yl & Wang_Wong
* @date 2021/12/6
* created on 2021/12/6
*/
public abstract class AbstractWxCpConfigStorageConfiguration {

View File

@@ -13,7 +13,7 @@ import org.springframework.context.annotation.Configuration;
* 自动装配基于内存策略配置
*
* @author yl
* @date 2021/12/6
* created on 2021/12/6
*/
@Configuration
@ConditionalOnProperty(

View File

@@ -0,0 +1 @@
com.binarywang.spring.starter.wxjava.cp.config.WxCpAutoConfiguration

View File

@@ -3,7 +3,7 @@
<parent>
<artifactId>wx-java-spring-boot-starters</artifactId>
<groupId>com.github.binarywang</groupId>
<version>4.4.0</version>
<version>4.5.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -9,7 +9,7 @@ import org.springframework.context.annotation.Import;
* 自动配置.
*
* @author <a href="https://github.com/binarywang">Binary Wang</a>
* @date 2019-08-10
* created on 2019-08-10
*/
@Configuration
@EnableConfigurationProperties(WxMaProperties.class)

View File

@@ -4,7 +4,7 @@ package com.binarywang.spring.starter.wxjava.miniapp.enums;
* httpclient类型.
*
* @author <a href="https://github.com/binarywang">Binary Wang</a>
* @date 2020-05-25
* created on 2020-05-25
*/
public enum HttpClientType {
/**

View File

@@ -4,7 +4,7 @@ package com.binarywang.spring.starter.wxjava.miniapp.enums;
* storage类型.
*
* @author <a href="https://github.com/binarywang">Binary Wang</a>
* @date 2020-05-25
* created on 2020-05-25
*/
public enum StorageType {
/**

View File

@@ -6,7 +6,7 @@ import lombok.Data;
* redis 配置.
*
* @author <a href="https://github.com/binarywang">Binary Wang</a>
* @date 2020-08-30
* created on 2020-08-30
*/
@Data
public class RedisProperties {

View File

@@ -12,7 +12,7 @@ import static com.binarywang.spring.starter.wxjava.miniapp.properties.WxMaProper
* 属性配置类.
*
* @author <a href="https://github.com/binarywang">Binary Wang</a>
* @date 2019-08-10
* created on 2019-08-10
*/
@Data
@ConfigurationProperties(prefix = PREFIX)

View File

@@ -0,0 +1 @@
com.binarywang.spring.starter.wxjava.miniapp.config.WxMaAutoConfiguration

View File

@@ -5,7 +5,7 @@
<parent>
<artifactId>wx-java-spring-boot-starters</artifactId>
<groupId>com.github.binarywang</groupId>
<version>4.4.0</version>
<version>4.5.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -4,7 +4,7 @@ package com.binarywang.spring.starter.wxjava.mp.enums;
* httpclient类型.
*
* @author <a href="https://github.com/binarywang">Binary Wang</a>
* @date 2020-08-30
* created on 2020-08-30
*/
public enum HttpClientType {
/**

View File

@@ -4,7 +4,7 @@ package com.binarywang.spring.starter.wxjava.mp.enums;
* storage类型.
*
* @author <a href="https://github.com/binarywang">Binary Wang</a>
* @date 2020-08-30
* created on 2020-08-30
*/
public enum StorageType {
/**

View File

@@ -8,7 +8,7 @@ import java.io.Serializable;
* redis 配置属性.
*
* @author <a href="https://github.com/binarywang">Binary Wang</a>
* @date 2020-08-30
* created on 2020-08-30
*/
@Data
public class RedisProperties implements Serializable {

View File

@@ -0,0 +1 @@
com.binarywang.spring.starter.wxjava.mp.config.WxMpAutoConfiguration

View File

@@ -5,7 +5,7 @@
<parent>
<artifactId>wx-java-spring-boot-starters</artifactId>
<groupId>com.github.binarywang</groupId>
<version>4.4.0</version>
<version>4.5.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -0,0 +1 @@
com.binarywang.spring.starter.wxjava.open.config.WxOpenAutoConfiguration

View File

@@ -5,7 +5,7 @@
<parent>
<artifactId>wx-java-spring-boot-starters</artifactId>
<groupId>com.github.binarywang</groupId>
<version>4.4.0</version>
<version>4.5.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -0,0 +1 @@
com.binarywang.spring.starter.wxjava.pay.config.WxPayAutoConfiguration

View File

@@ -3,7 +3,7 @@
<parent>
<artifactId>wx-java-spring-boot-starters</artifactId>
<groupId>com.github.binarywang</groupId>
<version>4.4.0</version>
<version>4.5.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -4,7 +4,7 @@ package com.binarywang.spring.starter.wxjava.qidian.enums;
* httpclient类型.
*
* @author <a href="https://github.com/binarywang">Binary Wang</a>
* @date 2020-08-30
* created on 2020-08-30
*/
public enum HttpClientType {
/**

View File

@@ -4,7 +4,7 @@ package com.binarywang.spring.starter.wxjava.qidian.enums;
* storage类型.
*
* @author <a href="https://github.com/binarywang">Binary Wang</a>
* @date 2020-08-30
* created on 2020-08-30
*/
public enum StorageType {
/**

View File

@@ -8,7 +8,7 @@ import java.io.Serializable;
* redis 配置属性.
*
* @author <a href="https://github.com/binarywang">Binary Wang</a>
* @date 2020-08-30
* created on 2020-08-30
*/
@Data
public class RedisProperties implements Serializable {

View File

@@ -0,0 +1 @@
com.binarywang.spring.starter.wxjava.qidian.config.WxQidianAutoConfiguration

View File

@@ -6,7 +6,7 @@
<parent>
<groupId>com.github.binarywang</groupId>
<artifactId>wx-java</artifactId>
<version>4.4.0</version>
<version>4.5.0</version>
</parent>
<artifactId>weixin-graal</artifactId>

View File

@@ -6,7 +6,7 @@
<parent>
<groupId>com.github.binarywang</groupId>
<artifactId>wx-java</artifactId>
<version>4.4.0</version>
<version>4.5.0</version>
</parent>
<artifactId>weixin-java-common</artifactId>
@@ -77,10 +77,6 @@
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>

View File

@@ -223,6 +223,7 @@ public class WxConsts {
public static final String TEXT = "text";
public static final String VOICE = "voice";
public static final String IMAGE = "image";
public static final String IMAGES = "images";
public static final String MPVIDEO = "mpvideo";
}
@@ -309,7 +310,23 @@ public class WxConsts {
*/
public static final String LOCATION_SELECT = "location_select";
/**
* 授权用户资料变更事件
* 1、 当部分用户的资料存在风险时平台会对用户资料进行清理并通过消息推送服务器通知最近30天授权过的公众号开发者我们建议开发者留意响应该事件及时主动更新或清理用户的头像及昵称降低风险。
* 2、 当用户撤回授权信息时,平台会通过消息推送服务器通知给公众号开发者,请开发者注意及时删除用户信息。
*/
public static final String USER_INFO_MODIFIED = "user_info_modified";
/**
* 用户撤回授权事件
*/
public static final String USER_AUTHORIZATION_REVOKE = "user_authorization_revoke";
/**
* 群发模板回调事件
*/
public static final String TEMPLATE_SEND_JOB_FINISH = "TEMPLATESENDJOBFINISH";
/**
* 微信小店 订单付款通知.
*/
@@ -397,11 +414,29 @@ public class WxConsts {
*/
public static final String WEAPP_AUDIT_FAIL = "weapp_audit_fail";
/**
* 小程序自定义交易组件支付通知
*/
public static final String OPEN_PRODUCT_ORDER_PAY = "open_product_order_pay";
/**
* 点击菜单跳转小程序的事件推送
*/
public static final String VIEW_MINIPROGRAM = "view_miniprogram";
/**
* 订阅通知事件:用户操作订阅通知弹窗
*/
public static final String SUBSCRIBE_MSG_POPUP_EVENT = "subscribe_msg_popup_event";
/**
* 订阅通知事件:用户管理订阅通知
*/
public static final String SUBSCRIBE_MSG_CHANGE_EVENT = "subscribe_msg_change_event";
/**
* 订阅通知事件:发送订阅通知回调
*/
public static final String SUBSCRIBE_MSG_SENT_EVENT = "subscribe_msg_sent_event";
}
/**

View File

@@ -12,10 +12,10 @@ import java.util.concurrent.TimeUnit;
* @author jiangby
* @version 1.0
* <p>
* 消息去重记录消息ID首次出现时的时间戳
* 15S后定时任务触发时废除该记录消息ID
* 消息去重记录消息ID首次出现时的时间戳
* 15S后定时任务触发时废除该记录消息ID
* </p>
* @date 2022/5/26 1:32
* created on 2022/5/26 1:32
*/
@Slf4j
public class WxMessageInMemoryDuplicateCheckerSingleton implements WxMessageDuplicateChecker {
@@ -34,7 +34,7 @@ public class WxMessageInMemoryDuplicateCheckerSingleton implements WxMessageDupl
* 线程池
*/
private static final ScheduledThreadPoolExecutor SCHEDULED_THREAD_POOL_EXECUTOR = new ScheduledThreadPoolExecutor(1,
new ThreadFactoryBuilder().setNameFormat("wxMessage-memory-pool-%d").build(), new ThreadPoolExecutor.AbortPolicy());
new ThreadFactoryBuilder().setNameFormat("wxMessage-memory-pool-%d").setDaemon(true).build(), new ThreadPoolExecutor.AbortPolicy());
/**
* 消息id->消息时间戳的map.
@@ -71,7 +71,7 @@ public class WxMessageInMemoryDuplicateCheckerSingleton implements WxMessageDupl
* 内部类实现单例
*/
private static class WxMessageInnerClass {
static final WxMessageInMemoryDuplicateCheckerSingleton CHECKER_SINGLETON = new WxMessageInMemoryDuplicateCheckerSingleton();
static final WxMessageInMemoryDuplicateCheckerSingleton CHECKER_SINGLETON = new WxMessageInMemoryDuplicateCheckerSingleton();
}
/**

View File

@@ -0,0 +1,47 @@
package me.chanjar.weixin.common.api;
import lombok.RequiredArgsConstructor;
import org.redisson.api.RBucket;
import org.redisson.api.RedissonClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.concurrent.TimeUnit;
/**
* 利用redis检查消息是否重复
*
*/
@RequiredArgsConstructor
public class WxMessageInRedisDuplicateChecker implements WxMessageDuplicateChecker {
/**
* 过期时间
*/
private int expire = 10;
private final Logger log = LoggerFactory.getLogger(getClass());
private final RedissonClient redissonClient;
/**
* messageId是否重复
*
* @param messageId messageId
* @return 是否
*/
@Override
public boolean isDuplicate(String messageId) {
RBucket<String> r = redissonClient.getBucket("wx:message:duplicate:check:" + messageId);
boolean setSuccess = r.trySet("1", expire, TimeUnit.SECONDS);
return !setSuccess;
}
public int getExpire() {
return expire;
}
public void setExpire(int expire) {
this.expire = expire;
}
}

View File

@@ -4,7 +4,7 @@ package me.chanjar.weixin.common.bean;
* 包含toJson()方法的接口.
*
* @author <a href="https://github.com/binarywang">Binary Wang</a>
* @date 2020-10-05
* created on 2020-10-05
*/
public interface ToJson {
/**

View File

@@ -11,7 +11,7 @@ import java.io.Serializable;
* oauth2用户个人信息.
*
* @author <a href="https://github.com/binarywang">Binary Wang</a>
* @date 2020-10-11
* created on 2020-10-11
*/
@Data
public class WxOAuth2UserInfo implements Serializable {

View File

@@ -30,6 +30,9 @@ public class WxOAuth2AccessToken implements Serializable {
@SerializedName("scope")
private String scope;
@SerializedName("is_snapshotuser")
private Integer snapshotUser;
/**
* https://mp.weixin.qq.com/cgi-bin/announce?action=getannouncement&announce_id=11513156443eZYea&version=&lang=zh_CN.
* 本接口在scope参数为snsapi_base时不再提供unionID字段。

View File

@@ -10,7 +10,7 @@ import java.io.Serializable;
* OCR身份证识别结果.
*
* @author <a href="https://github.com/binarywang">Binary Wang</a>
* @date 2019-06-23
* created on 2019-06-23
*/
@Data
public class WxOcrIdCardResult implements Serializable {

View File

@@ -8,7 +8,7 @@ import java.io.Serializable;
* .
*
* @author <a href="https://github.com/binarywang">Binary Wang</a>
* @date 2021-01-27
* created on 2021-01-27
*/
@Data
public class CategoryData implements Serializable {

View File

@@ -8,7 +8,7 @@ import java.io.Serializable;
* .
*
* @author <a href="https://github.com/binarywang">Binary Wang</a>
* @date 2021-01-27
* created on 2021-01-27
*/
@Data
public class PubTemplateKeyword implements Serializable {

View File

@@ -8,7 +8,7 @@ import java.io.Serializable;
* .
*
* @author <a href="https://github.com/binarywang">Binary Wang</a>
* @date 2021-01-27
* created on 2021-01-27
*/
@Data
public class TemplateInfo implements Serializable {

View File

@@ -1136,6 +1136,11 @@ public enum WxOpenErrorMsgEnum {
*/
CODE_40222(40222, "invalid request idc domain"),
/**
* empty media cover, please check the media
*/
CODE_40229(40229, "媒体封面为空,请添加媒体封面"),
/**
* 缺少 access_token 参数 access_token missing
*/

View File

@@ -4,7 +4,7 @@ package me.chanjar.weixin.common.error;
* WxJava专用的runtime exception.
*
* @author <a href="https://github.com/binarywang">Binary Wang</a>
* @date 2020-09-26
* created on 2020-09-26
*/
public class WxRuntimeException extends RuntimeException {
private static final long serialVersionUID = 4881698471192264412L;

View File

@@ -1,5 +1,6 @@
package me.chanjar.weixin.common.redis;
import com.github.jedis.lock.JedisLock;
import lombok.RequiredArgsConstructor;
import me.chanjar.weixin.common.util.locks.JedisDistributedLock;
import redis.clients.jedis.Jedis;
@@ -8,6 +9,12 @@ import redis.clients.jedis.util.Pool;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.Lock;
/**
* @author Mario Luo
*
* @deprecated 该类底层使用过时的8年不维护的 {@link JedisLock}组件,不可靠,不建议继续使用。请
* 使用:{@link RedisTemplateWxRedisOps}、{@link RedissonWxRedisOps} 替换
*/
@RequiredArgsConstructor
public class JedisWxRedisOps implements WxRedisOps {
private final Pool<Jedis> jedisPool;

View File

@@ -8,6 +8,7 @@ import java.util.concurrent.locks.Lock;
* <p>
* 该接口不承诺稳定, 外部实现请继承{@link BaseWxRedisOps}
*
* @author Mario Luo
* @see BaseWxRedisOps 实现需要继承该类
* @see JedisWxRedisOps jedis实现
* @see RedissonWxRedisOps redisson实现

View File

@@ -21,7 +21,7 @@ import java.io.IOException;
* .
*
* @author : zhayueran
* @date 2019/6/27 14:06
* created on 2019/6/27 14:06
*/
public class OcrDiscernApacheHttpRequestExecutor extends OcrDiscernRequestExecutor<CloseableHttpClient, HttpHost> {
public OcrDiscernApacheHttpRequestExecutor(RequestHttp requestHttp) {

View File

@@ -13,7 +13,7 @@ import java.io.IOException;
* .
*
* @author zhayueran
* @date 2019/6/27 15:06
* created on 2019/6/27 15:06
*/
public abstract class OcrDiscernRequestExecutor<H, P> implements RequestExecutor<String, File> {
protected RequestHttp<H, P> requestHttp;

View File

@@ -8,7 +8,7 @@ import me.chanjar.weixin.common.error.WxErrorException;
* oauth2 相关接口.
*
* @author <a href="https://github.com/binarywang">Binary Wang</a>
* @date 2020-08-08
* created on 2020-08-08
*/
public interface WxOAuth2Service {
/**

View File

@@ -15,7 +15,7 @@ import java.io.File;
* https://mp.weixin.qq.com/wiki?t=resource/res_main&id=21516712284rHWMX
*
* @author <a href="https://github.com/binarywang">Binary Wang</a>
* @date 2019-06-22
* created on 2019-06-22
*/
public interface WxOcrService {

View File

@@ -8,7 +8,7 @@ import me.chanjar.weixin.common.error.WxErrorException;
* 微信服务接口.
*
* @author <a href="https://github.com/binarywang">Binary Wang</a>
* @date 2020-04-25
* created on 2020-04-25
*/
public interface WxService {
/**

View File

@@ -8,7 +8,7 @@ import java.util.Arrays;
/**
*
* @author Daniel Qian
* @date 14/10/19
* created on 14/10/19
*/
public class SHA1 {

View File

@@ -11,6 +11,9 @@ import java.util.Base64;
import static org.apache.commons.io.FileUtils.openOutputStream;
/**
* @author Daniel Qian
*/
public class FileUtils {
/**
@@ -21,7 +24,8 @@ public class FileUtils {
* @param ext 扩展名
* @param tmpDirFile 临时文件夹目录
*/
public static File createTmpFile(InputStream inputStream, String name, String ext, File tmpDirFile) throws IOException {
public static File createTmpFile(InputStream inputStream, String name, String ext, File tmpDirFile)
throws IOException {
File resultFile = File.createTempFile(name, '.' + ext, tmpDirFile);
resultFile.deleteOnExit();

View File

@@ -14,7 +14,7 @@ import java.io.Serializable;
* InputStreamData
*
* @author zichuan.zhou91@gmail.com
* @date 2022/2/15
* created on 2022/2/15
*/
@Data
@Accessors(chain = true)

View File

@@ -25,7 +25,7 @@ import java.io.InputStream;
* .
*
* @author ecoolper
* @date 2017/5/5
* created on 2017/5/5
*/
public class ApacheMediaDownloadRequestExecutor extends BaseMediaDownloadRequestExecutor<CloseableHttpClient, HttpHost> {
public ApacheMediaDownloadRequestExecutor(RequestHttp requestHttp, File tmpDirFile) {

View File

@@ -23,7 +23,7 @@ import java.io.IOException;
* 文件输入流上传.
*
* @author meiqin.zhou91@gmail.com
* @date 2022/02/15
* created on 2022/02/15
*/
public class ApacheMediaInputStreamUploadRequestExecutor extends MediaInputStreamUploadRequestExecutor<CloseableHttpClient, HttpHost> {
public ApacheMediaInputStreamUploadRequestExecutor(RequestHttp requestHttp) {

View File

@@ -16,7 +16,7 @@ import java.io.IOException;
* .
*
* @author ecoolper
* @date 2017/5/4
* created on 2017/5/4
*/
public class ApacheSimpleGetRequestExecutor extends SimpleGetRequestExecutor<CloseableHttpClient, HttpHost> {
public ApacheSimpleGetRequestExecutor(RequestHttp requestHttp) {

View File

@@ -18,7 +18,7 @@ import java.io.IOException;
* .
*
* @author ecoolper
* @date 2017/5/4
* created on 2017/5/4
*/
public class ApacheSimplePostRequestExecutor extends SimplePostRequestExecutor<CloseableHttpClient, HttpHost> {
public ApacheSimplePostRequestExecutor(RequestHttp requestHttp) {

View File

@@ -182,7 +182,6 @@ public class DefaultApacheHttpClientBuilder implements ApacheHttpClientBuilder {
.register("https", this.sslConnectionSocketFactory)
.build();
@SuppressWarnings("resource")
PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager(registry);
connectionManager.setMaxTotal(this.maxTotalConn);
connectionManager.setDefaultMaxPerRoute(this.maxConnPerHost);
@@ -238,12 +237,7 @@ public class DefaultApacheHttpClientBuilder implements ApacheHttpClientBuilder {
try {
SSLContext sslcontext = SSLContexts.custom()
//忽略掉对服务器端证书的校验
.loadTrustMaterial(new TrustStrategy() {
@Override
public boolean isTrusted(X509Certificate[] chain, String authType) throws CertificateException {
return true;
}
}).build();
.loadTrustMaterial((TrustStrategy) (chain, authType) -> true).build();
return new SSLConnectionSocketFactory(
sslcontext,

View File

@@ -25,7 +25,7 @@ import java.nio.charset.StandardCharsets;
* .
*
* @author ecoolper
* @date 2017/5/5
* created on 2017/5/5
*/
public class JoddHttpMediaDownloadRequestExecutor extends BaseMediaDownloadRequestExecutor<HttpConnectionProvider, ProxyInfo> {
public JoddHttpMediaDownloadRequestExecutor(RequestHttp requestHttp, File tmpDirFile) {

View File

@@ -22,7 +22,7 @@ import java.nio.charset.StandardCharsets;
* 文件输入流上传.
*
* @author meiqin.zhou91@gmail.com
* @date 2022/02/15
* created on 2022/02/15
*/
public class JoddHttpMediaInputStreamUploadRequestExecutor extends MediaInputStreamUploadRequestExecutor<HttpConnectionProvider, ProxyInfo> {
public JoddHttpMediaInputStreamUploadRequestExecutor(RequestHttp requestHttp) {

View File

@@ -20,7 +20,7 @@ import java.nio.charset.StandardCharsets;
* .
*
* @author ecoolper
* @date 2017/5/5
* created on 2017/5/5
*/
public class JoddHttpMediaUploadRequestExecutor extends MediaUploadRequestExecutor<HttpConnectionProvider, ProxyInfo> {
public JoddHttpMediaUploadRequestExecutor(RequestHttp requestHttp) {

View File

@@ -18,7 +18,7 @@ import java.nio.charset.StandardCharsets;
/**
* @author liming1019
* @date 2021/8/10
* created on 2021/8/10
*/
@Slf4j
public class JoddHttpMinishopMediaUploadRequestCustomizeExecutor extends MinishopUploadRequestCustomizeExecutor<HttpConnectionProvider, ProxyInfo> {

View File

@@ -22,7 +22,7 @@ import java.nio.charset.StandardCharsets;
* .
*
* @author ecoolper
* @date 2017/5/5
* created on 2017/5/5
*/
@Slf4j
public class JoddHttpMinishopMediaUploadRequestExecutor extends MinishopUploadRequestExecutor<HttpConnectionProvider, ProxyInfo> {

View File

@@ -17,7 +17,7 @@ import java.nio.charset.StandardCharsets;
* .
*
* @author ecoolper
* @date 2017/5/4
* created on 2017/5/4
*/
public class JoddHttpSimpleGetRequestExecutor extends SimpleGetRequestExecutor<HttpConnectionProvider, ProxyInfo> {
public JoddHttpSimpleGetRequestExecutor(RequestHttp requestHttp) {

View File

@@ -4,7 +4,6 @@ import jodd.http.HttpConnectionProvider;
import jodd.http.HttpRequest;
import jodd.http.HttpResponse;
import jodd.http.ProxyInfo;
import jodd.util.StringPool;
import me.chanjar.weixin.common.enums.WxType;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.common.util.http.RequestHttp;
@@ -17,7 +16,7 @@ import java.nio.charset.StandardCharsets;
* .
*
* @author ecoolper
* @date 2017/5/4
* created on 2017/5/4
*/
public class JoddHttpSimplePostRequestExecutor extends SimplePostRequestExecutor<HttpConnectionProvider, ProxyInfo> {
public JoddHttpSimplePostRequestExecutor(RequestHttp requestHttp) {
@@ -35,6 +34,7 @@ public class JoddHttpSimplePostRequestExecutor extends SimplePostRequestExecutor
}
request.withConnectionProvider(provider);
if (postEntity != null) {
request.contentType("application/json", "utf-8");
request.bodyText(postEntity);
}
HttpResponse response = request.send();

View File

@@ -0,0 +1,263 @@
package me.chanjar.weixin.common.util.http.okhttp;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import okhttp3.*;
import javax.annotation.concurrent.NotThreadSafe;
import java.net.Proxy;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
/**
* @author wulang
**/
@Slf4j
@Data
@NotThreadSafe
public class DefaultOkHttpClientBuilder implements OkHttpClientBuilder {
private final AtomicBoolean prepared = new AtomicBoolean(false);
/**
* 代理
*/
private Proxy proxy;
/**
* 授权
*/
private Authenticator authenticator;
/**
* 拦截器
*/
private final List<Interceptor> interceptorList = new ArrayList<>();
/**
* 请求调度管理
*/
private Dispatcher dispatcher;
/**
* 连接池
*/
private ConnectionPool connectionPool;
/**
* 监听网络请求过程
*/
private EventListener.Factory eventListenerFactory;
/**
* 是否支持失败重连
*/
private Boolean retryOnConnectionFailure;
/**
* 是否允许重定向操作
*/
private Boolean followRedirects;
/**
* 连接建立的超时时长
*/
private Long connectTimeout;
/**
* 连接建立的超时时间单位
*/
private TimeUnit connectTimeUnit;
/**
* 完整的请求过程超时时长
*/
private Long callTimeout;
/**
* 完整的请求过程超时时间单位
*/
private TimeUnit callTimeUnit;
/**
* 连接的IO读操作超时时长
*/
private Long readTimeout;
/**
* 连接的IO读操作超时时间单位
*/
private TimeUnit readTimeUnit;
/**
* 连接的IO写操作超时时长
*/
private Long writeTimeout;
/**
* 连接的IO写操作超时时间单位
*/
private TimeUnit writeTimeUnit;
/**
* ping的时间间隔
*/
private Integer pingInterval;
/**
* 持有client对象,仅初始化一次,避免多service实例的时候造成重复初始化的问题
*/
private OkHttpClient okHttpClient;
private DefaultOkHttpClientBuilder() {
}
public static DefaultOkHttpClientBuilder get() {
return DefaultOkHttpClientBuilder.SingletonHolder.INSTANCE;
}
@Override
public OkHttpClient build() {
if (!prepared.get()) {
prepare();
}
return this.okHttpClient;
}
@Override
public OkHttpClientBuilder proxy(Proxy proxy) {
this.proxy = proxy;
return this;
}
@Override
public OkHttpClientBuilder authenticator(Authenticator authenticator) {
this.authenticator = authenticator;
return this;
}
@Override
public OkHttpClientBuilder addInterceptor(Interceptor interceptor) {
this.interceptorList.add(interceptor);
return this;
}
@Override
public OkHttpClientBuilder setDispatcher(Dispatcher dispatcher) {
this.dispatcher = dispatcher;
return this;
}
@Override
public OkHttpClientBuilder setConnectionPool(ConnectionPool connectionPool) {
this.connectionPool = connectionPool;
return this;
}
@Override
public OkHttpClientBuilder setEventListenerFactory(EventListener.Factory eventListenerFactory) {
this.eventListenerFactory = eventListenerFactory;
return this;
}
@Override
public OkHttpClientBuilder setRetryOnConnectionFailure(Boolean retryOnConnectionFailure) {
this.retryOnConnectionFailure = retryOnConnectionFailure;
return this;
}
@Override
public OkHttpClientBuilder setFollowRedirects(Boolean followRedirects) {
this.followRedirects = followRedirects;
return this;
}
@Override
public OkHttpClientBuilder connectTimeout(Long timeout, TimeUnit unit) {
this.connectTimeout = timeout;
this.connectTimeUnit = unit;
return this;
}
@Override
public OkHttpClientBuilder callTimeout(Long timeout, TimeUnit unit) {
this.callTimeout = timeout;
this.callTimeUnit = unit;
return this;
}
@Override
public OkHttpClientBuilder readTimeout(Long timeout, TimeUnit unit) {
this.readTimeout = timeout;
this.readTimeUnit = unit;
return this;
}
@Override
public OkHttpClientBuilder writeTimeout(Long timeout, TimeUnit unit) {
this.writeTimeout = timeout;
this.writeTimeUnit = unit;
return this;
}
@Override
public OkHttpClientBuilder setPingInterval(Integer pingInterval) {
this.pingInterval = pingInterval;
return this;
}
private synchronized void prepare() {
if (prepared.get()) {
return;
}
OkHttpClient.Builder builder = new OkHttpClient.Builder();
if (this.authenticator != null) {
builder.authenticator(this.authenticator);
}
if (this.proxy != null) {
builder.proxy(this.proxy);
}
for (Interceptor interceptor : this.interceptorList) {
builder.addInterceptor(interceptor);
}
if (this.dispatcher != null) {
builder.dispatcher(dispatcher);
}
if (this.connectionPool != null) {
builder.connectionPool(connectionPool);
}
if (this.eventListenerFactory != null) {
builder.eventListenerFactory(this.eventListenerFactory);
}
if (this.retryOnConnectionFailure != null) {
builder.setRetryOnConnectionFailure$okhttp(this.retryOnConnectionFailure);
}
if (this.followRedirects != null) {
builder.followRedirects(this.followRedirects);
}
if (this.connectTimeout != null && this.connectTimeUnit != null) {
builder.connectTimeout(this.connectTimeout, this.connectTimeUnit);
}
if (this.callTimeout != null && this.callTimeUnit != null) {
builder.callTimeout(this.callTimeout, this.callTimeUnit);
}
if (this.readTimeout != null && this.readTimeUnit != null) {
builder.readTimeout(this.readTimeout, this.readTimeUnit);
}
if (this.writeTimeout != null && this.writeTimeUnit != null) {
builder.writeTimeout(this.writeTimeout, this.writeTimeUnit);
}
if (this.pingInterval != null) {
builder.setPingInterval$okhttp(this.pingInterval);
}
this.okHttpClient = builder.build();
prepared.set(true);
}
private static class SingletonHolder {
private static final DefaultOkHttpClientBuilder INSTANCE = new DefaultOkHttpClientBuilder();
}
}

View File

@@ -0,0 +1,126 @@
package me.chanjar.weixin.common.util.http.okhttp;
import okhttp3.*;
import java.net.Proxy;
import java.util.concurrent.TimeUnit;
/**
* @author wulang
**/
public interface OkHttpClientBuilder {
/**
* 构建OkHttpClient实例.
*
* @return OkHttpClient
*/
OkHttpClient build();
/**
* 代理
*
* @param proxy Proxy
* @return OkHttpClientBuilder
*/
OkHttpClientBuilder proxy(Proxy proxy);
/**
* 授权
*
* @param authenticator Authenticator
* @return OkHttpClientBuilder
*/
OkHttpClientBuilder authenticator(Authenticator authenticator);
/**
* 拦截器
*
* @param interceptor Interceptor
* @return OkHttpClientBuilder
*/
OkHttpClientBuilder addInterceptor(Interceptor interceptor);
/**
* 请求调度管理
*
* @param dispatcher Dispatcher
* @return OkHttpClientBuilder
*/
OkHttpClientBuilder setDispatcher(Dispatcher dispatcher);
/**
* 连接池
*
* @param connectionPool ConnectionPool
* @return OkHttpClientBuilder
*/
OkHttpClientBuilder setConnectionPool(ConnectionPool connectionPool);
/**
* 监听网络请求过程
*
* @param eventListenerFactory EventListener
* @return OkHttpClientBuilder
*/
OkHttpClientBuilder setEventListenerFactory(EventListener.Factory eventListenerFactory);
/**
* 是否支持失败重连
*
* @param retryOnConnectionFailure retryOnConnectionFailure
* @return OkHttpClientBuilder
*/
OkHttpClientBuilder setRetryOnConnectionFailure(Boolean retryOnConnectionFailure);
/**
* 是否允许重定向操作
*
* @param followRedirects followRedirects
* @return OkHttpClientBuilder
*/
OkHttpClientBuilder setFollowRedirects(Boolean followRedirects);
/**
* 连接建立的超时时间
*
* @param timeout 时长
* @param unit 时间单位
* @return OkHttpClientBuilder
*/
OkHttpClientBuilder connectTimeout(Long timeout, TimeUnit unit);
/**
* 完整的请求过程超时时间
*
* @param timeout 时长
* @param unit 时间单位
* @return OkHttpClientBuilder
*/
OkHttpClientBuilder callTimeout(Long timeout, TimeUnit unit);
/**
* 连接的IO读操作超时时间
*
* @param timeout 时长
* @param unit 时间单位
* @return OkHttpClientBuilder
*/
OkHttpClientBuilder readTimeout(Long timeout, TimeUnit unit);
/**
* 连接的IO写操作超时时间
*
* @param timeout 时长
* @param unit 时间单位
* @return OkHttpClientBuilder
*/
OkHttpClientBuilder writeTimeout(Long timeout, TimeUnit unit);
/**
* ping的时间间隔
*
* @param pingInterval ping的时间间隔
* @return OkHttpClientBuilder
*/
OkHttpClientBuilder setPingInterval(Integer pingInterval);
}

View File

@@ -0,0 +1,257 @@
package me.chanjar.weixin.common.util.http.okhttp;
import okhttp3.*;
import java.net.Proxy;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;
/**
* OkHttpClient 连接管理器 多一个DNS解析.
* <p>大部分代码拷贝自DefaultOkHttpClientBuilder</p>
*
* @author wulang
**/
public class OkHttpDnsClientBuilder implements OkHttpClientBuilder {
/**
* 代理
*/
private Proxy proxy;
/**
* 授权
*/
private Authenticator authenticator;
/**
* 拦截器
*/
private final List<Interceptor> interceptorList = new ArrayList<>();
/**
* 请求调度管理
*/
private Dispatcher dispatcher;
/**
* 连接池
*/
private ConnectionPool connectionPool;
/**
* 监听网络请求过程
*/
private EventListener.Factory eventListenerFactory;
/**
* 是否支持失败重连
*/
private Boolean retryOnConnectionFailure;
/**
* 是否允许重定向操作
*/
private Boolean followRedirects;
/**
* 连接建立的超时时长
*/
private Long connectTimeout;
/**
* 连接建立的超时时间单位
*/
private TimeUnit connectTimeUnit;
/**
* 完整的请求过程超时时长
*/
private Long callTimeout;
/**
* 完整的请求过程超时时间单位
*/
private TimeUnit callTimeUnit;
/**
* 连接的IO读操作超时时长
*/
private Long readTimeout;
/**
* 连接的IO读操作超时时间单位
*/
private TimeUnit readTimeUnit;
/**
* 连接的IO写操作超时时长
*/
private Long writeTimeout;
/**
* 连接的IO写操作超时时间单位
*/
private TimeUnit writeTimeUnit;
/**
* ping的时间间隔
*/
private Integer pingInterval;
private Dns dns;
private OkHttpClient okHttpClient;
private OkHttpDnsClientBuilder() {
}
public static OkHttpDnsClientBuilder get() {
return new OkHttpDnsClientBuilder();
}
public Dns getDns() {
return dns;
}
public void setDns(Dns dns) {
this.dns = dns;
}
@Override
public OkHttpClient build() {
prepare();
return this.okHttpClient;
}
@Override
public OkHttpClientBuilder proxy(Proxy proxy) {
this.proxy = proxy;
return this;
}
@Override
public OkHttpClientBuilder authenticator(Authenticator authenticator) {
this.authenticator = authenticator;
return this;
}
@Override
public OkHttpClientBuilder addInterceptor(Interceptor interceptor) {
this.interceptorList.add(interceptor);
return this;
}
@Override
public OkHttpClientBuilder setDispatcher(Dispatcher dispatcher) {
this.dispatcher = dispatcher;
return this;
}
@Override
public OkHttpClientBuilder setConnectionPool(ConnectionPool connectionPool) {
this.connectionPool = connectionPool;
return this;
}
@Override
public OkHttpClientBuilder setEventListenerFactory(EventListener.Factory eventListenerFactory) {
this.eventListenerFactory = eventListenerFactory;
return this;
}
@Override
public OkHttpClientBuilder setRetryOnConnectionFailure(Boolean retryOnConnectionFailure) {
this.retryOnConnectionFailure = retryOnConnectionFailure;
return this;
}
@Override
public OkHttpClientBuilder setFollowRedirects(Boolean followRedirects) {
this.followRedirects = followRedirects;
return this;
}
@Override
public OkHttpClientBuilder connectTimeout(Long timeout, TimeUnit unit) {
this.connectTimeout = timeout;
this.connectTimeUnit = unit;
return this;
}
@Override
public OkHttpClientBuilder callTimeout(Long timeout, TimeUnit unit) {
this.callTimeout = timeout;
this.callTimeUnit = unit;
return this;
}
@Override
public OkHttpClientBuilder readTimeout(Long timeout, TimeUnit unit) {
this.readTimeout = timeout;
this.readTimeUnit = unit;
return this;
}
@Override
public OkHttpClientBuilder writeTimeout(Long timeout, TimeUnit unit) {
this.writeTimeout = timeout;
this.writeTimeUnit = unit;
return this;
}
@Override
public OkHttpClientBuilder setPingInterval(Integer pingInterval) {
this.pingInterval = pingInterval;
return this;
}
private synchronized void prepare() {
OkHttpClient.Builder builder = new OkHttpClient.Builder();
if (this.authenticator != null) {
builder.authenticator(this.authenticator);
}
if (this.proxy != null) {
builder.proxy(this.proxy);
}
for (Interceptor interceptor : this.interceptorList) {
builder.addInterceptor(interceptor);
}
if (this.dispatcher != null) {
builder.dispatcher(dispatcher);
}
if (this.connectionPool != null) {
builder.connectionPool(connectionPool);
}
if (this.eventListenerFactory != null) {
builder.eventListenerFactory(this.eventListenerFactory);
}
if (this.retryOnConnectionFailure != null) {
builder.setRetryOnConnectionFailure$okhttp(this.retryOnConnectionFailure);
}
if (this.followRedirects != null) {
builder.followRedirects(this.followRedirects);
}
if (this.dns != null) {
builder.dns(this.dns);
}
if (this.connectTimeout != null && this.connectTimeUnit != null) {
builder.connectTimeout(this.connectTimeout, this.connectTimeUnit);
}
if (this.callTimeout != null && this.callTimeUnit != null) {
builder.callTimeout(this.callTimeout, this.callTimeUnit);
}
if (this.readTimeout != null && this.readTimeUnit != null) {
builder.readTimeout(this.readTimeout, this.readTimeUnit);
}
if (this.writeTimeout != null && this.writeTimeUnit != null) {
builder.writeTimeout(this.writeTimeout, this.writeTimeUnit);
}
if (this.pingInterval != null) {
builder.setPingInterval$okhttp(this.pingInterval);
}
this.okHttpClient = builder.build();
}
}

View File

@@ -21,7 +21,7 @@ import java.io.IOException;
/**
*.
* @author ecoolper
* @date 2017/5/5
* created on 2017/5/5
*/
@Slf4j
public class OkHttpMediaDownloadRequestExecutor extends BaseMediaDownloadRequestExecutor<OkHttpClient, OkHttpProxyInfo> {

View File

@@ -17,7 +17,7 @@ import java.io.InputStream;
* 文件输入流上传.
*
* @author meiqin.zhou91@gmail.com
* @date 2022/02/15
* created on 2022/02/15
*/
public class OkHttpMediaInputStreamUploadRequestExecutor extends MediaInputStreamUploadRequestExecutor<OkHttpClient, OkHttpProxyInfo> {
public OkHttpMediaInputStreamUploadRequestExecutor(RequestHttp requestHttp) {

View File

@@ -15,7 +15,7 @@ import java.io.IOException;
* .
*
* @author ecoolper
* @date 2017/5/5
* created on 2017/5/5
*/
public class OkHttpMediaUploadRequestExecutor extends MediaUploadRequestExecutor<OkHttpClient, OkHttpProxyInfo> {
public OkHttpMediaUploadRequestExecutor(RequestHttp requestHttp) {

View File

@@ -14,7 +14,7 @@ import java.io.IOException;
/**
* @author liming1019
* @date 2021/8/10
* created on 2021/8/10
*/
@Slf4j
public class OkHttpMinishopMediaUploadRequestCustomizeExecutor extends MinishopUploadRequestCustomizeExecutor<OkHttpClient, OkHttpProxyInfo> {

View File

@@ -18,7 +18,7 @@ import java.io.IOException;
* .
*
* @author ecoolper
* @date 2017/5/5
* created on 2017/5/5
*/
@Slf4j
public class OkHttpMinishopMediaUploadRequestExecutor extends MinishopUploadRequestExecutor<OkHttpClient, OkHttpProxyInfo> {

View File

@@ -14,7 +14,7 @@ import java.io.IOException;
* .
*
* @author ecoolper
* @date 2017/5/4
* created on 2017/5/4
*/
public class OkHttpSimpleGetRequestExecutor extends SimpleGetRequestExecutor<OkHttpClient, OkHttpProxyInfo> {
public OkHttpSimpleGetRequestExecutor(RequestHttp requestHttp) {

View File

@@ -14,7 +14,7 @@ import java.util.Objects;
* .
*
* @author ecoolper
* @date 2017/5/4
* created on 2017/5/4
*/
@Slf4j
public class OkHttpSimplePostRequestExecutor extends SimplePostRequestExecutor<OkHttpClient, OkHttpProxyInfo> {
@@ -24,7 +24,7 @@ public class OkHttpSimplePostRequestExecutor extends SimplePostRequestExecutor<O
@Override
public String execute(String uri, String postEntity, WxType wxType) throws WxErrorException, IOException {
RequestBody body = RequestBody.Companion.create(postEntity, MediaType.parse("text/plain; charset=utf-8"));
RequestBody body = RequestBody.Companion.create(postEntity, MediaType.parse("application/json; charset=utf-8"));
Request request = new Request.Builder().url(uri).post(body).build();
Response response = requestHttp.getRequestHttpClient().newCall(request).execute();
return this.handleResponse(wxType, Objects.requireNonNull(response.body()).string());

View File

@@ -1,8 +1,6 @@
package me.chanjar.weixin.common.util.locks;
import lombok.Getter;
import lombok.NonNull;
import org.jetbrains.annotations.NotNull;
import org.springframework.data.redis.connection.RedisStringCommands;
import org.springframework.data.redis.core.RedisCallback;
import org.springframework.data.redis.core.StringRedisTemplate;
@@ -34,11 +32,11 @@ public class RedisTemplateSimpleDistributedLock implements Lock {
private final ThreadLocal<String> valueThreadLocal = new ThreadLocal<>();
public RedisTemplateSimpleDistributedLock(@NonNull StringRedisTemplate redisTemplate, int leaseMilliseconds) {
public RedisTemplateSimpleDistributedLock( StringRedisTemplate redisTemplate, int leaseMilliseconds) {
this(redisTemplate, "lock:" + UUID.randomUUID().toString(), leaseMilliseconds);
}
public RedisTemplateSimpleDistributedLock(@NonNull StringRedisTemplate redisTemplate, @NonNull String key, int leaseMilliseconds) {
public RedisTemplateSimpleDistributedLock( StringRedisTemplate redisTemplate, String key, int leaseMilliseconds) {
if (leaseMilliseconds <= 0) {
throw new IllegalArgumentException("Parameter 'leaseMilliseconds' must grate then 0: " + leaseMilliseconds);
}
@@ -84,7 +82,7 @@ public class RedisTemplateSimpleDistributedLock implements Lock {
}
@Override
public boolean tryLock(long time, @NotNull TimeUnit unit) throws InterruptedException {
public boolean tryLock(long time, TimeUnit unit) throws InterruptedException {
long waitMs = unit.toMillis(time);
boolean locked = tryLock();
while (!locked && waitMs > 0) {

View File

@@ -9,7 +9,7 @@ import com.thoughtworks.xstream.converters.basic.StringConverter;
* Integer型数组转换器.
*
* @author <a href="https://github.com/binarywang">Binary Wang</a>
* @date 2019-08-22
* created on 2019-08-22
*/
public class IntegerArrayConverter extends StringConverter {
@Override
@@ -24,6 +24,11 @@ public class IntegerArrayConverter extends StringConverter {
@Override
public Object fromString(String str) {
if (str == null || str.length() == 0) {
return null;
}
final Iterable<String> iterable = Splitter.on(",").split(str);
final String[] strings = Iterables.toArray(iterable, String.class);
Integer[] result = new Integer[strings.length];

View File

@@ -9,7 +9,7 @@ import com.thoughtworks.xstream.converters.basic.StringConverter;
* Long型数组转换器.
*
* @author <a href="https://github.com/binarywang">Binary Wang</a>
* @date 2019-08-22
* created on 2019-08-22
*/
public class LongArrayConverter extends StringConverter {
@Override

View File

@@ -11,7 +11,6 @@ import com.thoughtworks.xstream.io.xml.PrettyPrintWriter;
import com.thoughtworks.xstream.io.xml.XppDriver;
import com.thoughtworks.xstream.security.NoTypePermission;
import com.thoughtworks.xstream.security.WildcardTypePermission;
import java.io.Writer;
/**
@@ -20,6 +19,13 @@ import java.io.Writer;
* @author Daniel Qian
*/
public class XStreamInitializer {
public static ClassLoader classLoader;
public static void setClassLoader(ClassLoader classLoaderInfo) {
classLoader = classLoaderInfo;
}
private static final XppDriver XPP_DRIVER = new XppDriver() {
@Override
public HierarchicalStreamWriter createWriter(Writer out) {
@@ -87,7 +93,10 @@ public class XStreamInitializer {
xstream.addPermission(new WildcardTypePermission(new String[]{
"me.chanjar.weixin.**", "cn.binarywang.wx.**", "com.github.binarywang.**"
}));
xstream.setClassLoader(Thread.currentThread().getContextClassLoader());
if (null == classLoader) {
classLoader = Thread.currentThread().getContextClassLoader();
}
xstream.setClassLoader(classLoader);
return xstream;
}

View File

@@ -11,7 +11,7 @@ import static org.testng.Assert.assertTrue;
* @author jiangby
* @version 1.0
* @description: 作用
* @date 2022/5/26 1:46
* created on 2022/5/26 1:46
*/
@Test
public class WxMessageInMemoryDuplicateCheckerSingletonTest {

View File

@@ -0,0 +1,57 @@
package me.chanjar.weixin.common.api;
import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.redisson.config.TransportMode;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
import java.util.concurrent.TimeUnit;
import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertTrue;
@Test
public class WxMessageInRedisDuplicateCheckerTest {
private RedissonClient redissonClient;
@BeforeTest
public void init() {
Config config = new Config();
config.useSingleServer().setAddress("redis://127.0.0.1:6379");
config.setTransportMode(TransportMode.NIO);
this.redissonClient = Redisson.create(config);
checker = new WxMessageInRedisDuplicateChecker(redissonClient);
checker.setExpire(2);
}
private WxMessageInRedisDuplicateChecker checker;
public void test() throws InterruptedException {
Long[] msgIds = new Long[]{1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L};
// 第一次检查
for (Long msgId : msgIds) {
boolean result = checker.isDuplicate(String.valueOf(msgId));
assertFalse(result);
}
// 过1秒再检查
TimeUnit.SECONDS.sleep(1);
for (Long msgId : msgIds) {
boolean result = checker.isDuplicate(String.valueOf(msgId));
assertTrue(result);
}
// 过1.5秒再检查
TimeUnit.MILLISECONDS.sleep(1500L);
for (Long msgId : msgIds) {
boolean result = checker.isDuplicate(String.valueOf(msgId));
assertFalse(result);
}
}
}

View File

@@ -6,7 +6,7 @@ import org.testng.annotations.Test;
/**
*
* @author <a href="https://github.com/binarywang">Binary Wang</a>
* @date 2020-06-06
* created on 2020-06-06
*/
public class WxNetCheckResultTest {

View File

@@ -0,0 +1,34 @@
package me.chanjar.weixin.common.util.fs;
import org.apache.commons.io.IOUtils;
import org.testng.annotations.Test;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.util.List;
import static org.assertj.core.api.Assertions.assertThat;
public class FileUtilsTest {
@Test
public void testCreateTmpFile() throws IOException {
String strings = "abc";
File tmpFile = FileUtils.createTmpFile(new ByteArrayInputStream(strings.getBytes()), "name", "txt");
System.out.println(tmpFile);
List<String> lines = IOUtils.readLines(Files.newInputStream(tmpFile.toPath()), Charset.defaultCharset());
assertThat(lines).hasSize(1);
assertThat(lines.get(0)).isEqualTo(strings);
}
@Test
public void testTestCreateTmpFile() {
}
@Test
public void testImageToBase64ByStream() {
}
}

View File

@@ -0,0 +1,66 @@
package me.chanjar.weixin.common.util.http.okhttp;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import org.testng.Assert;
import org.testng.annotations.Test;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
public class DefaultOkHttpClientBuilderTest {
@Test
public void testBuild() throws Exception {
DefaultOkHttpClientBuilder builder1 = DefaultOkHttpClientBuilder.get();
DefaultOkHttpClientBuilder builder2 = DefaultOkHttpClientBuilder.get();
Assert.assertSame(builder1, builder2, "DefaultOkHttpClientBuilder为单例,获取到的对象应该相同");
List<DefaultOkHttpClientBuilderTest.TestThread> threadList = new ArrayList<>(10);
for (int i = 0; i < 10; i++) {
DefaultOkHttpClientBuilderTest.TestThread thread = new DefaultOkHttpClientBuilderTest.TestThread();
thread.start();
threadList.add(thread);
}
for (DefaultOkHttpClientBuilderTest.TestThread testThread : threadList) {
testThread.join();
Assert.assertNotEquals(-1, testThread.getRespState(), "请求响应code不应为-1");
}
for (int i = 1; i < threadList.size(); i++) {
DefaultOkHttpClientBuilderTest.TestThread thread1 = threadList.get(i - 1);
DefaultOkHttpClientBuilderTest.TestThread thread2 = threadList.get(i);
Assert.assertSame(
thread1.getClient(),
thread2.getClient(),
"DefaultOkHttpClientBuilderTest为单例,并持有了相同的OkHttpClient"
);
}
}
public static class TestThread extends Thread {
private OkHttpClient client;
private int respState = -1;
@Override
public void run() {
client = DefaultOkHttpClientBuilder.get().build();
Request request = new Request.Builder()
.url("http://www.sina.com.cn/")
.build();
try (Response response = client.newCall(request).execute()) {
respState = response.code();
} catch (IOException e) {
// ignore
}
}
public OkHttpClient getClient() {
return client;
}
public int getRespState() {
return respState;
}
}
}

View File

@@ -9,7 +9,7 @@ import static org.assertj.core.api.Assertions.assertThat;
* GsonHelper 的单元测试.
*
* @author <a href="https://github.com/binarywang">Binary Wang</a>
* @date 2020-09-04
* created on 2020-09-04
*/
public class GsonHelperTest {

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>com.github.binarywang</groupId>
<artifactId>wx-java</artifactId>
<version>4.4.0</version>
<version>4.5.0</version>
</parent>
<artifactId>weixin-java-cp</artifactId>
@@ -88,6 +88,13 @@
<artifactId>moco-runner</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.13.4</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>

View File

@@ -15,8 +15,7 @@ import java.util.List;
* 官方文档:
* https://developer.work.weixin.qq.com/document/path/91552
*
* @author <a href="https://github.com/0katekate0">Wang_Wong</a>
* @date 2022-01-17
* @author <a href="https://github.com/0katekate0">Wang_Wong</a> created on 2022-01-17
*/
@Slf4j
public class Finance {
@@ -26,130 +25,182 @@ public class Finance {
private static final String SO_FILE = "so";
private static final String DLL_FILE = "dll";
public native static long NewSdk();
/**
* New sdk long.
*
* @return the long
*/
public native static long NewSdk();
/**
* 初始化函数
* Return值=0表示该API调用成功
*
* @param [in] sdk NewSdk返回的sdk指针
* @param [in] corpid 调用企业的企业id例如wwd08c8exxxx5ab44d可以在企业微信管理端--我的企业--企业信息查看
* @param [in] secret 聊天内容存档的Secret可以在企业微信管理端--管理工具--聊天内容存档查看
* @return 返回是否初始化成功
* 0 - 成功
* !=0 - 失败
*/
public native static int Init(long sdk, String corpid, String secret);
/**
* 初始化函数
* Return值=0表示该API调用成功
*
* @param sdk the sdk
* @param corpid the corpid
* @param secret the secret
* @return 返回是否初始化成功 0 - 成功 !=0 - 失败
*/
public native static int Init(long sdk, String corpid, String secret);
/**
* 拉取聊天记录函数
* Return值=0表示该API调用成功
*
* @param [in] sdk NewSdk返回的sdk指针
* @param [in] seq 从指定的seq开始拉取消息注意的是返回的消息从seq+1开始返回seq为之前接口返回的最大seq值。首次使用请使用seq:0
* @param [in] limit 一次拉取的消息条数最大值1000条超过1000条会返回错误
* @param [in] proxy 使用代理的请求需要传入代理的链接。如socks5://10.0.0.1:8081 或者 http://10.0.0.1:8081
* @param [in] passwd 代理账号密码,需要传入代理的账号密码。如 user_name:passwd_123
* @param [out] chatDatas 返回本次拉取消息的数据slice结构体.内容包括errcode/errmsg以及每条消息内容。
* @return 返回是否调用成功
* 0 - 成功
* !=0 - 失败
*/
public native static int GetChatData(long sdk, long seq, long limit, String proxy, String passwd, long timeout, long chatData);
/**
* 拉取聊天记录函数
* Return值=0表示该API调用成功
*
* @param sdk the sdk
* @param seq the seq
* @param limit the limit
* @param proxy the proxy
* @param passwd the passwd
* @param timeout the timeout
* @param chatData the chat data
* @return 返回是否调用成功 0 - 成功 !=0 - 失败
*/
public native static int GetChatData(long sdk, long seq, long limit, String proxy, String passwd, long timeout, long chatData);
/**
* 拉取媒体消息函数
* Return值=0表示该API调用成功
*
* @param [in] sdk NewSdk返回的sdk指针
* @param [in] sdkFileid 从GetChatData返回的聊天消息中媒体消息包括的sdkfileid
* @param [in] proxy 使用代理的请求需要传入代理的链接。如socks5://10.0.0.1:8081 或者 http://10.0.0.1:8081
* @param [in] passwd 代理账号密码,需要传入代理的账号密码。如 user_name:passwd_123
* @param [in] indexbuf 媒体消息分片拉取需要填入每次拉取的索引信息。首次不需要填写默认拉取512k后续每次调用只需要将上次调用返回的outindexbuf填入即可。
* @param [out] media_data 返回本次拉取的媒体数据.MediaData结构体.内容包括data(数据内容)/outindexbuf(下次索引)/is_finish(拉取完成标记)
* @return 返回是否调用成功
* 0 - 成功
* !=0 - 失败
*/
public native static int GetMediaData(long sdk, String indexbuf, String sdkField, String proxy, String passwd, long timeout, long mediaData);
/**
* 拉取媒体消息函数
* Return值=0表示该API调用成功
*
* @param sdk the sdk
* @param indexbuf the indexbuf
* @param sdkField the sdk field
* @param proxy the proxy
* @param passwd the passwd
* @param timeout the timeout
* @param mediaData the media data
* @return 返回是否调用成功 0 - 成功 !=0 - 失败
*/
public native static int GetMediaData(long sdk, String indexbuf, String sdkField, String proxy, String passwd, long timeout, long mediaData);
/**
* @param [in] encrypt_key, getchatdata返回的encrypt_key
* @param [in] encrypt_msg, getchatdata返回的content
* @param [out] msg, 解密的消息明文
* @return 返回是否调用成功
* 0 - 成功
* !=0 - 失败
* @brief 解析密文
*/
public native static int DecryptData(long sdk, String encrypt_key, String encrypt_msg, long msg);
/**
* Decrypt data int.
*
* @param sdk the sdk
* @param encrypt_key the encrypt key
* @param encrypt_msg the encrypt msg
* @param msg the msg
* @return 返回是否调用成功 0 - 成功 !=0 - 失败
* @brief 解析密文
*/
public native static int DecryptData(long sdk, String encrypt_key, String encrypt_msg, long msg);
public native static void DestroySdk(long sdk);
/**
* Destroy sdk.
*
* @param sdk the sdk
*/
public native static void DestroySdk(long sdk);
public native static long NewSlice();
/**
* New slice long.
*
* @return the long
*/
public native static long NewSlice();
/**
* @return
* @brief 释放slice和NewSlice成对使用
*/
public native static void FreeSlice(long slice);
/**
* Free slice.
*
* @param slice the slice
* @return
* @brief 释放slice 和NewSlice成对使用
*/
public native static void FreeSlice(long slice);
/**
* @return 内容
* @brief 获取slice内容
*/
public native static String GetContentFromSlice(long slice);
/**
* Get content from slice string.
*
* @param slice the slice
* @return 内容 string
* @brief 获取slice内容
*/
public native static String GetContentFromSlice(long slice);
/**
* @return 内容
* @brief 获取slice内容长度
*/
public native static int GetSliceLen(long slice);
/**
* Get slice len int.
*
* @param slice the slice
* @return 内容 int
* @brief 获取slice内容长度
*/
public native static int GetSliceLen(long slice);
public native static long NewMediaData();
/**
* New media data long.
*
* @return the long
*/
public native static long NewMediaData();
public native static void FreeMediaData(long mediaData);
/**
* Free media data.
*
* @param mediaData the media data
*/
public native static void FreeMediaData(long mediaData);
/**
* @return outindex
* @brief 获取mediadata outindex
*/
public native static String GetOutIndexBuf(long mediaData);
/**
* Get out index buf string.
*
* @param mediaData the media data
* @return outindex string
* @brief 获取mediadata outindex
*/
public native static String GetOutIndexBuf(long mediaData);
/**
* @return data
* @brief 获取mediadata data数据
*/
public native static byte[] GetData(long mediaData);
/**
* Get data byte [ ].
*
* @param mediaData the media data
* @return data byte [ ]
* @brief 获取mediadata data数据
*/
public native static byte[] GetData(long mediaData);
public native static int GetIndexLen(long mediaData);
/**
* Get index len int.
*
* @param mediaData the media data
* @return the int
*/
public native static int GetIndexLen(long mediaData);
public native static int GetDataLen(long mediaData);
/**
* Get data len int.
*
* @param mediaData the media data
* @return the int
*/
public native static int GetDataLen(long mediaData);
/**
* @return 1完成、0未完成
* @brief 判断mediadata是否结束
*/
public native static int IsMediaDataFinish(long mediaData);
/**
* Is media data finish int.
*
* @param mediaData the media data
* @return 1完成 、0未完成
* @brief 判断mediadata是否结束
*/
public native static int IsMediaDataFinish(long mediaData);
/**
* 判断Windows环境
*
* @return
*/
public static boolean isWindows() {
/**
* 判断Windows环境
*
* @return boolean
*/
public static boolean isWindows() {
String osName = System.getProperties().getProperty("os.name");
log.info("Loading System Libraries, Current OS Version Is: {}", osName);
return osName.toUpperCase().contains("WINDOWS");
}
/**
* 加载系统类库
*
* @param libFiles 类库配置文件
* @param prefixPath 类库文件的前缀路径
*/
public Finance(List<String> libFiles, String prefixPath) {
/**
* 加载系统类库
*
* @param libFiles 类库配置文件
* @param prefixPath 类库文件的前缀路径
*/
public Finance(List<String> libFiles, String prefixPath) {
boolean isWindows = Finance.isWindows();
for (String file : libFiles) {
String suffix = file.substring(file.lastIndexOf(".") + 1);
@@ -168,14 +219,14 @@ public class Finance {
}
/**
* 初始化类库文件
*
* @param libFiles
* @param prefixPath
* @return
*/
public synchronized static Finance loadingLibraries(List<String> libFiles, String prefixPath) {
/**
* 初始化类库文件
*
* @param libFiles the lib files
* @param prefixPath the prefix path
* @return finance
*/
public synchronized static Finance loadingLibraries(List<String> libFiles, String prefixPath) {
if (finance != null) {
return finance;
}
@@ -183,12 +234,12 @@ public class Finance {
return finance;
}
/**
* 单例sdk
*
* @return
*/
public synchronized static long SingletonSDK() {
/**
* 单例sdk
*
* @return long
*/
public synchronized static long SingletonSDK() {
if (sdk > 0) {
return sdk;
}
@@ -196,12 +247,13 @@ public class Finance {
return sdk;
}
/**
* 销毁sdk,保证线程可见性
*
* @return
*/
public synchronized static void DestroySingletonSDK(long destroySDK) {
/**
* 销毁sdk,保证线程可见性
*
* @param destroySDK the destroy sdk
* @return
*/
public synchronized static void DestroySingletonSDK(long destroySDK) {
sdk = 0L;
Finance.DestroySdk(destroySDK);
}

View File

@@ -8,7 +8,7 @@ import java.util.List;
/**
* <pre>
* 管理企业号应用
* 文档地址https://work.weixin.qq.com/api/doc#10087
* 文档地址:<a href="https://work.weixin.qq.com/api/doc#10087">...</a>
* Created by huansinho on 2018/4/13.
* </pre>
*
@@ -19,11 +19,12 @@ public interface WxCpAgentService {
* <pre>
* 获取企业号应用信息
* 该API用于获取企业号某个应用的基本信息包括头像、昵称、帐号类型、认证类型、可见范围等信息
* 详情请见: https://work.weixin.qq.com/api/doc#10087
* 详情请见: <a href="https://work.weixin.qq.com/api/doc#10087">...</a>
* </pre>
*
* @param agentId 企业应用的id
* @return 部门id
* @return wx cp agent
* @throws WxErrorException the wx error exception
*/
WxCpAgent get(Integer agentId) throws WxErrorException;
@@ -31,10 +32,11 @@ public interface WxCpAgentService {
* <pre>
* 设置应用.
* 仅企业可调用,可设置当前凭证对应的应用;第三方不可调用。
* 详情请见: https://work.weixin.qq.com/api/doc#10088
* 详情请见: <a href="https://work.weixin.qq.com/api/doc#10088">...</a>
* </pre>
*
* @param agentInfo 应用信息
* @throws WxErrorException the wx error exception
*/
void set(WxCpAgent agentInfo) throws WxErrorException;
@@ -42,9 +44,11 @@ public interface WxCpAgentService {
* <pre>
* 获取应用列表.
* 企业仅可获取当前凭证对应的应用;第三方仅可获取被授权的应用。
* 详情请见: https://work.weixin.qq.com/api/doc#11214
* 详情请见: <a href="https://work.weixin.qq.com/api/doc#11214">...</a>
* </pre>
*
* @return the list
* @throws WxErrorException the wx error exception
*/
List<WxCpAgent> list() throws WxErrorException;

View File

@@ -4,15 +4,36 @@ import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.cp.bean.WxCpAgentWorkBench;
/**
* The interface Wx cp agent work bench service.
* <a href="https://work.weixin.qq.com/api/doc/90000/90135/92535">工作台自定义展示</a>
*
* @author songshiyu
* @date : create in 16:16 2020/9/27
* @description: 工作台自定义展示https://work.weixin.qq.com/api/doc/90000/90135/92535
* created on 16:16 2020/9/27
*/
public interface WxCpAgentWorkBenchService {
/**
* Sets work bench template.
*
* @param wxCpAgentWorkBench the wx cp agent work bench
* @throws WxErrorException the wx error exception
*/
void setWorkBenchTemplate(WxCpAgentWorkBench wxCpAgentWorkBench) throws WxErrorException;
/**
* Gets work bench template.
*
* @param agentid the agentid
* @return the work bench template
* @throws WxErrorException the wx error exception
*/
String getWorkBenchTemplate(Long agentid) throws WxErrorException;
/**
* Sets work bench data.
*
* @param wxCpAgentWorkBench the wx cp agent work bench
* @throws WxErrorException the wx error exception
*/
void setWorkBenchData(WxCpAgentWorkBench wxCpAgentWorkBench) throws WxErrorException;
}

View File

@@ -1,8 +1,8 @@
package me.chanjar.weixin.cp.api;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.cp.bean.message.WxCpAppChatMessage;
import me.chanjar.weixin.cp.bean.WxCpChat;
import me.chanjar.weixin.cp.bean.message.WxCpAppChatMessage;
import java.util.List;
@@ -19,7 +19,7 @@ public interface WxCpChatService {
* @param owner 指定群主的id。如果不指定系统会随机从userlist中选一人作为群主
* @param users 群成员id列表。至少2人至多500人
* @param chatId 群聊的唯一标志不能与已有的群重复字符串类型最长32个字符。只允许字符0-9及字母a-zA-Z。如果不填系统会随机生成群id
* @return 创建的群聊会话chatId
* @return 创建的群聊会话chatId string
* @throws WxErrorException 异常
*/
String create(String name, String owner, List<String> users, String chatId) throws WxErrorException;
@@ -40,7 +40,7 @@ public interface WxCpChatService {
* 获取群聊会话.
*
* @param chatId 群聊编号
* @return 群聊会话
* @return 群聊会话 wx cp chat
* @throws WxErrorException 异常
*/
WxCpChat get(String chatId) throws WxErrorException;
@@ -49,7 +49,7 @@ public interface WxCpChatService {
* 应用支持推送文本、图片、视频、文件、图文等类型.
* 请求方式: POSTHTTPS
* 请求地址: https://qyapi.weixin.qq.com/cgi-bin/appchat/send?access_token=ACCESS_TOKEN
* 文档地址https://work.weixin.qq.com/api/doc#90000/90135/90248
* 文档地址:<a href="https://work.weixin.qq.com/api/doc#90000/90135/90248">...</a>
*
* @param message 要发送的消息内容对象
* @throws WxErrorException 异常

View File

@@ -0,0 +1,18 @@
package me.chanjar.weixin.cp.api;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.cp.bean.corpgroup.*;
import java.util.List;
/**
* @Project: WxJava
* @Package: me.chanjar.weixin.cp.api
* @Description: 企业互联相关接口
* @Author: libo
* @Email: 422423229@qq.com
* @Date: 27/2/2023 9:57 PM
*/
public interface WxCpCorpGroupService {
List<WxCpCorpGroupCorp> listAppShareInfo(Integer agentId,Integer businessType,String corpId,Integer limit,String cursor) throws WxErrorException;
}

View File

@@ -19,11 +19,11 @@ public interface WxCpDepartmentService {
* <pre>
* 部门管理接口 - 创建部门.
* 最多支持创建500个部门
* 详情请见: https://work.weixin.qq.com/api/doc#90000/90135/90205
* 详情请见: <a href="https://work.weixin.qq.com/api/doc#90000/90135/90205">...</a>
* </pre>
*
* @param depart 部门
* @return 部门id
* @return 部门id long
* @throws WxErrorException 异常
*/
Long create(WxCpDepart depart) throws WxErrorException;
@@ -31,11 +31,11 @@ public interface WxCpDepartmentService {
/**
* <pre>
* 部门管理接口 - 获取单个部门详情.
* 详情请见: https://developer.work.weixin.qq.com/document/path/95351
* 详情请见: <a href="https://developer.work.weixin.qq.com/document/path/95351">...</a>
* </pre>
*
* @param id 部门id
* @return 部门信息
* @return 部门信息 wx cp depart
* @throws WxErrorException 异常
*/
WxCpDepart get(Long id) throws WxErrorException;
@@ -43,11 +43,11 @@ public interface WxCpDepartmentService {
/**
* <pre>
* 部门管理接口 - 获取部门列表.
* 详情请见: https://work.weixin.qq.com/api/doc#90000/90135/90208
* 详情请见: <a href="https://work.weixin.qq.com/api/doc#90000/90135/90208">...</a>
* </pre>
*
* @param id 部门id。获取指定部门及其下的子部门。非必需可为null
* @return 获取的部门列表
* @return 获取的部门列表 list
* @throws WxErrorException 异常
*/
List<WxCpDepart> list(Long id) throws WxErrorException;
@@ -55,11 +55,11 @@ public interface WxCpDepartmentService {
/**
* <pre>
* 部门管理接口 - 获取子部门ID列表.
* 详情请见: https://developer.work.weixin.qq.com/document/path/95350
* 详情请见: <a href="https://developer.work.weixin.qq.com/document/path/95350">...</a>
* </pre>
*
* @param id 部门id。获取指定部门及其下的子部门以及子部门的子部门等等递归。 如果不填,默认获取全量组织架构
* @return 子部门ID列表
* @return 子部门ID列表 list
* @throws WxErrorException 异常
*/
List<WxCpDepart> simpleList(Long id) throws WxErrorException;
@@ -67,7 +67,7 @@ public interface WxCpDepartmentService {
/**
* <pre>
* 部门管理接口 - 更新部门.
* 详情请见: https://work.weixin.qq.com/api/doc#90000/90135/90206
* 详情请见: <a href="https://work.weixin.qq.com/api/doc#90000/90135/90206">...</a>
* 如果id为0(未部门),1(黑名单),2(星标组)或者不存在的id微信会返回系统繁忙的错误
* </pre>
*
@@ -79,7 +79,7 @@ public interface WxCpDepartmentService {
/**
* <pre>
* 部门管理接口 - 删除部门.
* 详情请见: https://work.weixin.qq.com/api/doc#90000/90135/90207
* 详情请见: <a href="https://work.weixin.qq.com/api/doc#90000/90135/90207">...</a>
* 应用须拥有指定部门的管理权限
* </pre>
*

View File

@@ -7,9 +7,8 @@ import me.chanjar.weixin.cp.bean.export.WxCpExportResult;
/**
* 异步导出接口
*
* @author <a href="https://github.com/zhongjun96">zhongjun</a>
* @date 2022/4/21
**/
* @author <a href="https://github.com/zhongjun96">zhongjun</a> created on 2022/4/21
*/
public interface WxCpExportService {
/**
@@ -93,7 +92,7 @@ public interface WxCpExportService {
* </pre>
*
* @param jobId 异步任务id
* @return 导出结果
* @return 导出结果 result
* @throws WxErrorException .
*/
WxCpExportResult getResult(String jobId) throws WxErrorException;

View File

@@ -1,12 +1,12 @@
package me.chanjar.weixin.cp.api;
import lombok.NonNull;
import me.chanjar.weixin.common.bean.result.WxMediaUploadResult;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.cp.bean.WxCpBaseResp;
import me.chanjar.weixin.cp.bean.external.*;
import me.chanjar.weixin.cp.bean.external.contact.*;
import org.jetbrains.annotations.NotNull;
import me.chanjar.weixin.cp.bean.external.interceptrule.WxCpInterceptRule;
import me.chanjar.weixin.cp.bean.external.interceptrule.WxCpInterceptRuleAddRequest;
import java.io.File;
import java.io.IOException;
@@ -42,7 +42,7 @@ public interface WxCpExternalContactService {
* @return wx cp contact way result
* @throws WxErrorException the wx error exception
*/
WxCpContactWayResult addContactWay(@NonNull WxCpContactWayInfo info) throws WxErrorException;
WxCpContactWayResult addContactWay(WxCpContactWayInfo info) throws WxErrorException;
/**
* 获取企业已配置的「联系我」方式
@@ -55,7 +55,8 @@ public interface WxCpExternalContactService {
* @return contact way
* @throws WxErrorException the wx error exception
*/
WxCpContactWayInfo getContactWay(@NonNull String configId) throws WxErrorException;
WxCpContactWayInfo getContactWay(String configId) throws WxErrorException;
/**
* 更新企业已配置的「联系我」方式
*
@@ -67,7 +68,7 @@ public interface WxCpExternalContactService {
* @return wx cp base resp
* @throws WxErrorException the wx error exception
*/
WxCpBaseResp updateContactWay(@NonNull WxCpContactWayInfo info) throws WxErrorException;
WxCpBaseResp updateContactWay(WxCpContactWayInfo info) throws WxErrorException;
/**
* 删除企业已配置的「联系我」方式
@@ -80,7 +81,7 @@ public interface WxCpExternalContactService {
* @return wx cp base resp
* @throws WxErrorException the wx error exception
*/
WxCpBaseResp deleteContactWay(@NonNull String configId) throws WxErrorException;
WxCpBaseResp deleteContactWay(String configId) throws WxErrorException;
/**
* 结束临时会话
@@ -96,7 +97,7 @@ public interface WxCpExternalContactService {
* @return wx cp base resp
* @throws WxErrorException the wx error exception
*/
WxCpBaseResp closeTempChat(@NonNull String userId, @NonNull String externalUserId) throws WxErrorException;
WxCpBaseResp closeTempChat(String userId, String externalUserId) throws WxErrorException;
/**
@@ -142,7 +143,7 @@ public interface WxCpExternalContactService {
* 企业和服务商可通过此接口将微信外部联系人的userid转为微信openid用于调用支付相关接口。暂不支持企业微信外部联系人ExternalUserid为wo开头的userid转openid。
*
* @param externalUserid 微信外部联系人的userid
* @return 该企业的外部联系人openid
* @return 该企业的外部联系人openid string
* @throws WxErrorException .
*/
String convertToOpenid(String externalUserid) throws WxErrorException;
@@ -165,13 +166,13 @@ public interface WxCpExternalContactService {
* </pre>
*
* @param unionid 微信客户的unionid
* @return 该企业的外部联系人ID
* @param openid the openid
* @return 该企业的外部联系人ID string
* @throws WxErrorException .
*/
String unionidToExternalUserid(@NotNull String unionid,String openid) throws WxErrorException;
String unionidToExternalUserid(String unionid, String openid) throws WxErrorException;
/**
*
* 配置客户群进群方式
* 企业可以在管理后台-客户联系中配置「加入群聊」的二维码或者小程序按钮,客户通过扫描二维码或点击小程序上的按钮,即可加入特定的客户群。
* 企业可通过此接口为具有客户联系功能的成员生成专属的二维码或者小程序按钮。
@@ -179,40 +180,44 @@ public interface WxCpExternalContactService {
* 注意:
* 通过API添加的配置不会在管理端进行展示每个企业可通过API最多配置50万个「加入群聊」(与「联系我」共用50万的额度)。
* 文档地址https://developer.work.weixin.qq.com/document/path/92229
* @param wxCpGroupJoinWayInfo
*
* @param wxCpGroupJoinWayInfo the wx cp group join way info
* @return {@link WxCpGroupJoinWayResult}
* @throws WxErrorException
* @throws WxErrorException the wx error exception
*/
WxCpGroupJoinWayResult addJoinWay(@NonNull WxCpGroupJoinWayInfo wxCpGroupJoinWayInfo) throws WxErrorException;
WxCpGroupJoinWayResult addJoinWay(WxCpGroupJoinWayInfo wxCpGroupJoinWayInfo) throws WxErrorException;
/**
*更新客户群进群方式配置
* 更新客户群进群方式配置
* 更新进群方式配置信息。注意:使用覆盖的方式更新。
* 文档地址https://developer.work.weixin.qq.com/document/path/92229
* @param wxCpGroupJoinWayInfo
* @return
* @throws WxErrorException
*
* @param wxCpGroupJoinWayInfo the wx cp group join way info
* @return wx cp base resp
* @throws WxErrorException the wx error exception
*/
WxCpBaseResp updateJoinWay(@NonNull WxCpGroupJoinWayInfo wxCpGroupJoinWayInfo) throws WxErrorException;
WxCpBaseResp updateJoinWay(WxCpGroupJoinWayInfo wxCpGroupJoinWayInfo) throws WxErrorException;
/**
* 获取客户群进群方式配置
* 获取企业配置的群二维码或小程序按钮。
* 文档地址https://developer.work.weixin.qq.com/document/path/92229
* @param configId
* @return
* @throws WxErrorException
*
* @param configId the config id
* @return join way
* @throws WxErrorException the wx error exception
*/
WxCpGroupJoinWayInfo getJoinWay(@NonNull String configId) throws WxErrorException;
WxCpGroupJoinWayInfo getJoinWay(String configId) throws WxErrorException;
/**
* 删除客户群进群方式配置
* 文档地址https://developer.work.weixin.qq.com/document/path/92229
* @param configId
* @return
* @throws WxErrorException
*
* @param configId the config id
* @return wx cp base resp
* @throws WxErrorException the wx error exception
*/
WxCpBaseResp delJoinWay( @NonNull String configId) throws WxErrorException;
WxCpBaseResp delJoinWay(String configId) throws WxErrorException;
/**
* 代开发应用external_userid转换
@@ -231,10 +236,28 @@ public interface WxCpExternalContactService {
* </pre>
*
* @param externalUserid 代开发自建应用获取到的外部联系人ID
* @return 该服务商第三方应用下的企业的外部联系人ID
* @return 该服务商第三方应用下的企业的外部联系人ID string
* @throws WxErrorException .
*/
String toServiceExternalUserid(@NotNull String externalUserid) throws WxErrorException;
String toServiceExternalUserid(String externalUserid) throws WxErrorException;
/**
* 将代开发应用或第三方应用获取的externaluserid转换成自建应用的externaluserid
* <pre>
* 文档地址https://developer.work.weixin.qq.com/document/path/95884#external-userid%E8%BD%AC%E6%8D%A2
*
* 权限说明:
*
* 需要使用自建应用或基础应用的access_token
* 客户的跟进人或者用户所在客户群的群主需要同时在access_token和source_agentid所对应应用的可见范围内
* </pre>
*
* @param externalUserid 服务商主体的external_userid必须是source_agentid对应的应用所获取
* @param sourceAgentId 企业授权的代开发自建应用或第三方应用的agentid
* @return
* @throws WxErrorException
*/
String fromServiceExternalUserid(String externalUserid, String sourceAgentId) throws WxErrorException;
/**
* 企业客户微信unionid的升级 - unionid查询external_userid
@@ -255,12 +278,12 @@ public interface WxCpExternalContactService {
* </pre>
*
* @param unionid 微信客户的unionid
* @param openid 微信客户的openid
* @param corpid 需要换取的企业corpid不填则拉取所有企业
* @return 该服务商第三方应用下的企业的外部联系人ID
* @param openid 微信客户的openid
* @param corpid 需要换取的企业corpid不填则拉取所有企业
* @return 该服务商第三方应用下的企业的外部联系人ID wx cp external user id list
* @throws WxErrorException .
*/
WxCpExternalUserIdList unionidToExternalUserid3rd(@NotNull String unionid, @NotNull String openid, String corpid) throws WxErrorException;
WxCpExternalUserIdList unionidToExternalUserid3rd(String unionid, String openid, String corpid) throws WxErrorException;
/**
* 转换external_userid
@@ -279,7 +302,7 @@ public interface WxCpExternalContactService {
* </pre>
*
* @param externalUserIdList 微信客户的unionid
* @return List<String> 新外部联系人id
* @return List<String> 新外部联系人id
* @throws WxErrorException .
*/
WxCpNewExternalUserIdList getNewExternalUserId(String[] externalUserIdList) throws WxErrorException;
@@ -303,7 +326,7 @@ public interface WxCpExternalContactService {
* @return wx cp base resp
* @throws WxErrorException .
*/
WxCpBaseResp finishExternalUserIdMigration(@NotNull String corpid) throws WxErrorException;
WxCpBaseResp finishExternalUserIdMigration(String corpid) throws WxErrorException;
/**
* 客户群opengid转换
@@ -323,11 +346,12 @@ public interface WxCpExternalContactService {
* 仅可转换出自己企业下的客户群chat_id
* </pre>
*
* @param opengid 小程序在微信获取到的群ID参见wx.getGroupEnterInfo(https://developers.weixin.qq.com/miniprogram/dev/api/open-api/group/wx.getGroupEnterInfo.html)
* @return 客户群ID可以用来调用获取客户群详情
* @param opengid 小程序在微信获取到的群ID参见wx.getGroupEnterInfo(https://developers.weixin.qq
* .com/miniprogram/dev/api/open-api/group/wx.getGroupEnterInfo.html)
* @return 客户群ID ,可以用来调用获取客户群详情
* @throws WxErrorException .
*/
String opengidToChatid(@NotNull String opengid) throws WxErrorException;
String opengidToChatid(String opengid) throws WxErrorException;
/**
* 批量获取客户详情.
@@ -405,15 +429,15 @@ public interface WxCpExternalContactService {
/**
* 获取待分配的离职成员列表
* 企业和第三方可通过此接口,获取所有离职成员的客户列表,并可进一步调用分配离职成员的客户接口将这些客户重新分配给其他企业成员。
*
* <p>
* 请求方式POSTHTTPS
* 请求地址https://qyapi.weixin.qq.com/cgi-bin/externalcontact/get_unassigned_list?access_token=ACCESS_TOKEN
*
* @param pageId 分页查询要查询页号从0开始
* @param cursor 分页查询游标字符串类型适用于数据量较大的情况如果使用该参数则无需填写page_id该参数由上一次调用返回
* @param pageId 分页查询要查询页号从0开始
* @param cursor 分页查询游标字符串类型适用于数据量较大的情况如果使用该参数则无需填写page_id该参数由上一次调用返回
* @param pageSize 每次返回的最大记录数默认为1000最大值为1000
* @return
* @throws WxErrorException
* @return wx cp user external unassign list
* @throws WxErrorException the wx error exception
*/
WxCpUserExternalUnassignList listUnassignedList(Integer pageId, String cursor, Integer pageSize) throws WxErrorException;
@@ -463,10 +487,11 @@ public interface WxCpExternalContactService {
* @param handOverUserid 原添加成员的userid
* @param takeOverUserid 接替成员的userid
* @param cursor 分页查询的cursor每个分页返回的数据不会超过1000条不填或为空表示获取第一个分页
* @return 客户转接接口实体
* @return 客户转接接口实体 wx cp user transfer result resp
* @throws WxErrorException the wx error exception
*/
WxCpUserTransferResultResp transferResult(@NotNull String handOverUserid, @NotNull String takeOverUserid, String cursor) throws WxErrorException;
WxCpUserTransferResultResp transferResult(String handOverUserid, String takeOverUserid,
String cursor) throws WxErrorException;
/**
* 企业可通过此接口,分配离职成员的客户给其他成员。
@@ -503,10 +528,11 @@ public interface WxCpExternalContactService {
* @param handOverUserid 原添加成员的userid
* @param takeOverUserid 接替成员的userid
* @param cursor 分页查询的cursor每个分页返回的数据不会超过1000条不填或为空表示获取第一个分页
* @return 客户转接接口实体
* @return 客户转接接口实体 wx cp user transfer result resp
* @throws WxErrorException the wx error exception
*/
WxCpUserTransferResultResp resignedTransferResult(@NotNull String handOverUserid, @NotNull String takeOverUserid, String cursor) throws WxErrorException;
WxCpUserTransferResultResp resignedTransferResult(String handOverUserid, String takeOverUserid,
String cursor) throws WxErrorException;
/**
* <pre>
@@ -526,7 +552,8 @@ public interface WxCpExternalContactService {
* @deprecated 请使用 {@link WxCpExternalContactService#listGroupChat(Integer, String, int, String[])}
*/
@Deprecated
WxCpUserExternalGroupChatList listGroupChat(Integer pageIndex, Integer pageSize, int status, String[] userIds, String[] partyIds) throws WxErrorException;
WxCpUserExternalGroupChatList listGroupChat(Integer pageIndex, Integer pageSize, int status, String[] userIds,
String[] partyIds) throws WxErrorException;
/**
* <pre>
@@ -553,7 +580,8 @@ public interface WxCpExternalContactService {
* 微信文档https://work.weixin.qq.com/api/doc/90000/90135/92122
* </pre>
*
* @param chatId the chat id
* @param chatId the chat id
* @param needName the need name
* @return group chat
* @throws WxErrorException the wx error exception
*/
@@ -580,11 +608,30 @@ public interface WxCpExternalContactService {
*
* @param chatIds 需要转群主的客户群ID列表。取值范围 1 ~ 100
* @param newOwner 新群主ID
* @return 分配结果,主要是分配失败的群列表
* @return 分配结果 ,主要是分配失败的群列表
* @throws WxErrorException the wx error exception
*/
WxCpUserExternalGroupChatTransferResp transferGroupChat(String[] chatIds, String newOwner) throws WxErrorException;
/**
* 企业可通过此接口,将在职成员为群主的群,分配给另一个客服成员。
* <per>
* 注意:
* 继承给的新群主,必须是配置了客户联系功能的成员
* 继承给的新群主,必须有设置实名
* 继承给的新群主,必须有激活企业微信
* 同一个人的群限制每天最多分配300个给新群主
* 为保障客户服务体验90个自然日内在职成员的每个客户群仅可被转接2次。
* </pre>
*
* @param chatIds 需要转群主的客户群ID列表。取值范围 1 ~ 100
* @param newOwner 新群主ID
* @return 分配结果 ,主要是分配失败的群列表
* @throws WxErrorException the wx error exception
*/
WxCpUserExternalGroupChatTransferResp onjobTransferGroupChat(String[] chatIds, String newOwner) throws WxErrorException;
/**
* <pre>
* 企业可通过此接口获取成员联系客户的数据,包括发起申请数、新增客户数、聊天数、发送消息数和删除/拉黑成员的客户数等指标。
@@ -600,7 +647,8 @@ public interface WxCpExternalContactService {
* @return user behavior statistic
* @throws WxErrorException the wx error exception
*/
WxCpUserExternalUserBehaviorStatistic getUserBehaviorStatistic(Date startTime, Date endTime, String[] userIds, String[] partyIds) throws WxErrorException;
WxCpUserExternalUserBehaviorStatistic getUserBehaviorStatistic(Date startTime, Date endTime, String[] userIds,
String[] partyIds) throws WxErrorException;
/**
* <pre>
@@ -619,7 +667,9 @@ public interface WxCpExternalContactService {
* @return group chat statistic
* @throws WxErrorException the wx error exception
*/
WxCpUserExternalGroupChatStatistic getGroupChatStatistic(Date startTime, Integer orderBy, Integer orderAsc, Integer pageIndex, Integer pageSize, String[] userIds, String[] partyIds) throws WxErrorException;
WxCpUserExternalGroupChatStatistic getGroupChatStatistic(Date startTime, Integer orderBy, Integer orderAsc,
Integer pageIndex, Integer pageSize, String[] userIds,
String[] partyIds) throws WxErrorException;
/**
* 添加企业群发消息任务
@@ -631,7 +681,7 @@ public interface WxCpExternalContactService {
* <p>
* 请求地址:https://qyapi.weixin.qq.com/cgi-bin/externalcontact/add_msg_template?access_token=ACCESS_TOKEN
* <p>
* 文档地址:https://work.weixin.qq.com/api/doc/90000/90135/92135
* <a href="https://work.weixin.qq.com/api/doc/90000/90135/92135">文档地址</a>
*
* @param wxCpMsgTemplate the wx cp msg template
* @return the wx cp msg template add result
@@ -650,7 +700,7 @@ public interface WxCpExternalContactService {
*
* 请求地址:https://qyapi.weixin.qq.com/cgi-bin/externalcontact/send_welcome_msg?access_token=ACCESS_TOKEN
*
* 文档地址:https://work.weixin.qq.com/api/doc/90000/90135/92137
* <a href="https://work.weixin.qq.com/api/doc/90000/90135/92137">文档地址</a>
* </pre>
*
* @param msg .
@@ -725,7 +775,7 @@ public interface WxCpExternalContactService {
/**
* <pre>
* 企业可通过此接口为指定成员的客户添加上由企业统一配置的标签。
* https://work.weixin.qq.com/api/doc/90000/90135/92117
* <a href="https://work.weixin.qq.com/api/doc/90000/90135/92117">文档地址</a>
* </pre>
*
* @param userid the userid
@@ -739,10 +789,11 @@ public interface WxCpExternalContactService {
/**
* <pre>
* 企业和第三方应用可通过该接口创建客户朋友圈的发表任务。
* https://open.work.weixin.qq.com/api/doc/90000/90135/95094
* 企业和第三方应用可通过该接口创建客户朋友圈的发表任务。
* <a href="https://open.work.weixin.qq.com/api/doc/90000/90135/95094">文档地址</a>
* </pre>
* @param task
*
* @param task the task
* @return wx cp add moment result
* @throws WxErrorException the wx error exception
*/
@@ -751,41 +802,44 @@ public interface WxCpExternalContactService {
/**
* <pre>
* 由于发表任务的创建是异步执行的,应用需要再调用该接口以获取创建的结果。
* https://open.work.weixin.qq.com/api/doc/90000/90135/95094
* <a href="https://open.work.weixin.qq.com/api/doc/90000/90135/95094">文档地址</a>
* </pre>
*
* @param jobId 异步任务id最大长度为64字节由创建发表内容到客户朋友圈任务接口获取
* @return
* @throws WxErrorException
* @return moment task result
* @throws WxErrorException the wx error exception
*/
WxCpGetMomentTaskResult getMomentTaskResult(String jobId) throws WxErrorException;
/**
* <pre>
* 获取客户朋友圈全部的发表记录 获取企业全部的发表列表
* https://open.work.weixin.qq.com/api/doc/90000/90135/93333
* <a href="https://open.work.weixin.qq.com/api/doc/90000/90135/93333">文档地址</a>
* </pre>
* @param startTime 朋友圈记录开始时间。Unix时间戳
* @param endTime 朋友圈记录结束时间。Unix时间戳
* @param creator 朋友圈创建人的userid
*
* @param startTime 朋友圈记录开始时间。Unix时间戳
* @param endTime 朋友圈记录结束时间。Unix时间戳
* @param creator 朋友圈创建人的userid
* @param filterType 朋友圈类型。0企业发表 1个人发表 2所有包括个人创建以及企业创建默认情况下为所有类型
* @param cursor 用于分页查询的游标,字符串类型,由上一次调用返回,首次调用可不填
* @param limit 返回的最大记录数整型最大值100默认值100超过最大值时取默认值
* @return
* @throws WxErrorException
* @param cursor 用于分页查询的游标,字符串类型,由上一次调用返回,首次调用可不填
* @param limit 返回的最大记录数整型最大值100默认值100超过最大值时取默认值
* @return moment list
* @throws WxErrorException the wx error exception
*/
WxCpGetMomentList getMomentList(Long startTime, Long endTime, String creator, Integer filterType,
String cursor, Integer limit) throws WxErrorException;
String cursor, Integer limit) throws WxErrorException;
/**
* <pre>
* 获取客户朋友圈全部的发表记录 获取客户朋友圈企业发表的列表
* https://open.work.weixin.qq.com/api/doc/90000/90135/93333
* <a href="https://open.work.weixin.qq.com/api/doc/90000/90135/93333">文档地址</a>
* </pre>
*
* @param momentId 朋友圈id,仅支持企业发表的朋友圈id
* @param cursor 用于分页查询的游标,字符串类型,由上一次调用返回,首次调用可不填
* @param limit 返回的最大记录数整型最大值1000默认值500超过最大值时取默认值
* @return
* @throws WxErrorException
* @param cursor 用于分页查询的游标,字符串类型,由上一次调用返回,首次调用可不填
* @param limit 返回的最大记录数整型最大值1000默认值500超过最大值时取默认值
* @return moment task
* @throws WxErrorException the wx error exception
*/
WxCpGetMomentTask getMomentTask(String momentId, String cursor, Integer limit)
throws WxErrorException;
@@ -793,45 +847,48 @@ public interface WxCpExternalContactService {
/**
* <pre>
* 获取客户朋友圈全部的发表记录 获取客户朋友圈发表时选择的可见范围
* https://open.work.weixin.qq.com/api/doc/90000/90135/93333
* <a href="https://open.work.weixin.qq.com/api/doc/90000/90135/93333">文档地址</a>
* </pre>
*
* @param momentId 朋友圈id
* @param userId 企业发表成员userid如果是企业创建的朋友圈可以通过获取客户朋友圈企业发表的
* 列表获取已发表成员userid如果是个人创建的朋友圈创建人userid就是企业发表成员userid
* @param cursor 用于分页查询的游标,字符串类型,由上一次调用返回,首次调用可不填
* @param limit 返回的最大记录数整型最大值1000默认值500超过最大值时取默认值
* @return
* @throws WxErrorException
* @param userId 企业发表成员userid如果是企业创建的朋友圈可以通过获取客户朋友圈企业发表的
* 列表获取已发表成员userid如果是个人创建的朋友圈创建人userid就是企业发表成员userid
* @param cursor 用于分页查询的游标,字符串类型,由上一次调用返回,首次调用可不填
* @param limit 返回的最大记录数整型最大值1000默认值500超过最大值时取默认值
* @return moment customer list
* @throws WxErrorException the wx error exception
*/
WxCpGetMomentCustomerList getMomentCustomerList(String momentId, String userId,
String cursor, Integer limit) throws WxErrorException;
String cursor, Integer limit) throws WxErrorException;
/**
* <pre>
* 获取客户朋友圈全部的发表记录 获取客户朋友圈发表后的可见客户列表
* https://open.work.weixin.qq.com/api/doc/90000/90135/93333
* <a href="https://open.work.weixin.qq.com/api/doc/90000/90135/93333">文档地址</a>
* </pre>
*
* @param momentId 朋友圈id
* @param userId 企业发表成员userid如果是企业创建的朋友圈可以通过获取客户朋友圈企业发表的列表获取已发表成员userid
* 如果是个人创建的朋友圈创建人userid就是企业发表成员userid
* @param cursor 用于分页查询的游标,字符串类型,由上一次调用返回,首次调用可不填
* @param limit 返回的最大记录数整型最大值5000默认值3000超过最大值时取默认值
* @return
* @throws WxErrorException
* @param userId 企业发表成员userid如果是企业创建的朋友圈可以通过获取客户朋友圈企业发表的列表获取已发表成员userid
* 如果是个人创建的朋友圈创建人userid就是企业发表成员userid
* @param cursor 用于分页查询的游标,字符串类型,由上一次调用返回,首次调用可不填
* @param limit 返回的最大记录数整型最大值5000默认值3000超过最大值时取默认值
* @return moment send result
* @throws WxErrorException the wx error exception
*/
WxCpGetMomentSendResult getMomentSendResult(String momentId, String userId,
String cursor, Integer limit) throws WxErrorException;
String cursor, Integer limit) throws WxErrorException;
/**
* <pre>
* 获取客户朋友圈全部的发表记录 获取客户朋友圈的互动数据
* https://open.work.weixin.qq.com/api/doc/90000/90135/93333
* <a href="https://open.work.weixin.qq.com/api/doc/90000/90135/93333">文档地址</a>
* </pre>
*
* @param momentId 朋友圈id
* @param userId 企业发表成员userid如果是企业创建的朋友圈可以通过获取客户朋友圈企业发表的列表获取已发表成员userid
* 如果是个人创建的朋友圈创建人userid就是企业发表成员userid
* @return
* @throws WxErrorException
* @param userId 企业发表成员userid如果是企业创建的朋友圈可以通过获取客户朋友圈企业发表的列表获取已发表成员userid
* 如果是个人创建的朋友圈创建人userid就是企业发表成员userid
* @return moment comments
* @throws WxErrorException the wx error exception
*/
WxCpGetMomentComments getMomentComments(String momentId, String userId)
throws WxErrorException;
@@ -839,31 +896,32 @@ public interface WxCpExternalContactService {
/**
* <pre>
* 企业和第三方应用可通过此接口获取企业与成员的群发记录。
* https://work.weixin.qq.com/api/doc/90000/90135/93338
* <a href="https://work.weixin.qq.com/api/doc/90000/90135/93338">文档地址</a>
* </pre>
*
* @param chatType 群发任务的类型默认为single表示发送给客户group表示发送给客户群
* @param startTime 群发任务记录开始时间
* @param endTime 群发任务记录结束时间
* @param creator 群发任务创建人企业账号id
* @param filterType 创建人类型。0企业发表 1个人发表 2所有包括个人创建以及企业创建默认情况下为所有类型
* @param limit 返回的最大记录数整型最大值100默认值50超过最大值时取默认值
* @param cursor 用于分页查询的游标,字符串类型,由上一次调用返回,首次调用可不填
* @param chatType 群发任务的类型默认为single表示发送给客户group表示发送给客户群
* @param startTime 群发任务记录开始时间
* @param endTime 群发任务记录结束时间
* @param creator 群发任务创建人企业账号id
* @param filterType 创建人类型。0企业发表 1个人发表 2所有包括个人创建以及企业创建默认情况下为所有类型
* @param limit 返回的最大记录数整型最大值100默认值50超过最大值时取默认值
* @param cursor 用于分页查询的游标,字符串类型,由上一次调用返回,首次调用可不填
* @return wx cp base resp
* @throws WxErrorException the wx error exception
*/
WxCpGroupMsgListResult getGroupMsgListV2(String chatType, @NonNull Date startTime, @NonNull Date endTime, String creator, Integer filterType, Integer limit, String cursor) throws WxErrorException;
WxCpGroupMsgListResult getGroupMsgListV2(String chatType, Date startTime, Date endTime,
String creator, Integer filterType, Integer limit, String cursor) throws WxErrorException;
/**
* <pre>
* 企业和第三方应用可通过此接口获取企业与成员的群发记录。
* https://work.weixin.qq.com/api/doc/90000/90135/93338#获取企业群发成员执行结果
* <a href="https://work.weixin.qq.com/api/doc/90000/90135/93338#获取企业群发成员执行结果">获取企业群发成员执行结果</a>
* </pre>
*
* @param msgid 群发消息的id通过获取群发记录列表接口返回
* @param userid 发送成员userid通过获取群发成员发送任务列表接口返回
* @param limit 返回的最大记录数整型最大值1000默认值500超过最大值时取默认值
* @param cursor 用于分页查询的游标,字符串类型,由上一次调用返回,首次调用可不填
* @param msgid 群发消息的id通过获取群发记录列表接口返回
* @param userid 发送成员userid通过获取群发成员发送任务列表接口返回
* @param limit 返回的最大记录数整型最大值1000默认值500超过最大值时取默认值
* @param cursor 用于分页查询的游标,字符串类型,由上一次调用返回,首次调用可不填
* @return wx cp base resp
* @throws WxErrorException the wx error exception
*/
@@ -872,7 +930,7 @@ public interface WxCpExternalContactService {
/**
* <pre>
* 企业跟第三方应用可通过该接口获取到创建企业群发的群发发送结果。
* https://work.weixin.qq.com/api/doc/16251
* <a href="https://work.weixin.qq.com/api/doc/16251">文档</a>
* </pre>
*
* @param msgid 群发消息的id通过创建企业群发接口返回
@@ -881,30 +939,30 @@ public interface WxCpExternalContactService {
* @return wx cp base resp
* @throws WxErrorException the wx error exception
*/
public WxCpGroupMsgResult getGroupMsgResult(String msgid, Integer limit, String cursor) throws WxErrorException;
WxCpGroupMsgResult getGroupMsgResult(String msgid, Integer limit, String cursor) throws WxErrorException;
/**
* <pre>
* 获取群发成员发送任务列表。
* https://work.weixin.qq.com/api/doc/90000/90135/93338#获取群发成员发送任务列表
* <a href="https://work.weixin.qq.com/api/doc/90000/90135/93338#获取群发成员发送任务列表">获取群发成员发送任务列表</a>
* </pre>
*
* @param msgid 群发消息的id通过获取群发记录列表接口返回
* @param limit 返回的最大记录数整型最大值1000默认值500超过最大值时取默认值
* @param cursor 用于分页查询的游标,字符串类型,由上一次调用返回,首次调用可不填
* @param msgid 群发消息的id通过获取群发记录列表接口返回
* @param limit 返回的最大记录数整型最大值1000默认值500超过最大值时取默认值
* @param cursor 用于分页查询的游标,字符串类型,由上一次调用返回,首次调用可不填
* @return wx cp base resp
* @throws WxErrorException the wx error exception
*/
WxCpGroupMsgTaskResult getGroupMsgTask(String msgid, Integer limit, String cursor) throws WxErrorException;
WxCpGroupMsgTaskResult getGroupMsgTask(String msgid, Integer limit, String cursor) throws WxErrorException;
/**
* <pre>
* 添加入群欢迎语素材。
* https://open.work.weixin.qq.com/api/doc/90000/90135/92366#添加入群欢迎语素材
* <a href="https://open.work.weixin.qq.com/api/doc/90000/90135/92366#添加入群欢迎语素材">添加入群欢迎语素材</a>
* </pre>
*
* @param template 素材内容
* @return template_id 欢迎语素材id
* @param template 素材内容
* @return template_id 欢迎语素材id
* @throws WxErrorException the wx error exception
*/
String addGroupWelcomeTemplate(WxCpGroupWelcomeTemplateResult template) throws WxErrorException;
@@ -912,10 +970,10 @@ public interface WxCpExternalContactService {
/**
* <pre>
* 编辑入群欢迎语素材。
* https://open.work.weixin.qq.com/api/doc/90000/90135/92366#编辑入群欢迎语素材
* <a href="https://open.work.weixin.qq.com/api/doc/90000/90135/92366#编辑入群欢迎语素材">编辑入群欢迎语素材</a>
* </pre>
*
* @param template
* @param template the template
* @return wx cp base resp
* @throws WxErrorException the wx error exception
*/
@@ -924,37 +982,37 @@ public interface WxCpExternalContactService {
/**
* <pre>
* 获取入群欢迎语素材。
* https://open.work.weixin.qq.com/api/doc/90000/90135/92366#获取入群欢迎语素材
* <a href="https://open.work.weixin.qq.com/api/doc/90000/90135/92366#获取入群欢迎语素材">获取入群欢迎语素材</a>
* </pre>
*
* @param templateId 群欢迎语的素材id
* @param templateId 群欢迎语的素材id
* @return wx cp base resp
* @throws WxErrorException the wx error exception
*/
WxCpGroupWelcomeTemplateResult getGroupWelcomeTemplate(@NotNull String templateId) throws WxErrorException;
WxCpGroupWelcomeTemplateResult getGroupWelcomeTemplate(String templateId) throws WxErrorException;
/**
* <pre>
* 删除入群欢迎语素材。
* 企业可通过此API删除入群欢迎语素材且仅能删除调用方自己创建的入群欢迎语素材。
* https://open.work.weixin.qq.com/api/doc/90000/90135/92366#删除入群欢迎语素材
* <a href="https://open.work.weixin.qq.com/api/doc/90000/90135/92366#删除入群欢迎语素材">删除入群欢迎语素材</a>
* </pre>
*
* @param templateId 群欢迎语的素材id
* @param templateId 授权方安装的应用agentid。仅旧的第三方多应用套件需要填此参数
* @param templateId 群欢迎语的素材id
* @param agentId the agent id
* @return wx cp base resp
* @throws WxErrorException the wx error exception
*/
WxCpBaseResp delGroupWelcomeTemplate(@NotNull String templateId, String agentId) throws WxErrorException;
WxCpBaseResp delGroupWelcomeTemplate(String templateId, String agentId) throws WxErrorException;
/**
* <pre>
* 获取商品图册
* https://work.weixin.qq.com/api/doc/90000/90135/95096#获取商品图册列表
* <a href="https://work.weixin.qq.com/api/doc/90000/90135/95096#获取商品图册列表">获取商品图册列表</a>
* </pre>
*
* @param limit 返回的最大记录数整型最大值100默认值50超过最大值时取默认值
* @param cursor 用于分页查询的游标,字符串类型,由上一次调用返回,首次调用可不填
* @param limit 返回的最大记录数整型最大值100默认值50超过最大值时取默认值
* @param cursor 用于分页查询的游标,字符串类型,由上一次调用返回,首次调用可不填
* @return wx cp base resp
* @throws WxErrorException the wx error exception
*/
@@ -963,10 +1021,10 @@ public interface WxCpExternalContactService {
/**
* <pre>
* 获取商品图册
* https://work.weixin.qq.com/api/doc/90000/90135/95096#获取商品图册
* <a href="https://work.weixin.qq.com/api/doc/90000/90135/95096#获取商品图册">获取商品图册</a>
* </pre>
*
* @param productId 商品id
* @param productId 商品id
* @return wx cp base resp
* @throws WxErrorException the wx error exception
*/
@@ -975,29 +1033,31 @@ public interface WxCpExternalContactService {
/**
* <pre>
* 上传附件资源
* https://open.work.weixin.qq.com/api/doc/90001/90143/95178
* <a href="https://open.work.weixin.qq.com/api/doc/90001/90143/95178">...</a>
* </pre>
* @param mediaType
* @param fileType
* @param attachmentType
* @param inputStream
* @return
* @throws WxErrorException
* @throws IOException
*
* @param mediaType the media type
* @param fileType the file type
* @param attachmentType the attachment type
* @param inputStream the input stream
* @return wx media upload result
* @throws WxErrorException the wx error exception
* @throws IOException the io exception
*/
WxMediaUploadResult uploadAttachment(String mediaType, String fileType, Integer attachmentType,
InputStream inputStream) throws WxErrorException, IOException;
InputStream inputStream) throws WxErrorException, IOException;
/**
* <pre>
* 上传附件资源
* https://open.work.weixin.qq.com/api/doc/90001/90143/95178
* <a href="https://open.work.weixin.qq.com/api/doc/90001/90143/95178">...</a>
* </pre>
* @param mediaType
* @param attachmentType
* @param file
* @return
* @throws WxErrorException
*
* @param mediaType the media type
* @param attachmentType the attachment type
* @param file the file
* @return wx media upload result
* @throws WxErrorException the wx error exception
*/
WxMediaUploadResult uploadAttachment(String mediaType, Integer attachmentType, File file)
throws WxErrorException;
@@ -1009,8 +1069,12 @@ public interface WxCpExternalContactService {
* 请求方式POST(HTTPS)
* 请求地址https://qyapi.weixin.qq.com/cgi-bin/externalcontact/add_intercept_rule?access_token=ACCESS_TOKEN
* <pre>
* @param ruleAddRequest the rule add request
* @return 规则id
* @throws WxErrorException the wx error exception
*/
WxCpInterceptRuleResultResp addInterceptRule(WxCpInterceptRuleResp ruleResp) throws WxErrorException;
String addInterceptRule(WxCpInterceptRuleAddRequest ruleAddRequest) throws WxErrorException;
/**
* <pre>
* 修改敏感词规则
@@ -1018,30 +1082,35 @@ public interface WxCpExternalContactService {
* 请求方式POST(HTTPS)
* 请求地址https://qyapi.weixin.qq.com/cgi-bin/externalcontact/update_intercept_rule?access_token=ACCESS_TOKEN
* <pre>
* @param interceptRule the rule
* @throws WxErrorException the wx error exception
*/
WxCpInterceptRuleResultResp updateInterceptRule(WxCpInterceptRuleResp ruleResp) throws WxErrorException;
void updateInterceptRule(WxCpInterceptRule interceptRule) throws WxErrorException;
/**
* <pre>
* 删除敏感词规则
* 企业和第三方应用可以通过此接口修改敏感词规则
* 请求方式POST(HTTPS)
* 请求地址:https://qyapi.weixin.qq.com/cgi-bin/externalcontact/del_intercept_rule?access_token=ACCESS_TOKEN
* <a href="https://qyapi.weixin.qq.com/cgi-bin/externalcontact/del_intercept_rule?access_token=ACCESS_TOKEN">请求地址</a>
* <pre>
* @param rule_id 规则id
* @param ruleId 规则id
* @throws WxErrorException the wx error exception
*/
WxCpBaseResp delInterceptRule(String rule_id) throws WxErrorException;
void delInterceptRule(String ruleId) throws WxErrorException;
/**
* <pre>
* 创建商品图册
* 企业和第三方应用可以通过此接口增加商品
* 请求方式POST(HTTPS)
* 请求地址:<a href="https://qyapi.weixin.qq.com/cgi-bin/externalcontact/add_product_album?access_token=ACCESS_TOKEN">https://qyapi.weixin.qq.com/cgi-bin/externalcontact/add_product_album?access_token=ACCESS_TOKEN</a>
* 文档地址:<a href="https://developer.work.weixin.qq.com/document/path/95096#%E5%88%9B%E5%BB%BA%E5%95%86%E5%93%81%E5%9B%BE%E5%86%8C">https://developer.work.weixin.qq.com/document/path/95096#%E5%88%9B%E5%BB%BA%E5%95%86%E5%93%81%E5%9B%BE%E5%86%8C</a>
* 请求地址:
* <a href="https://qyapi.weixin.qq.com/cgi-bin/externalcontact/add_product_album?access_token=ACCESS_TOKEN">https://qyapi.weixin.qq.com/cgi-bin/externalcontact/add_product_album?access_token=ACCESS_TOKEN</a>
* <a href="https://developer.work.weixin.qq.com/document/path/95096#%E5%88%9B%E5%BB%BA%E5%95%86%E5%93%81%E5%9B%BE%E5%86%8C">文档地址</a>
* <pre>
* @param wxCpProductAlbumInfo 商品图册信息
* @return 商品id
* @return 商品id string
* @throws WxErrorException the wx error exception
*/
String addProductAlbum(WxCpProductAlbumInfo wxCpProductAlbumInfo) throws WxErrorException;
@@ -1050,10 +1119,12 @@ public interface WxCpExternalContactService {
* 编辑商品图册
* 企业和第三方应用可以通过此接口修改商品信息
* 请求方式POST(HTTPS)
* 请求地址:<a href="https://qyapi.weixin.qq.com/cgi-bin/externalcontact/update_product_album?access_token=ACCESS_TOKEN">https://qyapi.weixin.qq.com/cgi-bin/externalcontact/update_product_album?access_token=ACCESS_TOKEN</a>
* 文档地址:<a href="https://developer.work.weixin.qq.com/document/path/95096#%E7%BC%96%E8%BE%91%E5%95%86%E5%93%81%E5%9B%BE%E5%86%8C">https://developer.work.weixin.qq.com/document/path/95096#%E7%BC%96%E8%BE%91%E5%95%86%E5%93%81%E5%9B%BE%E5%86%8C</a>
* 请求地址:
* <a href="https://qyapi.weixin.qq.com/cgi-bin/externalcontact/update_product_album?access_token=ACCESS_TOKEN">https://qyapi.weixin.qq.com/cgi-bin/externalcontact/update_product_album?access_token=ACCESS_TOKEN</a>
* <a href="https://developer.work.weixin.qq.com/document/path/95096#%E7%BC%96%E8%BE%91%E5%95%86%E5%93%81%E5%9B%BE%E5%86%8C">文档地址</a>
* <pre>
* @param wxCpProductAlbumInfo 商品图册信息
* @throws WxErrorException the wx error exception
*/
void updateProductAlbum(WxCpProductAlbumInfo wxCpProductAlbumInfo) throws WxErrorException;
@@ -1062,10 +1133,13 @@ public interface WxCpExternalContactService {
* 删除商品图册
* 企业和第三方应用可以通过此接口删除商品信息
* 请求方式POST(HTTPS)
* 请求地址:<a href="https://qyapi.weixin.qq.com/cgi-bin/externalcontact/delete_product_album?access_token=ACCESS_TOKEN">https://qyapi.weixin.qq.com/cgi-bin/externalcontact/delete_product_album?access_token=ACCESS_TOKEN</a>
* 文档地址:<a href="https://developer.work.weixin.qq.com/document/path/95096#%E5%88%A0%E9%99%A4%E5%95%86%E5%93%81%E5%9B%BE%E5%86%8C">https://developer.work.weixin.qq.com/document/path/95096#%E5%88%A0%E9%99%A4%E5%95%86%E5%93%81%E5%9B%BE%E5%86%8C</a>
* 请求地址:
* <a href="https://qyapi.weixin.qq.com/cgi-bin/externalcontact/delete_product_album?access_token=ACCESS_TOKEN">https://qyapi.weixin.qq.com/cgi-bin/externalcontact/delete_product_album?access_token=ACCESS_TOKEN</a>
*
* <a href="https://developer.work.weixin.qq.com/document/path/95096#%E5%88%A0%E9%99%A4%E5%95%86%E5%93%81%E5%9B%BE%E5%86%8C">文档地址</a>
* <pre>
* @param productId 商品id
* @throws WxErrorException the wx error exception
*/
void deleteProductAlbum(String productId) throws WxErrorException;

Some files were not shown because too many files have changed in this diff Show More