Compare commits

...

190 Commits

Author SHA1 Message Date
b4c3fef78c 暂时对不对 GPG 签名 2025-04-03 14:14:27 -04:00
019379f729 OSS-258 remove the commit with key and code 2023-06-14 16:29:53 -04:00
1a52833467 OSS-258 创建一个 Builder 对象,用来在测试中进行 Builder https://www.ossez.com/t/api/14400/2 2023-06-14 16:11:10 -04:00
77bea77f4e OSS-258 创建一个 Builder 对象,用来在测试中进行 Builder https://www.ossez.com/t/api/14400/2 2023-04-25 14:13:50 -04:00
4f5f90298d OSS-258 添加菜单处理服务 2023-04-25 13:23:36 -04:00
003cdd18f4 OSS-258 测试菜单 API 2023-04-25 13:23:03 -04:00
f863a25498 OSS-257 定义微信图文信息状态的数据返回接口
官方网站文档链接地址为:https://developers.weixin.qq.com/doc/offiaccount/Analytics/Graphic_Analysis_Data_Interface.html
2023-04-24 16:35:20 -04:00
66ccf11560 OSS-256 创建获取累计用户数据的方法。
需要注意的是,这里有一个时间跨度的问题,最多只能获取 7 天的数据。
2023-04-24 16:12:38 -04:00
5603ae28db OSS-256 创建 2 个新的对象和一个服务,这个服务用来处理数据相关的 API
用户分析返回的类型和结果为:https://www.ossez.com/t/topic/14398
2023-04-24 12:17:59 -04:00
d0dd1b82d7 OSS-255 格式化代码,删除不需要的引用 2023-04-24 09:22:49 -04:00
9446b1a636 OSS-255 更新 DI 的使用 2023-04-23 15:22:26 -04:00
e92e97ca11 OSS-255 格式化代码并且使用 Junit 5 的测试类 https://bug.ossez.com/browse/OSS-255 2023-04-23 15:13:04 -04:00
bce4e5a324 OSS-255 格式化代码并且使用 Junit 5 的测试类 https://bug.ossez.com/browse/OSS-255 2023-04-23 15:12:57 -04:00
03c5092164 OSS-255 更新测试使用 JUnit 5 2023-04-23 15:11:48 -04:00
9124457533 OSS-254 测试微信的消息发送 2023-04-19 22:06:03 -04:00
d217b67cf6 constant Change the name to MsgType 2023-04-19 09:27:45 -04:00
3e617b3a4c constant to update the WeChatConstant 2023-04-19 09:22:52 -04:00
bb3b148de4 Update Object to remove data from lombook 2023-04-19 08:52:39 -04:00
927361987f 更新客服信息 2023-04-19 08:48:29 -04:00
68bc4e84b4 格式化 Pom 文件 2023-04-19 08:43:29 -04:00
44208b4fab USVT-138 Change token for GPT 2023-03-22 13:17:01 -04:00
57079fecfd USVT-138 返回对象使用微信状态对象 2023-03-07 13:33:38 -05:00
f16561c82a USVT-138 针对微信返回的状态,我们提供一个状态对象 2023-03-07 13:20:19 -05:00
fba63df660 USVT-136 使用微信异步消息的策略来发布消息 2023-02-13 00:38:08 -05:00
5c1aef79c8 USVT-136 添加一个消息处理类,在这个消息处理类中为微信进行异步消息处理 2023-02-12 09:36:21 -05:00
aa235ae02f WeChat Official Account Platform related Service to process Platform related service 2023-02-09 12:44:47 -05:00
53bed19f45 USVT-135 设置超时时间为 15 秒,并且对代码进行格式化 2023-02-09 12:32:18 -05:00
75003069f9 接口的代码格式化 2023-02-09 11:22:27 -05:00
670766282a 配置使用不同的 Open ID 代码 2023-02-08 11:34:16 -05:00
706a42f7b2 配置 WeChat 的包的内容,尝试从 WeChat 包中调用需要的数据 2023-02-06 09:17:12 -05:00
3bdd0a99fa 针对公众号的登录程序,我们调整 Open 中的内容 2023-02-06 09:14:27 -05:00
34d1d5db58 create a wechat response object 2023-02-02 08:57:32 -05:00
c881e857ae Update logic by use retrofit2 package send request 2023-02-01 07:07:28 -05:00
f676c1239d 调用腾讯网络检测 API 2023-01-31 06:07:20 -05:00
4fa242751e 使用平台服务文件提供平台需要的相关服务 2023-01-31 06:02:07 -05:00
45010d1575 添加微信使用的第二个 API,获取微信服务器地址 2023-01-30 06:01:42 -05:00
21a71adba8 清理使用 httpClient 的实现,我们只会使用 okHttp 来实现所有的 HTTP 请求 2023-01-29 17:29:34 -05:00
1822d39c12 微信主机配置对象移动到 Common 模块中 2023-01-29 16:52:32 -05:00
e69e7edd02 移动微信常量到 Common 包中 2023-01-29 16:52:00 -05:00
faeb62abd8 修改拦截器中数据读取的方式,解决被拦截器拦截后的读取错误:https://www.ossez.com/t/okhttp-interceptor-close/14307 2023-01-29 08:41:02 -05:00
84acfa03f7 更新微信卡券的枚举类型 2023-01-27 05:43:34 -05:00
5dd10f3adc 微信公众号事件的常量类型移动到 Common 中 2023-01-26 14:16:32 -05:00
51185a972c 微信 API 可以支持的语言类型 2023-01-26 14:13:49 -05:00
9ba61c9f9b 修改代码,清理 lombok 在类中错误 2023-01-26 14:07:10 -05:00
29cccd94b2 不清楚为什么可以用 Apache 的随机字符串生成类还要自己写一个,直接使用 Apache 的字符串生成类 2023-01-26 14:01:54 -05:00
b8d15f0124 重命名腾讯企点的项目结构 2023-01-26 13:51:36 -05:00
d629d61250 针对腾讯企业账号的自述文件 2023-01-26 13:47:17 -05:00
704a41b1e2 把腾讯企点的 API 信息全部合并过来。 2023-01-26 13:46:58 -05:00
0a21e62667 处理加密解密包的问题,尽量避免直接调用 JDK 中保护的类。 2023-01-26 12:56:10 -05:00
e4f18688e1 添加 wecom 项目到整个库中 2023-01-26 12:42:49 -05:00
fd98fad567 微信支付的所有模块进行 Package 的重命名,删除不需要的模块 2023-01-26 07:35:47 -05:00
6a20373254 添加自述文件 2023-01-25 22:58:27 -05:00
c6a20f1a72 把微信支付的博客合并进项目 2023-01-25 22:58:10 -05:00
3655e95a67 删除并不需要的 jedisPool 实现 2023-01-25 20:31:14 -05:00
09684077ea 修改微信的配置文件路径,我们只提供 2 种存储方式内存和 Redis 2023-01-24 12:46:01 -05:00
843193024c 更新项目常量,同时修改使用 RxJava 2023-01-23 19:52:29 -05:00
5d906b1fba 修改方法为同步方法,以保障线程安全 2023-01-23 18:44:42 -05:00
2081e708a8 添加 .addInterceptor(new WeChatErrorInterceptor()) 进行全局错误处理 2023-01-23 18:43:45 -05:00
6a8bde04be WeChatErrorInterceptor 用于处理微信 API 返回的时候给出的代码是 200 ,但是实际上的错误原因和代码是在返回 Body 里面。
为了方便我们进行调用,我们在这里把调用返回使用 400 来表示错误代码,以便于在调用 Client 中进行捕获。
2023-01-23 18:42:27 -05:00
c59e8740d6 微信错误代码的枚举类型,集中到一个文件中 2023-01-23 18:32:27 -05:00
2836428f68 把微信使用的常量统一集中进行配置 2023-01-23 18:31:41 -05:00
54d4e054e6 HttpClientMediaType 定义我们在 Http 请求时候需要使用的访问媒体类型 2023-01-23 18:28:01 -05:00
b5c654d3fc 更新使用 Retrofit 的 RxJava 方式来调用获得访问腾讯 API 需要的 access token 2023-01-23 08:06:04 -05:00
ddf6d80599 更新自述文件,老的代码中使用了 Lock 来进行线程同步,我们希望删除这个功能。 2023-01-23 07:57:05 -05:00
5c23311d69 把 Jackson 的依赖移动到父项目中 2023-01-22 09:12:24 -05:00
f0c1ea178b 把微信使用的 Access Token 对象放到 model 目录下
尽量删除使用的 lombok,不在包中使用 lombok

更新测试
2023-01-22 08:26:24 -05:00
89cf809f5f 更新自述文件中有关 Demo 的链接。
https://www.ossez.com/t/wechat-j-demo/14303

同时删除 demo.md 文件。
2023-01-21 18:27:18 -05:00
7e20e4a59a 更新许可证信息 2023-01-21 18:16:19 -05:00
081e0b7e6e 更新自述文件,[Retrofit 是什么](https://www.ossez.com/t/retrofit/14302) 2023-01-21 18:15:58 -05:00
e1cf8088be 更新使用 okHTTP 2023-01-21 18:07:11 -05:00
73c2a89f70 修改 Okhttp 的调用方式 2023-01-20 14:31:11 -05:00
79b5a11a9e WeChat-J 更新项目删除不需要的 HTTP 客户端 2023-01-19 12:29:30 -05:00
ad67ed3441 针对微信开放平台,修改包的名字 2023-01-11 15:39:35 -05:00
6ba6e1829f 针对微信开放平台,修改包的名字 2023-01-11 15:36:16 -05:00
677e796990 针对微信公众号,修改配置的包的名字 2023-01-11 15:32:34 -05:00
05b85efc0f 更新包的名字 2023-01-11 15:17:54 -05:00
c8cc611085 删除无效的图片文件 2023-01-11 09:53:21 -05:00
8edbe341ed 因为我们使用 Jenkins 来做持续集成的,因此我们不需要其他的集成文件 2023-01-11 09:48:18 -05:00
4812dc26dc 删除代码规范 2023-01-11 09:45:33 -05:00
38faf619a9 针对公众号添加为子模块 2023-01-11 09:43:36 -05:00
a8fe23030f 删除无效的许可证信息,并把公众号的内容独立出来. 2023-01-11 09:43:16 -05: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 🆕【微信支付】增加查询结算账户、查询分账结果、查询分账回退结果和申请分账账单等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 🆕【微信支付】新增查询特约商户设置的允许服务商分账的最大比例的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 🎨【企业微信】微信客服事件消息增加撤回消息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
🐛【企业微信】修复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
2534 changed files with 32745 additions and 25400 deletions

View File

@ -1,15 +0,0 @@
# EditorConfig: http://editorconfig.org/
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.md]
trim_trailing_whitespace = false

View File

@ -1,19 +0,0 @@
强烈建议大家到 `github` 相关页面提交问题方便统一查询管理具体页面地址https://github.com/Wechat-Group/WxJava/issues
当然如果必须在这里提问,请务必按以下格式填写,谢谢配合~
# 提问前请确保阅读过项目首页说明以及wiki开发文档相关内容尤其是常见问题部分。完成内容后请务必移除包括本句在内的无用内容以免影响阅读谢谢合作~
# 另外如果确认属于bug而且已明确如何修复请参考贡献指南直接提交PR省的浪费时间在这里描述问题非常感谢配合
### 简要描述
__简单概括描述下你所遇到的问题。__
### 模块版本情况
* `WxJava` 模块名:
* `WxJava` 版本号:
### 详细描述
__尽量详细描述。请不要使用截图尽量使用文字描述代码直接贴上来日志则请附在后面所示区域。__
### 日志
__将日志放在 [`Pastebin`](https://paste.ubuntu.com/) 或者其他地方并将其url地址贴在这里__

4
.github/FUNDING.yml vendored
View File

@ -1,4 +0,0 @@
# These are supported funding model platforms
github: [binarywang]
custom: https://github.com/Wechat-Group/WxJava/blob/master/images/qrcodes/wepay.jpg?raw=true

View File

@ -1,28 +0,0 @@
---
name: Bug报告
about: 本项目仅对最新版本进行维护使用老版本出现问题的盆友请先升级到最新版本升级完后如果发现bug依然存在请继续填写此issue。
title: ''
labels: ''
assignees: ''
---
# 提问前请确保阅读过项目首页说明以及wiki开发文档相关内容尤其是常见问题部分。完成内容后请务必移除包括本句在内的无用内容以免影响阅读否则直接关闭谢谢合作~
## 另外如果确认属于bug而且已明确如何修复请参考贡献指南直接提交PR省的浪费时间在这里描述问题非常感谢配合
### 简要描述
__请简单概括描述下你所遇到的问题。__
### 模块版本情况
* WxJava 模块名:
* WxJava 版本号:(旧版本不予支持,谢谢配合)
### 详细描述
__尽量详细描述。请不要使用截图尽量使用文字描述代码直接贴上来日志则请附在后面所示区域。__
### 日志
__如果日志不多直接使用md代码引用格式贴在此处否则如果太长请将日志放在 [pastebin](https://paste.ubuntu.com/) 或者其他地方然后将其url地址贴在这里__
```
日志请写于此处
```

View File

@ -1,16 +0,0 @@
---
name: 请求添加新功能
about: 如果有什么新功能需要添加,请告诉我们
title: ''
labels: ''
assignees: ''
---
# 提问前请确保阅读过项目首页说明以及wiki开发文档相关内容完成内容后请务必移除包括本句在内的无用内容以免影响他人阅读否则直接关闭谢谢合作~
### 简要描述
### 官方文档地址
__请提供所需功能对应的微信官方文档地址以便进行确认。__

17
.github/stale.yml vendored
View File

@ -1,17 +0,0 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 60
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 7
# Issues with these labels will never be considered stale
exemptLabels:
- pinned
- security
# Label to use when marking an issue as stale
staleLabel: stale
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false

271
.gitignore vendored
View File

@ -1,56 +1,235 @@
.bash
.history
### Gradle ###
.gradle
build/
*.class
test-output
# Ignore Gradle GUI config
gradle-app.setting
# Package Files #
*.jar
*.war
*.ear
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
# Cache of project
.gradletasknamecache
target
bin
.project
.classpath
.settings
# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898
# gradle/wrapper/gradle-wrapper.properties
sw-pom.xml
*.iml
test-config.xml
.idea
/.gradle/
/gradle/
*.bat
/gradlew
### Gradle Patch ###
**/build/
### Intellij ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
._*
.DS_Store
.AppleDouble
.LSOverride
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.vscode
.VolumeIcon.icns
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
/.sonar/
sonar-project.properties
# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf
!/.mvn/wrapper/maven-wrapper.jar
*.versionsBackup
# Generated files
.idea/**/contentModel.xml
# STS
.factorypath
*.zip
# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml
# Gradle
.idea/**/gradle.xml
.idea/**/libraries
# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr
# CMake
cmake-build-*/
# Mongo Explorer plugin
.idea/**/mongoSettings.xml
# File-based project format
*.iws
# IntelliJ
out/
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Cursive Clojure plugin
.idea/replstate.xml
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
# Editor-based Rest Client
.idea/httpRequests
# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser
### Intellij Patch ###
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
# *.iml
# modules.xml
# .idea/misc.xml
# *.ipr
# Sonarlint plugin
.idea/sonarlint
### Intellij+iml ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf
# Generated files
.idea/**/contentModel.xml
# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml
# Gradle
.idea/**/gradle.xml
.idea/**/libraries
# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr
# CMake
cmake-build-*/
# Mongo Explorer plugin
.idea/**/mongoSettings.xml
# File-based project format
*.iws
# IntelliJ
out/
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Cursive Clojure plugin
.idea/replstate.xml
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
# Editor-based Rest Client
.idea/httpRequests
# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser
### Intellij+iml Patch ###
# Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-249601023
*.iml
modules.xml
.idea/misc.xml
*.ipr
### Maven ###
target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
.mvn/wrapper/maven-wrapper.jar
.flattened-pom.xml
# CMake
cmake-build-*/
# Mongo Explorer plugin
.idea/**/mongoSettings.xml
# File-based project format
*.iws
# IntelliJ
out/
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Cursive Clojure plugin
.idea/replstate.xml
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
# Editor-based Rest Client
.idea/httpRequests
# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser
### Intellij Patch ###
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
# *.iml
# modules.xml
# .idea/misc.xml
# *.ipr
# Sonarlint plugin
.idea/sonarlint

16
.idea/checkstyle-idea.xml generated Normal file
View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CheckStyle-IDEA" serialisationVersion="2">
<checkstyleVersion>10.22.0</checkstyleVersion>
<scanScope>JavaOnly</scanScope>
<copyLibs>true</copyLibs>
<option name="thirdPartyClasspath" />
<option name="activeLocationIds" />
<option name="locations">
<list>
<ConfigurationLocation id="bundled-sun-checks" type="BUNDLED" scope="All" description="Sun Checks">(bundled)</ConfigurationLocation>
<ConfigurationLocation id="bundled-google-checks" type="BUNDLED" scope="All" description="Google Checks">(bundled)</ConfigurationLocation>
</list>
</option>
</component>
</project>

18
.idea/compiler.xml generated Normal file
View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<annotationProcessing>
<profile name="Maven default annotation processors profile" enabled="true">
<sourceOutputDir name="target/generated-sources/annotations" />
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
<outputRelativeToContentRoot value="true" />
<module name="wechat-j-open" />
<module name="wechat-j-pay" />
<module name="wechat-j-work" />
<module name="wechat-j-common" />
<module name="wechat-j-mp" />
<module name="wechat-j-oa" />
</profile>
</annotationProcessing>
</component>
</project>

19
.idea/encodings.xml generated Normal file
View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="file://$PROJECT_DIR$/common/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/common/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/mp/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/mp/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/oa/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/oa/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/open/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/open/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/pay/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/pay/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/work/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/work/src/main/resources" charset="UTF-8" />
</component>
</project>

30
.idea/jarRepositories.xml generated Normal file
View File

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RemoteRepositoriesConfiguration">
<remote-repository>
<option name="id" value="ossez-repo-releases" />
<option name="name" value="iSharkFly Private Releases" />
<option name="url" value="https://repo.isharkfly.com/repository/isharkfly-maven-releases/" />
</remote-repository>
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Central Repository" />
<option name="url" value="https://repo.isharkfly.com/repository/maven/" />
</remote-repository>
<remote-repository>
<option name="id" value="ossez-repo-snapshots" />
<option name="name" value="iSharkFly Private Snapshots" />
<option name="url" value="https://repo.isharkfly.com/repository/isharkfly-maven-snapshots/" />
</remote-repository>
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Maven Central repository" />
<option name="url" value="https://repo1.maven.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="jboss.community" />
<option name="name" value="JBoss Community repository" />
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
</remote-repository>
</component>
</project>

6
.idea/vcs.xml generated Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

View File

@ -1,17 +0,0 @@
language: java
jdk:
- openjdk8
script: "mvn clean package -DskipTests=true -Dcheckstyle.skip=true"
branches:
only:
- develop
cache:
directories:
- '$HOME/.m2/repository'
notifications:
email:
- a@binarywang.com

View File

@ -1,36 +0,0 @@
# 代码贡献指南
1. 首先非常欢迎和感谢对本项目发起 `Pull Request` 的热心小伙伴们。
1. **特别提示:请务必在 `develop` 分支提交 `PR``release` 分支目前仅是正式版的代码,即发布正式版本后才会从 `develop` 分支进行合并。**
1. 本项目代码风格为使用2个空格代表一个Tab因此在提交代码时请注意一下否则很容易在IDE格式化代码后与原代码产生大量diff这样会给其他人阅读代码带来极大的困扰。
1. 为了便于设置,本项目引入`editorconfig`支持请使用Eclipse的同学在贡献代码前安装相关插件`IntelliJ IDEA`新版本自带支持,如果没有可自行安装插件。
1. **提交代码前请检查代码是否已经格式化并且保证新增加或者修改的方法都有完整的参数说明而public方法必须拥有相应的单元测试并通过测试。**
1. 本项目可以采用两种方式接受代码贡献:
- 第一种就是基于[Git Flow](https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow)开发流程因此在发起Pull Request的时候请选择develop分支详细步骤参考后文推荐使用此种方式贡献代码。
- ***暂停此种方式,请使用第一种***另外一种贡献代码的方式就是加入SDK Developers开发组前提是对自己的代码足够自信就可以申请加入加入之后可以随时直接提交代码但要注意对所做的修改或新增的代码进行单元测试保证提交代码没有明显问题。
### PR方式贡献代码步骤
* 在 GitHub 上 `fork` 到自己的仓库,如 `my_user/WxJava`,然后 `clone` 到本地,并设置用户信息。
```bash
$ git clone git@github.com:{your-github-username}/WxJava.git
$ cd WxJava
$ git config user.name "yourname"
$ git config user.email "your email"
```
* 修改代码后提交,并推送到自己的仓库。
```bash
$ #do some change on the content
$ git commit -am "Fix issue #1: change something"
$ git push
```
* 在 `GitHub``Gitee` 网站上提交 `Pull Request`
* 定期使用项目仓库内容更新自己仓库内容。
```bash
$ git remote add upstream https://github.com/Wechat-Group/WxJava
$ git fetch upstream
$ git checkout develop
$ git rebase upstream/develop
$ git push -f origin develop
```

66
LICENSE
View File

@ -1,53 +1,21 @@
Apache License
MIT License
Version 2.0, January 2004
Copyright (c) 2023 OSSEZ
http://www.apache.org/licenses/
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
You must give any other recipients of the Work or Derivative Works a copy of this License; and
You must cause any modified files to carry prominent notices stating that You changed the files; and
You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

288
README.md
View File

@ -1,196 +1,150 @@
## WxJava - 微信开发 Java SDK
# WeChat-J - 微信开发 Java SDK
[![码云Gitee](https://gitee.com/binary/weixin-java-tools/badge/star.svg?theme=blue)](https://gitee.com/binary/weixin-java-tools)
[![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)
[![使用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)
<p align="center">
<a href="https://github.com/honeymoose">
<img height=85 src="https://avatars1.githubusercontent.com/u/45009982?s=200&v=4">
</a>
<br>This project builds by JDK 11 and OpenJ9 for JVM.
</p>
#### 微信`Java`开发工具包,支持包括微信支付、开放平台、公众号、企业微信/企业号、小程序等微信功能模块的后端开发。
* [社区和讨论 (community)](https://www.ossez.com/tag/wechat)
<div align="center">
<b>特别赞助</b>
</div>
<table align="center" cellspacing="0" cellpadding="0" width="500">
<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="">
</a>
</td>
</tr>
<tr>
<td align="center" valign="middle" colspan="3">
<a href="https://www.jeequan.com/product/jeepay.html" target="_blank">
<img height="120" src="https://jeequan.oss-cn-beijing.aliyuncs.com/jeepay/img/wxjava_jeepay.png" alt="计全支付Jeepay,开源支付系统">
</a>
</td>
</tr>
<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="">
</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低代码开发平台"/>
</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="">
</a>
</td>
</tr>
</table>
WeChat-J 开发使用的库。
### 重要信息
1. 项目合作洽谈请联系微信`binary0000`在微信里自行搜索并添加好友请注明来意如有关于SDK问题需讨论请参考下文入群讨论不要加此微信
2. **2022-4-10 发布 [【4.3.0正式版】](https://mp.weixin.qq.com/s/yCsa7nD4_DLjW1RDcrEk6g)**
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))的常见问题部分,可以少走很多弯路,节省不少时间。
6. 技术交流群想获得QQ群/微信群/钉钉企业群等信息的同学,请使用微信扫描上面的微信公众号二维码关注 `WxJava` 后点击相关菜单即可获取加入方式,同时也可以在微信中搜索 `weixin-java-tools``WxJava` 后选择正确的公众号进行关注该公众号会及时通知SDK相关更新信息并不定期分享微信Java开发相关技术知识
7. 钉钉技术交流群:`32206329`技术交流2群, `30294972`技术交流1群目前已满`35724728`通知群实时通知Github项目变更记录
8. 微信开发新手或者Java开发新手在群内提问或新开Issue提问前请先阅读[【提问的智慧】](https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way/blob/master/README-zh_CN.md),并确保已查阅过 [【开发文档Wiki】](https://github.com/wechat-group/WxJava/wiki) ,避免浪费大家的宝贵时间;
9. 寻求帮助时需贴代码或大长串异常信息的,请利用 http://paste.ubuntu.com
我们旨在提供一个初始化的开发框架,能够让应用在使用 Spring Boot 框架的基础上让你的微信公众号快速接入微信平台。
--------------------------------
### 其他说明
1. **阅读源码的同学请注意本SDK为简化代码编译时加入了`lombok`支持,如果不了解`lombok`的话,请先学习下相关知识,比如可以阅读[此文章](https://mp.weixin.qq.com/s/cUc-bUcprycADfNepnSwZQ)**
2. 如有新功能需求发现BUG或者由于微信官方接口调整导致的代码问题可以直接在[【Issues】](https://github.com/Wechat-Group/WxJava/issues)页提出issue便于讨论追踪问题
3. 如果需要贡献代码请务必在提交PR之前先仔细阅读[【代码贡献指南】](CONTRIBUTING.md),谢谢理解配合;
4. 目前本`SDK`最新版本要求的`JDK`最低版本是`8`,使用`7`的同学可以使用`WxJava` `3.8.0`及以前版本,而还在使用`JDK`6的用户请参考[【此项目】]( https://github.com/binarywang/weixin-java-tools-for-jdk6) 而其他更早的JDK版本则需要自己改造实现。
5. [本项目在开源中国的页面](https://www.oschina.net/p/weixin-java-tools-new),欢迎大家积极留言评分 🙂
6. SDK开发文档请查阅 [【开发文档Wiki】](https://github.com/wechat-group/WxJava/wiki),部分文档可能未能及时更新,如有发现,可以及时上报或者自行修改。
7. **如果本开发工具包对您有所帮助,欢迎对我们的努力进行肯定,可以直接前往[【托管于码云的项目首页】](http://gitee.com/binary/weixin-java-tools),在页尾部分找到“捐助”按钮进行打赏,多多益善 😄。非常感谢各位打赏和捐助的同学!**
8. 各个模块的Javadoc可以在线查看[weixin-java-miniapp](http://binary.ac.cn/weixin-java-miniapp-javadoc/)、[weixin-java-pay](http://binary.ac.cn/weixin-java-pay-javadoc/)、[weixin-java-mp](http://binary.ac.cn/weixin-java-mp-javadoc/)、[weixin-java-common](http://binary.ac.cn/weixin-java-common-javadoc/)、[weixin-java-cp](http://binary.ac.cn/weixin-java-cp-javadoc/)、[weixin-java-open](http://binary.ac.cn/weixin-java-open-javadoc/)
9. 本SDK项目在以下代码托管网站同步更新:
* 码云https://gitee.com/binary/weixin-java-tools
* GitHubhttps://github.com/wechat-group/WxJava
# 项目说明
---------------------------------
### Maven 引用方式
注意:最新版本(包括测试版)为 [![Maven Central](https://img.shields.io/maven-central/v/com.github.binarywang/wx-java.svg)](http://mvnrepository.com/artifact/com.github.binarywang/wx-java),以下为最新正式版。
我们在网上找了一些微信相关的 SDK要不就是缺少维护要不就是集成了非常多的功能因我们的公众号希望能够尽量的自动化处理所以我们在已有的基础上进行了一些修改和整合。
## 必要的准备
因微信开发 Java SDK 的开发其实并不非常复杂,主要是通过 HTTP 发送请求并且将获得的返回数据进行一些处理返回对象就可以了。
我们需要调用微信的 HTTP 接口,所以我们需要在 Java 中使用一个 Http 客户端,在当前我们的环境中,我们只使用 OkHttp 来进行实现。
在老的项目中,可能不少人会使用 Apache 的 HttpClient 来进行实现,但因为 OkHttp 广泛的被使用在安卓的手机上,所以使用 OkHttp
会更加简便。
* [Retrofit 是什么](https://www.ossez.com/t/retrofit/14302)
* [RxJava 是什么](https://www.ossez.com/t/rxjava/14305)
* [微信测试平台获得测试账号](https://www.ossez.com/t/topic/14281)
### Maven 和依赖
当前我们还没有把正式版发布到仓库中,我们还在使用 0.0.1-SNAPSHOT 版本进行内部测试。
最好的版本就是下载我们的源代码后 Fork 到你本地,然后直接使用 Maven 来进行编译。
#### 微信公众号WeChat Java Official Account
模块名wechat-j-oa
```xml
<dependency>
<groupId>com.github.binarywang</groupId>
<artifactId>(不同模块参考下文)</artifactId>
<version>4.3.0</version>
<groupId>com.ossez.wechat</groupId>
<artifactId>wechat-j-oa</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
```
- 微信小程序:`weixin-java-miniapp`
- 微信支付:`weixin-java-pay`
- 微信开放平台:`weixin-java-open`
- 公众号(包括订阅号和服务号):`weixin-java-mp`
- 企业号/企业微信:`weixin-java-cp`
#### 微信小程序WeChat Java Mini Programs
模块名wechat-j-mp
---------------------------------
### 版本说明
```xml
<details>
<summary>点此展开查看</summary>
<dependency>
<groupId>com.ossez.wechat</groupId>
<artifactId>wechat-j-mp</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
```
1. 本项目定为大约每两个月发布一次正式版(同时 `develop` 分支代码合并进入 `master` 分支),版本号格式为 `X.X.0`(如`2.1.0``2.2.0`遇到重大问题需修复会及时提交新版本欢迎大家随时提交Pull Request
2. BUG修复和新特性一般会先发布成小版本作为临时测试版本`3.6.8.B`即尾号不为0并添加B以区别于正式版代码仅存在于 `develop` 分支中;
3. 目前最新版本号为 [![Maven Central](https://img.shields.io/maven-central/v/com.github.binarywang/wx-java.svg)](http://mvnrepository.com/artifact/com.github.binarywang/wx-java) ,也可以通过访问链接 [【微信支付】](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.github.binarywang%22%20AND%20a%3A%22weixin-java-pay%22) 、[【微信小程序】](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.github.binarywang%22%20AND%20a%3A%22weixin-java-miniapp%22) 、[【公众号】](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.github.binarywang%22%20AND%20a%3A%22weixin-java-mp%22) 、[【企业微信】](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.github.binarywang%22%20AND%20a%3A%22weixin-java-cp%22)、[【开放平台】](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.github.binarywang%22%20AND%20a%3A%22weixin-java-open%22)
分别查看所有最新的版本。
#### 微信支付WeChat Java Pay
</details>
模块名wechat-j-pay
----------------------------------
### 应用案例
完整案例登记列表,请[【访问这里】](https://github.com/Wechat-Group/weixin-java-tools/issues/729)查看,欢迎登记更多的案例。
```xml
以下为节选的部分案例:
<dependency>
<groupId>com.ossez.wechat</groupId>
<artifactId>wechat-j-pay</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
```
#### 开源项目:
- 基于微信公众号的签到、抽奖、发送弹幕程序https://github.com/workcheng/weiya
- Jeepay 支付系统https://gitee.com/jeequan/jeepay
- 微同商城https://gitee.com/fuyang_lipengjun/platform
- 微信点餐系统https://github.com/sqmax/springboot-project
- 专注批量推送的小而美的工具https://github.com/rememberber/WePush
- yshop意象商城系统https://gitee.com/guchengwuyue/yshopmall
- wx-manage微信公众号管理项目https://github.com/niefy/wx-manage
- 基于若依开发的微信公众号管理系统https://gitee.com/joolun/JooLun-wx
- SAAS微信小程序电商https://gitee.com/wei-it/weiit-saas
- mall4j 电商商城系统https://gitee.com/gz-yami/mall4j
#### 企业微信WeChat Java WeCom
#### 小程序:
- (京东)友家铺子,友家铺子店长版,京粉精选
- [喵星人贴吧助手(扫码关注)](http://p98ahz3tg.bkt.clouddn.com/miniappqrcode.jpg)
- 树懒揽书+
- 广廉快线,鹏城巴士等
- 当燃挑战、sportlight轻灵运动
- 360考试宝典
- 民医台
- 来一团商家版
- 史必达(史丹利)
- 嘀嗒云印
- 维沃吼吼
- 王朝社区(比亚迪新能源社区)
- 极吼吼手机上门回收换新
- 未来信封
- 5G惠享
- 生菜wordpress转小程序
- 丽日购
模块名wechat-j-work
#### 公众号:
- 中国电信上海网厅sh_189
- E答平台
- 宁夏生鲜365
- 通服货滴
- 神龙养车
- 沃音乐商务智能
- 光环云社群
- 手机排队
- [全民约跑健身便利店](http://www.oneminsport.com/)
- 民医台
- YshopMall
- 好行景区直通车以及全国40多个公众号
- 我奥篮球公众号
- 未来信封官微
- 银川智云问诊
- 5G惠享
```xml
#### 企业微信:
- HTC企业微信
- 掌上史丹利
- 药店益
<dependency>
<groupId>com.ossez.wechat</groupId>
<artifactId>wechat-j-work</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
```
#### 其他:
- 高善人力资源
- 小猪餐餐
- 餐饮系统
- 微信公众号管理系统http://demo.joolun.com
- 锐捷网络Saleslink
#### 微信开放平台WeChat Java Open
----------------------------------
### 贡献者列表
特别感谢参与贡献的所有同学,所有贡献者列表请在[此处](https://github.com/Wechat-Group/WxJava/graphs/contributors)查看,欢迎大家继续踊跃贡献代码!
<details>
<summary>点击此处展开查看贡献次数最多的几位小伙伴</summary>
模块名wechat-j-open
1. [chanjarster (Daniel Qian)](https://github.com/chanjarster)
1. [binarywang (Binary Wang)](https://github.com/binarywang)
1. [007gzs](https://github.com/007gzs)
1. [Silloy](https://github.com/silloy)
1. [mgcnrx11](https://github.com/mgcnrx11)
1. [0katekate0 (Wang_Wong)](https://github.com/0katekate0)
1. [yuanqixun](https://github.com/yuanqixun)
1. [kakotor](https://github.com/kakotor)
1. [aimilin6688 (Jonk)](https://github.com/aimilin6688)
1. [lkqm (Mario Luo)](https://github.com/lkqm)
1. [kareanyi (MillerLin)](https://github.com/kareanyi)
```xml
</details>
<dependency>
<groupId>com.ossez.wechat</groupId>
<artifactId>wechat-j-open</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
```
### GitHub Stargazers over time
### 其他内容
[![Stargazers over time](https://starchart.cc/Wechat-Group/WxJava.svg)](https://starchart.cc/Wechat-Group/WxJava)
* 任何有关讨论,请访问 [社区](https://www.ossez.com/tag/wechat)您可以在这里提出功能需求Bug 修复,问题解答。
* 可以考虑使用 http://paste.ubuntu.com 来对你在提交问题的时候出现的为代码进行简化。
### 框架和案例
如果你想登记你的项目,请[访问这里](https://www.ossez.com/t/wechat-j-demo/14303)。
同时,我们也提供了一些开发框架,能够让你直接检出项目就可以直接对微信 SDK 进行接入和测试。
* [公众号 Spring Boot 测试程序](https://github.com/honeymoose/WeChat-Official-Account-Spring)
# 联系方式
请使用下面的联系方式和我们联系。
* [社区和讨论](https://www.ossez.com/tag/chat-gpt)
| 联系方式名称 | 联系方式 |
|------------------|-----------------------------------------------|
| 电子邮件Email | [yhu@ossez.com](mailto:yhu@ossez.com) |
| QQ 或微信WeChat | 103899765 |
| QQ 交流群 | 15186112 |
| 社区论坛 Community | https://www.ossez.com/c/computer-technology/7 |
# 公众平台
我们建议您通过社区论坛来和我们进行沟通,请关注我们公众平台上的账号
## 微信公众号
![](https://cdn.ossez.com/img/cwikius/cwikius-qr-wechat-search-w400.png)
## 头条号
我们也在头条号上创建了我们的公众号,请扫描下面的 QR 关注我们的头条号。
![](https://cdn.ossez.com/img/cwikius/cwikus-qr-toutiao.png)
## 知乎
请关注我们的知乎https://www.zhihu.com/people/huyuchengus
# License
[WeChat-J is licensed under the MIT License](https://src.ossez.com/honeymoose/WeChat-J/src/branch/main/LICENSE)

186
common/pom.xml Normal file
View File

@ -0,0 +1,186 @@
<?xml version="1.0"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0">
<modelVersion>4.0.0</modelVersion>
<groupId>com.ossez.wechat</groupId>
<artifactId>wechat-j-common</artifactId>
<packaging>jar</packaging>
<parent>
<groupId>com.ossez.wechat</groupId>
<artifactId>wechat-j</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<name>WeChat Java Common</name>
<description>The module is common for all other package</description>
<dependencies>
<dependency>
<groupId>org.jodd</groupId>
<artifactId>jodd-http</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<exclusions>
<exclusion>
<artifactId>commons-logging</artifactId>
<groupId>commons-logging</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpmime</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>1.7.36</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-servlet</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-guava</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>2.1.3</version>
<exclusions>
<exclusion>
<groupId>pull-parser</groupId>
<artifactId>pull-parser</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
</dependency>
<dependency>
<groupId>com.github.jedis-lock</groupId>
<artifactId>jedis-lock</artifactId>
</dependency>
<dependency>
<groupId>org.redisson</groupId>
<artifactId>redisson</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-redis</artifactId>
</dependency>
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>RELEASE</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>src/test/resources/testng.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>native-image</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<annotationProcessors>
com.github.binarywang.wx.graal.GraalProcessor,lombok.launch.AnnotationProcessorHider$AnnotationProcessor,lombok.launch.AnnotationProcessorHider$ClaimingProcessor
</annotationProcessors>
<annotationProcessorPaths>
<path>
<groupId>com.github.binarywang</groupId>
<artifactId>weixin-graal</artifactId>
<version>${project.version}</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

View File

@ -1,4 +1,4 @@
package me.chanjar.weixin.common.annotation;
package com.ossez.wechat.common.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;

View File

@ -0,0 +1,32 @@
package com.ossez.wechat.common.api;
import com.ossez.wechat.common.model.WeChatAccessToken;
import com.ossez.wechat.common.model.WeChatApiDomainIp;
import com.ossez.wechat.common.model.req.NetworkCheck;
import com.ossez.wechat.common.model.req.QueryQuota;
import com.ossez.wechat.common.model.res.NetworkCheckResponse;
import com.ossez.wechat.common.model.res.QueryQuotaResponse;
import io.reactivex.Single;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;
public interface WeChatOfficialAccountApi {
@GET("/cgi-bin/token")
Single<WeChatAccessToken> getAccessToken(@Query("grant_type") String grantType, @Query("appid") String appId, @Query("secret") String secret);
@GET("/cgi-bin/get_api_domain_ip")
Single<WeChatApiDomainIp> getDomainIPs();
@POST("/cgi-bin/callback/check")
Single<NetworkCheckResponse> checkNetwork(@Body NetworkCheck request);
@POST("/cgi-bin/clear_quota")
Single<NetworkCheckResponse> clearQuota(@Body NetworkCheck request);
@POST("/cgi-bin/openapi/quota/get")
Single<QueryQuotaResponse> queryQuota(@Body QueryQuota request);
}

View File

@ -0,0 +1,26 @@
package com.ossez.wechat.common.api;
import com.ossez.wechat.common.model.WeChatAccessToken;
import com.ossez.wechat.common.model.WeChatApiDomainIp;
import com.ossez.wechat.common.model.WeChatOAuth2AccessToken;
import com.ossez.wechat.common.model.entity.WeChatOAuth2UserInfo;
import com.ossez.wechat.common.model.req.NetworkCheck;
import com.ossez.wechat.common.model.req.QueryQuota;
import com.ossez.wechat.common.model.res.NetworkCheckResponse;
import com.ossez.wechat.common.model.res.QueryQuotaResponse;
import io.reactivex.Single;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;
public interface WeChatOpenApi {
@GET("/sns/oauth2/access_token")
Single<WeChatOAuth2AccessToken> getAccessToken(@Query("grant_type") String grantType, @Query("appid") String appId, @Query("secret") String secret, @Query("code") String code);
@GET("/sns/userinfo")
Single<WeChatOAuth2UserInfo> getWeChatUserInfo(@Query("access_token") String accessToken, @Query("openid") String openId);
}

View File

@ -1,6 +1,6 @@
package me.chanjar.weixin.common.api;
package com.ossez.wechat.common.api;
import me.chanjar.weixin.common.error.WxErrorException;
import com.ossez.wechat.common.exception.WxErrorException;
/**
* WxErrorException处理器.

View File

@ -1,4 +1,4 @@
package me.chanjar.weixin.common.api;
package com.ossez.wechat.common.api;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

View File

@ -1,4 +1,4 @@
package me.chanjar.weixin.common.api;
package com.ossez.wechat.common.api;
import com.google.common.util.concurrent.ThreadFactoryBuilder;
import lombok.extern.slf4j.Slf4j;
@ -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

@ -1,10 +1,10 @@
package me.chanjar.weixin.common.bean;
package com.ossez.wechat.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

@ -1,9 +1,9 @@
package me.chanjar.weixin.common.bean;
package com.ossez.wechat.common.bean;
import java.io.Serializable;
import com.ossez.wechat.common.util.json.WxGsonBuilder;
import lombok.Data;
import me.chanjar.weixin.common.util.json.WxGsonBuilder;
/**
* 卡券Api签名.

View File

@ -1,4 +1,4 @@
package me.chanjar.weixin.common.bean;
package com.ossez.wechat.common.bean;
import java.io.Serializable;

View File

@ -1,7 +1,7 @@
package me.chanjar.weixin.common.bean;
package com.ossez.wechat.common.bean;
import com.ossez.wechat.common.util.json.WxGsonBuilder;
import lombok.Data;
import me.chanjar.weixin.common.util.json.WxGsonBuilder;
import java.io.Serializable;
import java.util.ArrayList;

View File

@ -1,8 +1,8 @@
package me.chanjar.weixin.common.bean.imgproc;
package com.ossez.wechat.common.bean.imgproc;
import com.google.gson.annotations.SerializedName;
import com.ossez.wechat.common.util.json.WxGsonBuilder;
import lombok.Data;
import me.chanjar.weixin.common.util.json.WxGsonBuilder;
import java.io.Serializable;
import java.util.List;

View File

@ -1,8 +1,8 @@
package me.chanjar.weixin.common.bean.imgproc;
package com.ossez.wechat.common.bean.imgproc;
import com.google.gson.annotations.SerializedName;
import com.ossez.wechat.common.util.json.WxGsonBuilder;
import lombok.Data;
import me.chanjar.weixin.common.util.json.WxGsonBuilder;
import java.io.Serializable;
import java.util.List;

View File

@ -1,8 +1,8 @@
package me.chanjar.weixin.common.bean.imgproc;
package com.ossez.wechat.common.bean.imgproc;
import com.google.gson.annotations.SerializedName;
import com.ossez.wechat.common.util.json.WxGsonBuilder;
import lombok.Data;
import me.chanjar.weixin.common.util.json.WxGsonBuilder;
import java.io.Serializable;

View File

@ -1,8 +1,8 @@
package me.chanjar.weixin.common.bean.ocr;
package com.ossez.wechat.common.bean.ocr;
import com.google.gson.annotations.SerializedName;
import com.ossez.wechat.common.util.json.WxGsonBuilder;
import lombok.Data;
import me.chanjar.weixin.common.util.json.WxGsonBuilder;
import java.io.Serializable;

View File

@ -1,8 +1,8 @@
package me.chanjar.weixin.common.bean.ocr;
package com.ossez.wechat.common.bean.ocr;
import com.google.gson.annotations.SerializedName;
import com.ossez.wechat.common.util.json.WxGsonBuilder;
import lombok.Data;
import me.chanjar.weixin.common.util.json.WxGsonBuilder;
import java.io.Serializable;

View File

@ -1,8 +1,8 @@
package me.chanjar.weixin.common.bean.ocr;
package com.ossez.wechat.common.bean.ocr;
import com.google.gson.annotations.SerializedName;
import com.ossez.wechat.common.util.json.WxGsonBuilder;
import lombok.Data;
import me.chanjar.weixin.common.util.json.WxGsonBuilder;
import java.io.Serializable;
import java.util.List;

View File

@ -1,8 +1,8 @@
package me.chanjar.weixin.common.bean.ocr;
package com.ossez.wechat.common.bean.ocr;
import com.google.gson.annotations.SerializedName;
import com.ossez.wechat.common.util.json.WxGsonBuilder;
import lombok.Data;
import me.chanjar.weixin.common.util.json.WxGsonBuilder;
import java.io.Serializable;

View File

@ -1,8 +1,8 @@
package me.chanjar.weixin.common.bean.ocr;
package com.ossez.wechat.common.bean.ocr;
import com.google.gson.annotations.SerializedName;
import com.ossez.wechat.common.util.json.WxGsonBuilder;
import lombok.Data;
import me.chanjar.weixin.common.util.json.WxGsonBuilder;
import java.io.Serializable;

View File

@ -1,8 +1,8 @@
package me.chanjar.weixin.common.bean.ocr;
package com.ossez.wechat.common.bean.ocr;
import com.google.gson.annotations.SerializedName;
import com.ossez.wechat.common.util.json.WxGsonBuilder;
import lombok.Data;
import me.chanjar.weixin.common.util.json.WxGsonBuilder;
import java.io.Serializable;
@ -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

@ -1,8 +1,8 @@
package me.chanjar.weixin.common.bean.ocr;
package com.ossez.wechat.common.bean.ocr;
import com.google.gson.annotations.SerializedName;
import com.ossez.wechat.common.util.json.WxGsonBuilder;
import lombok.Data;
import me.chanjar.weixin.common.util.json.WxGsonBuilder;
import java.io.Serializable;

View File

@ -1,8 +1,8 @@
package me.chanjar.weixin.common.bean.ocr;
package com.ossez.wechat.common.bean.ocr;
import com.google.gson.annotations.SerializedName;
import com.ossez.wechat.common.util.json.WxGsonBuilder;
import lombok.Data;
import me.chanjar.weixin.common.util.json.WxGsonBuilder;
import java.io.Serializable;

View File

@ -1,9 +1,9 @@
package me.chanjar.weixin.common.bean.result;
package com.ossez.wechat.common.bean.result;
import java.io.Serializable;
import com.ossez.wechat.common.util.json.WxGsonBuilder;
import lombok.Data;
import me.chanjar.weixin.common.util.json.WxGsonBuilder;
/**
*

View File

@ -1,9 +1,9 @@
package me.chanjar.weixin.common.bean.result;
package com.ossez.wechat.common.bean.result;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import com.ossez.wechat.common.util.json.WxGsonBuilder;
import lombok.Data;
import me.chanjar.weixin.common.util.json.WxGsonBuilder;
import java.io.Serializable;

View File

@ -1,10 +1,10 @@
package me.chanjar.weixin.common.bean.result;
package com.ossez.wechat.common.bean.result;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import com.ossez.wechat.common.util.json.WxGsonBuilder;
import lombok.Data;
import me.chanjar.weixin.common.util.json.WxGsonBuilder;
import java.io.Serializable;

View File

@ -1,4 +1,4 @@
package me.chanjar.weixin.common.bean.result;
package com.ossez.wechat.common.bean.result;
import lombok.Data;

View File

@ -1,4 +1,4 @@
package me.chanjar.weixin.common.bean.result;
package com.ossez.wechat.common.bean.result;
import lombok.Data;

View File

@ -1,4 +1,4 @@
package me.chanjar.weixin.common.bean.subscribemsg;
package com.ossez.wechat.common.bean.subscribemsg;
import lombok.Data;
@ -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

@ -1,4 +1,4 @@
package me.chanjar.weixin.common.bean.subscribemsg;
package com.ossez.wechat.common.bean.subscribemsg;
import lombok.Data;
@ -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

@ -1,7 +1,7 @@
package me.chanjar.weixin.common.bean.subscribemsg;
package com.ossez.wechat.common.bean.subscribemsg;
import com.ossez.wechat.common.util.json.WxGsonBuilder;
import lombok.Data;
import me.chanjar.weixin.common.util.json.WxGsonBuilder;
import java.io.Serializable;
import java.util.List;

View File

@ -1,4 +1,4 @@
package me.chanjar.weixin.common.bean.subscribemsg;
package com.ossez.wechat.common.bean.subscribemsg;
import lombok.Data;
@ -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

@ -1,8 +1,8 @@
package me.chanjar.weixin.mp.config;
package com.ossez.wechat.common.config;
import me.chanjar.weixin.common.bean.WxAccessToken;
import me.chanjar.weixin.common.enums.TicketType;
import me.chanjar.weixin.common.util.http.apache.ApacheHttpClientBuilder;
import com.ossez.wechat.common.model.WeChatAccessToken;
import com.ossez.wechat.common.enums.TicketType;
import com.ossez.wechat.common.util.http.apache.ApacheHttpClientBuilder;
import java.io.File;
import java.util.concurrent.locks.Lock;
@ -12,7 +12,7 @@ import java.util.concurrent.locks.Lock;
*
* @author chanjarster
*/
public interface WxMpConfigStorage {
public interface ConfigStorage {
/**
* Gets access token.
*
@ -44,7 +44,7 @@ public interface WxMpConfigStorage {
*
* @param accessToken 要更新的WxAccessToken对象
*/
void updateAccessToken(WxAccessToken accessToken);
void updateAccessToken(WeChatAccessToken accessToken);
/**
* 应该是线程安全的.
@ -95,6 +95,8 @@ public interface WxMpConfigStorage {
*/
void updateTicket(TicketType type, String ticket, int expiresInSeconds);
String getOpenAppId();
String getOpenSecret();
/**
* Gets app id.
*
@ -175,7 +177,7 @@ public interface WxMpConfigStorage {
/**
* http 请求重试间隔
* <pre>
* {@link me.chanjar.weixin.mp.api.impl.BaseWxMpServiceImpl#setRetrySleepMillis(int)}
* {@link BaseWeChatOfficialAccountServiceImpl#setRetrySleepMillis(int)}
* </pre>
*/
int getRetrySleepMillis();
@ -183,7 +185,7 @@ public interface WxMpConfigStorage {
/**
* http 请求最大重试次数
* <pre>
* {@link me.chanjar.weixin.mp.api.impl.BaseWxMpServiceImpl#setMaxRetryTimes(int)}
* {@link BaseWeChatOfficialAccountServiceImpl#setMaxRetryTimes(int)}
* </pre>
*/
int getMaxRetryTimes();

View File

@ -1,12 +1,9 @@
package me.chanjar.weixin.mp.config.impl;
package com.ossez.wechat.common.config;
import lombok.Data;
import me.chanjar.weixin.common.bean.WxAccessToken;
import me.chanjar.weixin.common.enums.TicketType;
import me.chanjar.weixin.common.util.http.apache.ApacheHttpClientBuilder;
import me.chanjar.weixin.mp.config.WxMpConfigStorage;
import me.chanjar.weixin.mp.config.WxMpHostConfig;
import me.chanjar.weixin.mp.util.json.WxMpGsonBuilder;
import com.ossez.wechat.common.model.WeChatAccessToken;
import com.ossez.wechat.common.enums.TicketType;
import com.ossez.wechat.common.util.http.apache.ApacheHttpClientBuilder;
import java.io.File;
import java.io.Serializable;
@ -19,9 +16,11 @@ import java.util.concurrent.locks.ReentrantLock;
* @author chanjarster
*/
@Data
public class WxMpDefaultConfigImpl implements WxMpConfigStorage, Serializable {
public class DefaultConfigStorage implements ConfigStorage, Serializable {
private static final long serialVersionUID = -6646519023303395185L;
protected volatile String openAppId;
protected volatile String openSecret;
protected volatile String appId;
protected volatile String secret;
protected volatile String token;
@ -66,7 +65,7 @@ public class WxMpDefaultConfigImpl implements WxMpConfigStorage, Serializable {
}
@Override
public synchronized void updateAccessToken(WxAccessToken accessToken) {
public synchronized void updateAccessToken(WeChatAccessToken accessToken) {
updateAccessToken(accessToken.getAccessToken(), accessToken.getExpiresIn());
}
@ -176,10 +175,6 @@ public class WxMpDefaultConfigImpl implements WxMpConfigStorage, Serializable {
}
}
@Override
public String toString() {
return WxMpGsonBuilder.create().toJson(this);
}
@Override
public boolean autoRefreshToken() {

View File

@ -1,17 +1,17 @@
package me.chanjar.weixin.mp.config.impl;
package com.ossez.wechat.common.config;
import com.ossez.wechat.common.config.DefaultConfigStorage;
import lombok.Data;
import me.chanjar.weixin.common.bean.WxAccessToken;
import com.ossez.wechat.common.model.WeChatAccessToken;
import java.util.concurrent.ConcurrentHashMap;
/**
* @author Brayden Wong
* @date 2021/1/16
* created on 2021/1/16
* 提供accesstoken保存在concurrenthashmap中的实现支持高并发仅限于单机部署
*/
@Data
public class WxMpMapConfigImpl extends WxMpDefaultConfigImpl {
public class MapConfigStorage extends DefaultConfigStorage {
private static final long serialVersionUID = 5311395137835650104L;
@ -31,7 +31,7 @@ public class WxMpMapConfigImpl extends WxMpDefaultConfigImpl {
}
@Override
public void updateAccessToken(WxAccessToken accessToken) {
public void updateAccessToken(WeChatAccessToken accessToken) {
updateAccessToken(accessToken.getAccessToken(), accessToken.getExpiresIn());
}

View File

@ -1,9 +1,10 @@
package me.chanjar.weixin.mp.config.impl;
package com.ossez.wechat.common.config;
import com.ossez.wechat.common.config.DefaultConfigStorage;
import lombok.Data;
import lombok.EqualsAndHashCode;
import me.chanjar.weixin.common.enums.TicketType;
import me.chanjar.weixin.common.redis.WxRedisOps;
import com.ossez.wechat.common.enums.TicketType;
import com.ossez.wechat.common.redis.WxRedisOps;
import java.util.concurrent.TimeUnit;
@ -17,9 +18,7 @@ import java.util.concurrent.TimeUnit;
*
* @author nickwong
*/
@Data
@EqualsAndHashCode(callSuper = false)
public class WxMpRedisConfigImpl extends WxMpDefaultConfigImpl {
public class RedisConfigStorage extends DefaultConfigStorage {
private static final long serialVersionUID = -988502871997239733L;
private static final String ACCESS_TOKEN_KEY_TPL = "%s:access_token:%s";
@ -32,7 +31,7 @@ public class WxMpRedisConfigImpl extends WxMpDefaultConfigImpl {
private String accessTokenKey;
private String lockKey;
public WxMpRedisConfigImpl(WxRedisOps redisOps, String keyPrefix) {
public RedisConfigStorage(WxRedisOps redisOps, String keyPrefix) {
this.redisOps = redisOps;
this.keyPrefix = keyPrefix;
}

View File

@ -0,0 +1,68 @@
package com.ossez.wechat.common.config;
import com.ossez.wechat.common.constant.WeChatConstant;
/**
* 微信接口地址域名部分的自定义设置信息.
*/
public class WxMpHostConfig {
/**
* 对应于https://api.weixin.qq.com
*/
private String apiHost;
/**
* 对应于https://open.weixin.qq.com
*/
private String openHost;
/**
* 对应于https://mp.weixin.qq.com
*/
private String mpHost;
public static String buildUrl(WxMpHostConfig hostConfig, String prefix, String path) {
if (hostConfig == null) {
return prefix + path;
}
if (hostConfig.getApiHost() != null && prefix.equals(WeChatConstant.ENDPOINT_WECHAT)) {
return hostConfig.getApiHost() + path;
}
if (hostConfig.getMpHost() != null && prefix.equals(WeChatConstant.ENDPOINT_MP)) {
return hostConfig.getMpHost() + path;
}
if (hostConfig.getOpenHost() != null && prefix.equals(WeChatConstant.ENDPOINT_OPEN)) {
return hostConfig.getOpenHost() + path;
}
return prefix + path;
}
public String getApiHost() {
return apiHost;
}
public void setApiHost(String apiHost) {
this.apiHost = apiHost;
}
public String getOpenHost() {
return openHost;
}
public void setOpenHost(String openHost) {
this.openHost = openHost;
}
public String getMpHost() {
return mpHost;
}
public void setMpHost(String mpHost) {
this.mpHost = mpHost;
}
}

View File

@ -0,0 +1,16 @@
package com.ossez.wechat.common.constant;
import com.google.common.net.MediaType;
/**
* HttpClient send request the type constant.
* Because okHttp need to use MediaType to construct object, but if we use guava MediaType, the two package will get conflict
* at the same class.
* <p>
* So, we get MediaType String first before we convert to okHttp MediaType.
*
* @author YuCheng Hu
*/
public final class HttpClientMediaType {
public static final String APPLICATION_JSON = MediaType.JSON_UTF_8.toString();
}

View File

@ -1,4 +1,4 @@
package me.chanjar.weixin.mp.constant;
package com.ossez.wechat.common.constant;
/**
* <pre>
@ -8,7 +8,7 @@ package me.chanjar.weixin.mp.constant;
*
* @author <a href="https://github.com/binarywang">Binary Wang</a>
*/
public class WxMpEventConstants {
public class OfficialAccountEventConstants {
/**
* 门店审核事件.
*/

View File

@ -0,0 +1,5 @@
package com.ossez.wechat.common.constant;
public class WeChatApiParameter {
public static final String ACCESS_TOKEN_GRANT_TYPE_CLIENT_CREDENTIAL = "client_credential";
}

View File

@ -0,0 +1,556 @@
package com.ossez.wechat.common.constant;
import com.ossez.wechat.common.enums.WeChatErrorCode;
import java.util.*;
/**
* The constant of WeChat
*
* @author YuCheng Hu
*/
public class WeChatConstant {
public static final String ENDPOINT_WECHAT = "https://api.weixin.qq.com";
public static final String ENDPOINT_MP = "https://mp.weixin.qq.com";
public static final String ENDPOINT_OPEN = "https://open.weixin.qq.com";
/**
* access_token 相关错误代码
* <pre>
* 发生以下情况时尝试刷新access_token
* 40001 获取access_token时AppSecret错误或者access_token无效
* 42001 access_token超时
* 40014 不合法的access_token请开发者认真比对access_token的有效性如是否过期或查看是否正在为恰当的公众号调用接口
* </pre>
*/
public static final EnumSet<WeChatErrorCode> ACCESS_TOKEN_ERROR_CODES_SET = EnumSet.of(WeChatErrorCode.CODE_40001, WeChatErrorCode.CODE_40014, WeChatErrorCode.CODE_42001);
@Deprecated
public static final List<Integer> ACCESS_TOKEN_ERROR_CODES = Arrays.asList(WeChatErrorCode.CODE_40001.getCode(),
WeChatErrorCode.CODE_40014.getCode(), WeChatErrorCode.CODE_42001.getCode());
/**
* 微信推送过来的消息的类型和发送给微信xml格式消息的消息类型.
*/
public static class XmlMsgType {
public static final String TEXT = "text";
public static final String IMAGE = "image";
public static final String VOICE = "voice";
public static final String SHORTVIDEO = "shortvideo";
public static final String VIDEO = "video";
public static final String NEWS = "news";
public static final String MUSIC = "music";
public static final String LOCATION = "location";
public static final String LINK = "link";
public static final String EVENT = "event";
public static final String DEVICE_TEXT = "device_text";
public static final String DEVICE_EVENT = "device_event";
public static final String DEVICE_STATUS = "device_status";
public static final String HARDWARE = "hardware";
public static final String TRANSFER_CUSTOMER_SERVICE = "transfer_customer_service";
public static final String UPDATE_TASKCARD = "update_taskcard";
public static final String UPDATE_BUTTON = "update_button";
}
/**
* 主动发送消息(即客服消息)的消息类型.
*/
public static class MsgType {
/**
* 消息类型:
* text(文本)
* image(图片)
* voice(语音)
* video(视频)
* music(音乐)
* news(图文消息 - 点击跳转到外链)
* mpnews(图文消息 - 点击跳转到图文消息页面)
* wxcard(卡券)
* miniprogrampage(小程序)
* markdown(目前仅支持markdown语法的子集微工作台原企业号不支持展示markdown消息)
* file(发送文件 - CP专用)
* textcard(文本卡片消息 - CP专用)
* wxcard(卡券消息)
*/
public static final String TEXT = "text";
public static final String IMAGE = "image";
public static final String VOICE = "voice";
public static final String VIDEO = "video";
public static final String MUSIC = "music";
public static final String NEWS = "news";
public static final String MPNEWS = "mpnews";
public static final String MARKDOWN = "markdown";
public static final String FILE = "file";
public static final String TEXTCARD = "textcard";
public static final String WXCARD = "wxcard";
/**
* 转发到客服的消息.
*/
public static final String TRANSFER_CUSTOMER_SERVICE = "transfer_customer_service";
/**
* 小程序卡片(要求小程序与公众号已关联).
*/
public static final String MINIPROGRAMPAGE = "miniprogrampage";
/**
* 任务卡片消息.
*/
public static final String TASKCARD = "taskcard";
/**
* 菜单消息.
*/
public static final String MSGMENU = "msgmenu";
/**
* 小程序通知消息.
*/
public static final String MINIPROGRAM_NOTICE = "miniprogram_notice";
/**
* 模板卡片消息.
*/
public static final String TEMPLATE_CARD = "template_card";
/**
* 发送图文消息点击跳转到图文消息页面使用通过 发布 系列接口得到的 article_id(草稿箱功能上线后不再支持客服接口中带 media_id mpnews 类型的图文消息)
*/
public static final String MP_NEWS_ARTICLE = "mpnewsarticle";
}
/**
* 发送学校通知类型
* https://developer.work.weixin.qq.com/document/path/92321
*/
public static class SchoolContactMsgType {
/**
* 文本消息.
*/
public static final String TEXT = "text";
/**
* 图片消息.
*/
public static final String IMAGE = "image";
/**
* 语音消息.
*/
public static final String VOICE = "voice";
/**
* 视频消息.
*/
public static final String VIDEO = "video";
/**
* 文件消息
*/
public static final String FILE = "file";
/**
* 图文消息
*/
public static final String NEWS = "news";
/**
* 图文消息mpnews
*/
public static final String MPNEWS = "mpnews";
/**
* 小程序消息
*/
public static final String MINIPROGRAM = "miniprogram";
}
/**
* 企业微信模板卡片消息的卡片类型
*/
public static class TemplateCardType {
/**
* 文本通知型卡片
*/
public static final String TEXT_NOTICE = "text_notice";
/**
* 图文展示型卡片
*/
public static final String NEWS_NOTICE = "news_notice";
/**
* 按钮交互型卡片
*/
public static final String BUTTON_INTERACTION = "button_interaction";
/**
* 投票选择型卡片
*/
public static final String VOTE_INTERACTION = "vote_interaction";
/**
* 多项选择型卡片
*/
public static final String MULTIPLE_INTERACTION = "multiple_interaction";
}
/**
* 表示是否是保密消息0表示否1表示是默认0.
*/
public static class KefuMsgSafe {
public static final String NO = "0";
public static final String YES = "1";
}
/**
* 群发消息的消息类型.
*/
public static class MassMsgType {
public static final String MPNEWS = "mpnews";
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";
}
/**
* 群发消息后微信端推送给服务器的反馈消息.
*/
public static class MassMsgStatus {
public static final String SEND_SUCCESS = "send success";
public static final String SEND_FAIL = "send fail";
public static final String ERR_10001 = "err(10001)";
public static final String ERR_20001 = "err(20001)";
public static final String ERR_20004 = "err(20004)";
public static final String ERR_20002 = "err(20002)";
public static final String ERR_20006 = "err(20006)";
public static final String ERR_20008 = "err(20008)";
public static final String ERR_20013 = "err(20013)";
public static final String ERR_22000 = "err(22000)";
public static final String ERR_21000 = "err(21000)";
public static final String ERR_30001 = "err(30001)";
public static final String ERR_30002 = "err(30002)";
public static final String ERR_30003 = "err(30003)";
public static final String ERR_40001 = "err(40001)";
public static final String ERR_40002 = "err(40002)";
/**
* 群发反馈消息代码所对应的文字描述.
*/
public static final Map<String, String> STATUS_DESC = new HashMap<>();
static {
STATUS_DESC.put(SEND_SUCCESS, "发送成功");
STATUS_DESC.put(SEND_FAIL, "发送失败");
STATUS_DESC.put(ERR_10001, "涉嫌广告");
STATUS_DESC.put(ERR_20001, "涉嫌政治");
STATUS_DESC.put(ERR_20004, "涉嫌社会");
STATUS_DESC.put(ERR_20002, "涉嫌色情");
STATUS_DESC.put(ERR_20006, "涉嫌违法犯罪");
STATUS_DESC.put(ERR_20008, "涉嫌欺诈");
STATUS_DESC.put(ERR_20013, "涉嫌版权");
STATUS_DESC.put(ERR_22000, "涉嫌互推_互相宣传");
STATUS_DESC.put(ERR_21000, "涉嫌其他");
STATUS_DESC.put(ERR_30001, "原创校验出现系统错误且用户选择了被判为转载就不群发");
STATUS_DESC.put(ERR_30002, "原创校验被判定为不能群发");
STATUS_DESC.put(ERR_30003, "原创校验被判定为转载文且用户选择了被判为转载就不群发");
STATUS_DESC.put(ERR_40001, "管理员拒绝");
STATUS_DESC.put(ERR_40002, "管理员30分钟内无响应超时");
}
}
/**
* 微信端推送过来的事件类型.
*/
public static class EventType {
public static final String SUBSCRIBE = "subscribe";
public static final String UNSUBSCRIBE = "unsubscribe";
public static final String SCAN = "SCAN";
public static final String LOCATION = "LOCATION";
public static final String CLICK = "CLICK";
public static final String VIEW = "VIEW";
public static final String MASS_SEND_JOB_FINISH = "MASSSENDJOBFINISH";
/**
* 扫码推事件的事件推送
*/
public static final String SCANCODE_PUSH = "scancode_push";
/**
* 扫码推事件且弹出消息接收中提示框的事件推送.
*/
public static final String SCANCODE_WAITMSG = "scancode_waitmsg";
/**
* 弹出系统拍照发图的事件推送.
*/
public static final String PIC_SYSPHOTO = "pic_sysphoto";
/**
* 弹出拍照或者相册发图的事件推送.
*/
public static final String PIC_PHOTO_OR_ALBUM = "pic_photo_or_album";
/**
* 弹出微信相册发图器的事件推送.
*/
public static final String PIC_WEIXIN = "pic_weixin";
/**
* 弹出地理位置选择器的事件推送.
*/
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";
/**
* 微信小店 订单付款通知.
*/
public static final String MERCHANT_ORDER = "merchant_order";
/**
* 卡券事件卡券通过审核
*/
public static final String CARD_PASS_CHECK = "card_pass_check";
/**
* 卡券事件卡券未通过审核
*/
public static final String CARD_NOT_PASS_CHECK = "card_not_pass_check";
/**
* 卡券事件用户领取卡券
*/
public static final String CARD_USER_GET_CARD = "user_get_card";
/**
* 卡券事件用户转赠卡券
*/
public static final String CARD_USER_GIFTING_CARD = "user_gifting_card";
/**
* 异步安全校验事件
*/
public static final String WXA_MEDIA_CHECK = "wxa_media_check";
/**
* 卡券事件用户核销卡券
*/
public static final String CARD_USER_CONSUME_CARD = "user_consume_card";
/**
* 卡券事件用户通过卡券的微信买单完成时推送
*/
public static final String CARD_USER_PAY_FROM_PAY_CELL = "user_pay_from_pay_cell";
/**
* 卡券事件用户提交会员卡开卡信息
*/
public static final String CARD_SUBMIT_MEMBERCARD_USER_INFO = "submit_membercard_user_info";
/**
* 卡券事件用户打开查看卡券
*/
public static final String CARD_USER_VIEW_CARD = "user_view_card";
/**
* 卡券事件用户删除卡券
*/
public static final String CARD_USER_DEL_CARD = "user_del_card";
/**
* 卡券事件用户在卡券里点击查看公众号进入会话时需要用户已经关注公众号
*/
public static final String CARD_USER_ENTER_SESSION_FROM_CARD = "user_enter_session_from_card";
/**
* 卡券事件当用户的会员卡积分余额发生变动时
*/
public static final String CARD_UPDATE_MEMBER_CARD = "update_member_card";
/**
* 卡券事件当某个card_id的初始库存数大于200且当前库存小于等于100时用户尝试领券会触发发送事件给商户事件每隔12h发送一次
*/
public static final String CARD_SKU_REMIND = "card_sku_remind";
/**
* 卡券事件当商户朋友的券券点发生变动时
*/
public static final String CARD_PAY_ORDER = "card_pay_order";
/**
* 小程序审核事件审核通过
*/
public static final String WEAPP_AUDIT_SUCCESS = "weapp_audit_success";
/**
* 小程序审核事件审核不通过
*/
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";
}
/**
* 上传多媒体临时素材文件的类型.
*/
public static class MediaFileType {
public static final String IMAGE = "image";
public static final String VOICE = "voice";
public static final String VIDEO = "video";
public static final String THUMB = "thumb";
public static final String FILE = "file";
}
/**
* 自定义菜单的按钮类型.
*/
public static class MenuButtonType {
/**
* 点击推事件.
*/
public static final String CLICK = "click";
/**
* 跳转URL.
*/
public static final String VIEW = "view";
/**
* 跳转到小程序.
*/
public static final String MINIPROGRAM = "miniprogram";
/**
* 扫码推事件.
*/
public static final String SCANCODE_PUSH = "scancode_push";
/**
* 扫码推事件且弹出消息接收中提示框.
*/
public static final String SCANCODE_WAITMSG = "scancode_waitmsg";
/**
* 弹出系统拍照发图.
*/
public static final String PIC_SYSPHOTO = "pic_sysphoto";
/**
* 弹出拍照或者相册发图.
*/
public static final String PIC_PHOTO_OR_ALBUM = "pic_photo_or_album";
/**
* 弹出微信相册发图器.
*/
public static final String PIC_WEIXIN = "pic_weixin";
/**
* 弹出地理位置选择器.
*/
public static final String LOCATION_SELECT = "location_select";
/**
* 下发消息除文本消息.
*/
public static final String MEDIA_ID = "media_id";
/**
* 跳转图文消息URL.
*/
public static final String VIEW_LIMITED = "view_limited";
}
/**
* oauth2网页授权的scope.
*/
public static class OAuth2Scope {
/**
* 不弹出授权页面直接跳转只能获取用户openid.
*/
public static final String SNSAPI_BASE = "snsapi_base";
/**
* 弹出授权页面可通过openid拿到昵称性别所在地并且即使在未关注的情况下只要用户授权也能获取其信息.
*/
public static final String SNSAPI_USERINFO = "snsapi_userinfo";
/**
* 手动授权,可获取成员的详细信息,包含手机邮箱只适用于企业微信或企业号.
*/
public static final String SNSAPI_PRIVATEINFO = "snsapi_privateinfo";
}
/**
* 网页应用登录授权作用域.
*/
public static class QrConnectScope {
public static final String SNSAPI_LOGIN = "snsapi_login";
}
/**
* 永久素材类型.
*/
public static class MaterialType {
public static final String NEWS = "news";
public static final String VOICE = "voice";
public static final String IMAGE = "image";
public static final String VIDEO = "video";
}
/**
* 网络检测入参.
*/
public static class NetCheckArgs {
public static final String ACTIONDNS = "dns";
public static final String ACTIONPING = "ping";
public static final String ACTIONALL = "all";
public static final String OPERATORUNICOM = "UNICOM";
public static final String OPERATORCHINANET = "CHINANET";
public static final String OPERATORCAP = "CAP";
public static final String OPERATORDEFAULT = "DEFAULT";
}
/**
* appId 类型
*/
public static class AppIdType {
/**
* 公众号appId类型
*/
public static final String MP_TYPE = "mp";
/**
* 小程序appId类型
*/
public static final String MINI_TYPE = "mini";
}
}

View File

@ -0,0 +1,20 @@
package com.ossez.wechat.common.enums;
/**
* The language for WeChat API can support
*
* @author YuCheng Hu
*/
public enum Language {
ZH_CN("zh_CN"), EN_US("en_US");
private String code;
Language(String code) {
this.code = code;
}
public String getCode() {
return code;
}
}

View File

@ -1,4 +1,4 @@
package me.chanjar.weixin.common.enums;
package com.ossez.wechat.common.enums;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

View File

@ -0,0 +1,207 @@
package com.ossez.wechat.common.enums;
import com.google.common.collect.Maps;
import java.util.Map;
/**
* WeChat Error Code
* <pre>
* 微信公众平台全局返回码.
* 参考文档<a href="https://developers.weixin.qq.com/doc/offiaccount/Getting_Started/Global_Return_Code.html">公众平台全局返回码</a>
* </pre>
*
* @author YuCheng Hu
*/
public enum WeChatErrorCode {
CODE_1(-1, "系统繁忙,此时请开发者稍候再试"),
CODE_0(0, "请求成功"),
CODE_40001(40001, "获取 access_token 时 AppSecret 错误,或者 access_token 无效。请开发者认真比对 AppSecret 的正确性,或查看是否正在为恰当的公众号调用接口"),
CODE_40002(40002, "不合法的凭证类型"),
CODE_40003(40003, "不合法的 OpenID ,请开发者确认 OpenID (该用户)是否已关注公众号,或是否是其他公众号的 OpenID"),
CODE_40004(40004, "不合法的媒体文件类型"),
CODE_40005(40005, "不合法的文件类型"),
CODE_40006(40006, "不合法的文件大小"),
CODE_40007(40007, "不合法的媒体文件 id"),
CODE_40008(40008, "不合法的消息类型"),
CODE_40009(40009, "不合法的图片文件大小"),
CODE_40010(40010, "不合法的语音文件大小"),
CODE_40011(40011, "不合法的视频文件大小"),
CODE_40012(40012, "不合法的缩略图文件大小"),
CODE_40013(40013, "不合法的 AppID ,请开发者检查 AppID 的正确性,避免异常字符,注意大小写"),
CODE_40014(40014, "不合法的 access_token ,请开发者认真比对 access_token 的有效性(如是否过期),或查看是否正在为恰当的公众号调用接口"),
CODE_40015(40015, "不合法的菜单类型"),
CODE_40016(40016, "不合法的按钮个数"),
CODE_40017(40017, "不合法的按钮类型"),
CODE_40018(40018, "不合法的按钮名字长度"),
CODE_40019(40019, "不合法的按钮 KEY 长度"),
CODE_40020(40020, "不合法的按钮 URL 长度"),
CODE_40021(40021, "不合法的菜单版本号"),
CODE_40022(40022, "不合法的子菜单级数"),
CODE_40023(40023, "不合法的子菜单按钮个数"),
CODE_40024(40024, "不合法的子菜单按钮类型"),
CODE_40025(40025, "不合法的子菜单按钮名字长度"),
CODE_40026(40026, "不合法的子菜单按钮 KEY 长度"),
CODE_40027(40027, "不合法的子菜单按钮 URL 长度"),
CODE_40028(40028, "不合法的自定义菜单使用用户"),
CODE_40029(40029, "不合法的 oauth_code"),
CODE_40030(40030, "不合法的 refresh_token"),
CODE_40031(40031, "不合法的 openid 列表"),
CODE_40032(40032, "不合法的 openid 列表长度"),
CODE_40033(40033, "不合法的请求字符,不能包含\\uxxxx 格式的字符"),
CODE_40035(40035, "不合法的参数"),
CODE_40038(40038, "不合法的请求格式"),
CODE_40039(40039, "不合法的 URL 长度"),
CODE_40050(40050, "不合法的分组 id"),
CODE_40051(40051, "分组名字不合法"),
CODE_40060(40060, "删除单篇图文时,指定的 article_idx 不合法"),
CODE_40117(40117, "分组名字不合法"),
CODE_40118(40118, "media_id 大小不合法"),
CODE_40119(40119, "button 类型错误"),
CODE_40120(40120, "button 类型错误"),
CODE_40121(40121, "不合法的 media_id 类型"),
CODE_40132(40132, "微信号不合法"),
CODE_40137(40137, "不支持的图片格式"),
CODE_40155(40155, "请勿添加其他公众号的主页链接"),
CODE_40163(40163, "oauth_code已使用"),
CODE_41001(41001, "缺少 access_token 参数"),
CODE_41002(41002, "缺少 appid 参数"),
CODE_41003(41003, "缺少 refresh_token 参数"),
CODE_41004(41004, "缺少 secret 参数"),
CODE_41005(41005, "缺少多媒体文件数据"),
CODE_41006(41006, "缺少 media_id 参数"),
CODE_41007(41007, "缺少子菜单数据"),
CODE_41008(41008, "缺少 oauth code"),
CODE_41009(41009, "缺少 openid"),
CODE_42001(42001, "access_token 超时,请检查 access_token 的有效期,请参考基础支持 - 获取 access_token 中,对 access_token 的详细机制说明"),
CODE_42002(42002, "refresh_token 超时"),
CODE_42003(42003, "oauth_code 超时"),
CODE_42007(42007, "用户修改微信密码, accesstoken 和 refreshtoken 失效,需要重新授权"),
CODE_43001(43001, "需要 GET 请求"),
CODE_43002(43002, "需要 POST 请求"),
CODE_43003(43003, "需要 HTTPS 请求"),
CODE_43004(43004, "需要接收者关注"),
CODE_43005(43005, "需要好友关系"),
CODE_43019(43019, "需要将接收者从黑名单中移除"),
CODE_44001(44001, "多媒体文件为空"),
CODE_44002(44002, "POST 的数据包为空"),
CODE_44003(44003, "图文消息内容为空"),
CODE_44004(44004, "文本消息内容为空"),
CODE_45001(45001, "多媒体文件大小超过限制"),
CODE_45002(45002, "消息内容超过限制"),
CODE_45003(45003, "标题字段超过限制"),
CODE_45004(45004, "描述字段超过限制"),
CODE_45005(45005, "链接字段超过限制"),
CODE_45006(45006, "图片链接字段超过限制"),
CODE_45007(45007, "语音播放时间超过限制"),
CODE_45008(45008, "图文消息超过限制"),
CODE_45009(45009, "接口调用超过限制"),
CODE_45010(45010, "创建菜单个数超过限制"),
CODE_45011(45011, "API 调用太频繁,请稍候再试"),
CODE_45015(45015, "回复时间超过限制"),
CODE_45016(45016, "系统分组,不允许修改"),
CODE_45017(45017, "分组名字过长"),
CODE_45018(45018, "分组数量超过上限"),
CODE_45047(45047, "客服接口下行条数超过上限"),
CODE_45159(45159, "非法的tag_id"),
CODE_45065(45065, "相同 clientmsgid 已存在群发记录,返回数据中带有已存在的群发任务的 msgid"),
CODE_45066(45066, "相同 clientmsgid 重试速度过快请间隔1分钟重试"),
CODE_45067(45067, "clientmsgid 长度超过限制"),
CODE_46001(46001, "不存在媒体数据"),
CODE_46002(46002, "不存在的菜单版本"),
CODE_46003(46003, "不存在的菜单数据"),
CODE_46004(46004, "不存在的用户"),
CODE_47001(47001, "解析 JSON/XML 内容错误"),
CODE_48001(48001, "api 功能未授权,请确认公众号已获得该接口,可以在公众平台官网 - 开发者中心页中查看接口权限"),
CODE_48002(48002, "粉丝拒收消息(粉丝在公众号选项中,关闭了 “ 接收消息 ” "),
CODE_48004(48004, "api 接口被封禁,请登录 mp.weixin.qq.com 查看详情"),
CODE_48005(48005, "api 禁止删除被自动回复和自定义菜单引用的素材"),
CODE_48006(48006, "api 禁止清零调用次数,因为清零次数达到上限"),
CODE_48008(48008, "没有该类型消息的发送权限"),
CODE_50001(50001, "用户未授权该 api"),
CODE_50002(50002, "用户受限,可能是违规后接口被封禁"),
CODE_50005(50005, "用户未关注公众号"),
CODE_61451(61451, "参数错误 (invalid parameter)"),
CODE_61452(61452, "无效客服账号 (invalid kf_account)"),
CODE_61453(61453, "客服帐号已存在 (kf_account exsited)"),
CODE_61454(61454, "客服帐号名长度超过限制 ( 仅允许 10 个英文字符,不包括 @ 及 @ 后的公众号的微信号 )(invalid kf_acount length)"),
CODE_61455(61455, "客服帐号名包含非法字符 ( 仅允许英文 + 数字 )(illegal character in kf_account)"),
CODE_61456(61456, "客服帐号个数超过限制 (10 个客服账号 )(kf_account count exceeded)"),
CODE_61457(61457, "无效头像文件类型 (invalid file type)"),
CODE_61450(61450, "系统错误 (system error)"),
CODE_61500(61500, "日期格式错误"),
CODE_65301(65301, "不存在此 menuid 对应的个性化菜单"),
CODE_65302(65302, "没有相应的用户"),
CODE_65303(65303, "没有默认菜单,不能创建个性化菜单"),
CODE_65304(65304, "MatchRule 信息为空"),
CODE_65305(65305, "个性化菜单数量受限"),
CODE_65306(65306, "不支持个性化菜单的帐号"),
CODE_65307(65307, "个性化菜单信息为空"),
CODE_65308(65308, "包含没有响应类型的 button"),
CODE_65309(65309, "个性化菜单开关处于关闭状态"),
CODE_65310(65310, "填写了省份或城市信息,国家信息不能为空"),
CODE_65311(65311, "填写了城市信息,省份信息不能为空"),
CODE_65312(65312, "不合法的国家信息"),
CODE_65313(65313, "不合法的省份信息"),
CODE_65314(65314, "不合法的城市信息"),
CODE_65316(65316, "该公众号的菜单设置了过多的域名外跳(最多跳转到 3 个域名的链接)"),
CODE_65317(65317, "不合法的 URL"),
CODE_9001001(9001001, "POST 数据参数不合法"),
CODE_9001002(9001002, "远端服务不可用"),
CODE_9001003(9001003, "Ticket 不合法"),
CODE_9001004(9001004, "获取摇周边用户信息失败"),
CODE_9001005(9001005, "获取商户信息失败"),
CODE_9001006(9001006, "获取 OpenID 失败"),
CODE_9001007(9001007, "上传文件缺失"),
CODE_9001008(9001008, "上传素材的文件类型不合法"),
CODE_9001009(9001009, "上传素材的文件尺寸不合法"),
CODE_9001010(9001010, "上传失败"),
CODE_9001020(9001020, "帐号不合法"),
CODE_9001021(9001021, "已有设备激活率低于 50% ,不能新增设备"),
CODE_9001022(9001022, "设备申请数不合法,必须为大于 0 的数字"),
CODE_9001023(9001023, "已存在审核中的设备 ID 申请"),
CODE_9001024(9001024, "一次查询设备 ID 数量不能超过 50"),
CODE_9001025(9001025, "设备 ID 不合法"),
CODE_9001026(9001026, "页面 ID 不合法"),
CODE_9001027(9001027, "页面参数不合法"),
CODE_9001028(9001028, "一次删除页面 ID 数量不能超过 10"),
CODE_9001029(9001029, "页面已应用在设备中,请先解除应用关系再删除"),
CODE_9001030(9001030, "一次查询页面 ID 数量不能超过 50"),
CODE_9001032(9001032, "保存设备与页面的绑定关系参数错误"),
CODE_9001033(9001033, "门店 ID 不合法"),
CODE_9001034(9001034, "设备备注信息过长"),
CODE_9001035(9001035, "设备申请参数不合法"),
CODE_9001036(9001036, "查询起始值 begin 不合法"),
CODE_45083(45083, "设置的 speed 参数不在0到4的范围内"),
CODE_45084(45084, "没有设置 speed 参数");
private final int code;
private final String msg;
WeChatErrorCode(int code, String msg) {
this.code = code;
this.msg = msg;
}
public int getCode() {
return code;
}
public String getMsg() {
return msg;
}
static final Map<Integer, String> valueMap = Maps.newHashMap();
static {
for (WeChatErrorCode value : WeChatErrorCode.values()) {
valueMap.put(value.code, value.msg);
}
}
/**
* 通过错误代码查找其中文含义..
*/
public static String findMsgByCode(int code) {
return valueMap.getOrDefault(code, null);
}
}

View File

@ -0,0 +1,12 @@
package com.ossez.wechat.common.enums;
/**
* WeChat's Storage Category
*
* We provide implement for MEM(RAM) and REDIS
*
* @author YuCheng Hu
*/
public enum WeChatStorageCategory {
MEM, REDIS
}

View File

@ -0,0 +1,25 @@
package com.ossez.wechat.common.enums;
/**
* 微信卡券
*
* @author YuCheng
*/
public enum WxCardType {
MEMBER_CARD("MEMBER_CARD"),
GROUPON("GROUPON"),
CASH("CASH"),
DISCOUNT("DISCOUNT"),
GIFT("GIFT"),
GENERAL_COUPON("GENERAL_COUPON");
private String code;
WxCardType(String code) {
this.code = code;
}
public String getCode() {
return code;
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
package me.chanjar.weixin.common.enums;
package com.ossez.wechat.common.enums;
/**
* <pre>

View File

@ -0,0 +1,26 @@
package com.ossez.wechat.common.exception;
/**
* @author Daniel Qian
*/
public class DataStructureException extends WxErrorException {
private static final long serialVersionUID = -6357149550353160810L;
private final WxError error;
private static final int DEFAULT_ERROR_CODE = -99;
public DataStructureException(String message) {
this(WxError.builder().errorCode(DEFAULT_ERROR_CODE).errorMsg(message).build());
}
public DataStructureException(WxError error) {
super(error.toString());
this.error = error;
}
public WxError getError() {
return this.error;
}
}

View File

@ -1,4 +1,4 @@
package me.chanjar.weixin.common.error;
package com.ossez.wechat.common.exception;
import com.google.common.collect.Maps;
import lombok.Getter;

View File

@ -1,11 +1,12 @@
package me.chanjar.weixin.common.error;
package com.ossez.wechat.common.exception;
import com.ossez.wechat.common.enums.WeChatErrorCode;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import me.chanjar.weixin.common.enums.WxType;
import me.chanjar.weixin.common.util.json.WxGsonBuilder;
import com.ossez.wechat.common.enums.WxType;
import com.ossez.wechat.common.util.json.WxGsonBuilder;
import org.apache.commons.lang3.StringUtils;
import java.io.Serializable;
@ -23,7 +24,7 @@ import java.io.Serializable;
@AllArgsConstructor
@Builder
public class WxError implements Serializable {
private static final long serialVersionUID = 7869786563361406291L;
private static final long serialVersionUID = -2696724276555657960L;
/**
* 微信错误代码.
@ -64,7 +65,7 @@ public class WxError implements Serializable {
switch (type) {
case MP: {
final String msg = WxMpErrorMsgEnum.findMsgByCode(wxError.getErrorCode());
final String msg = WeChatErrorCode.findMsgByCode(wxError.getErrorCode());
if (msg != null) {
wxError.setErrorMsg(msg);
}

View File

@ -1,4 +1,6 @@
package me.chanjar.weixin.common.error;
package com.ossez.wechat.common.exception;
import static com.ossez.wechat.common.exception.WxError.*;
/**
* @author Daniel Qian

View File

@ -1,4 +1,4 @@
package me.chanjar.weixin.common.error;
package com.ossez.wechat.common.exception;
import com.google.common.collect.Maps;
import lombok.Getter;

View File

@ -1,4 +1,4 @@
package me.chanjar.weixin.common.error;
package com.ossez.wechat.common.exception;
import com.google.common.collect.Maps;
import lombok.Getter;
@ -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

@ -1,10 +1,10 @@
package me.chanjar.weixin.common.error;
package com.ossez.wechat.common.exception;
/**
* 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

@ -0,0 +1,44 @@
package com.ossez.wechat.common.model;
import java.io.Serializable;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.ossez.wechat.common.util.json.WxGsonBuilder;
import lombok.Data;
/**
* WeChatAccessToken Response Object
*
* @author YuCheng Hu
*/
public class WeChatAccessToken {
@JsonProperty("access_token")
private String accessToken;
@JsonProperty("expires_in")
private int expiresIn = -1;
public static WeChatAccessToken fromJson(String json) {
return WxGsonBuilder.create().fromJson(json, WeChatAccessToken.class);
}
public String getAccessToken() {
return accessToken;
}
public void setAccessToken(String accessToken) {
this.accessToken = accessToken;
}
public int getExpiresIn() {
return expiresIn;
}
public void setExpiresIn(int expiresIn) {
this.expiresIn = expiresIn;
}
}

View File

@ -0,0 +1,27 @@
package com.ossez.wechat.common.model;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.ossez.wechat.common.util.json.WxGsonBuilder;
import java.util.List;
/**
* WeChatAccessToken Response Object
*
* @author YuCheng Hu
*/
public class WeChatApiDomainIp {
@JsonProperty("ip_list")
private List<String> ipList;
public List<String> getIpList() {
return ipList;
}
public void setIpList(List<String> ipList) {
this.ipList = ipList;
}
}

View File

@ -0,0 +1,16 @@
package com.ossez.wechat.common.model;
import lombok.Data;
import lombok.experimental.Accessors;
import java.io.Serializable;
@Data
@Accessors(chain = true)
public class WeChatHost implements Serializable {
private static final long serialVersionUID = -7648920647310280817L;
private String apiHost;
private String openHost;
private String mpHost;
}

View File

@ -0,0 +1,107 @@
package com.ossez.wechat.common.model;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.gson.annotations.SerializedName;
import com.ossez.wechat.common.util.json.WxGsonBuilder;
import lombok.Data;
import java.io.Serializable;
/**
* https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421140842
*
* @author Daniel Qian
*/
public class WeChatOAuth2AccessToken implements Serializable {
private static final long serialVersionUID = 5755678830089329526L;
@JsonProperty("access_token")
private String accessToken;
@JsonProperty("expires_in")
private int expiresIn = -1;
@JsonProperty("refresh_token")
private String refreshToken;
@JsonProperty("openid")
private String openId;
@JsonProperty("scope")
private String scope;
@JsonProperty("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字段
*/
@SerializedName("unionid")
private String unionId;
public static WeChatOAuth2AccessToken fromJson(String json) {
return WxGsonBuilder.create().fromJson(json, WeChatOAuth2AccessToken.class);
}
@Override
public String toString() {
return WxGsonBuilder.create().toJson(this);
}
public String getAccessToken() {
return accessToken;
}
public void setAccessToken(String accessToken) {
this.accessToken = accessToken;
}
public int getExpiresIn() {
return expiresIn;
}
public void setExpiresIn(int expiresIn) {
this.expiresIn = expiresIn;
}
public String getRefreshToken() {
return refreshToken;
}
public void setRefreshToken(String refreshToken) {
this.refreshToken = refreshToken;
}
public String getOpenId() {
return openId;
}
public void setOpenId(String openId) {
this.openId = openId;
}
public String getScope() {
return scope;
}
public void setScope(String scope) {
this.scope = scope;
}
public Integer getSnapshotUser() {
return snapshotUser;
}
public void setSnapshotUser(Integer snapshotUser) {
this.snapshotUser = snapshotUser;
}
public String getUnionId() {
return unionId;
}
public void setUnionId(String unionId) {
this.unionId = unionId;
}
}

View File

@ -0,0 +1,34 @@
package com.ossez.wechat.common.model;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* WeChatStatus Response Object
*
* @author YuCheng Hu
*/
public class WeChatStatus {
@JsonProperty("errcode")
private int errCode = 0;
@JsonProperty("errmsg")
private String errMsg;
public int getErrCode() {
return errCode;
}
public void setErrCode(int errCode) {
this.errCode = errCode;
}
public String getErrMsg() {
return errMsg;
}
public void setErrMsg(String errMsg) {
this.errMsg = errMsg;
}
}

View File

@ -0,0 +1,129 @@
package com.ossez.wechat.common.model.entity;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.gson.annotations.SerializedName;
import com.ossez.wechat.common.util.json.WxGsonBuilder;
import lombok.Data;
import java.io.Serializable;
/**
* oauth2用户个人信息.
* <pre>
* {
* "openid":"OPENID",
* "nickname":"NICKNAME",
* "sex":1,
* "province":"PROVINCE",
* "city":"CITY",
* "country":"COUNTRY",
* "headimgurl": "https://thirdwx.qlogo.cn/mmopen/g3MonUZtNHkdmzicIlibx6iaFqAc56vxLSUfpb6n5WKSYVY0ChQKkiaJSgQ1dZuTOgvLLrhJbERQQ4eMsv84eavHiaiceqxibJxCfHe/0",
* "privilege":[
* "PRIVILEGE1",
* "PRIVILEGE2"
* ],
* "unionid": " o6_bmasdasdsad6_2sgVt7hMZOPfL"
*
* }
* </pre>
*
* @author YuCheng
*/
@Data
public class WeChatOAuth2UserInfo implements Serializable {
private static final long serialVersionUID = 3181943506448954725L;
@JsonProperty("openid")
private String openid;
@JsonProperty("nickname")
private String nickname;
@JsonProperty("sex")
private Integer sex;
@JsonProperty("city")
private String city;
@JsonProperty("province")
private String province;
@JsonProperty("country")
private String country;
@JsonProperty("headimgurl")
private String headImgUrl;
@JsonProperty("unionid")
private String unionId;
@JsonProperty("privilege")
private String[] privileges;
public String getOpenid() {
return openid;
}
public void setOpenid(String openid) {
this.openid = openid;
}
public String getNickname() {
return nickname;
}
public void setNickname(String nickname) {
this.nickname = nickname;
}
public Integer getSex() {
return sex;
}
public void setSex(Integer sex) {
this.sex = sex;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getProvince() {
return province;
}
public void setProvince(String province) {
this.province = province;
}
public String getCountry() {
return country;
}
public void setCountry(String country) {
this.country = country;
}
public String getHeadImgUrl() {
return headImgUrl;
}
public void setHeadImgUrl(String headImgUrl) {
this.headImgUrl = headImgUrl;
}
public String getUnionId() {
return unionId;
}
public void setUnionId(String unionId) {
this.unionId = unionId;
}
public String[] getPrivileges() {
return privileges;
}
public void setPrivileges(String[] privileges) {
this.privileges = privileges;
}
}

View File

@ -0,0 +1,31 @@
package com.ossez.wechat.common.model.entity;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* WeChatAccessToken Response Object
*
* @author YuCheng Hu
*/
public class WeChatResponseStatus {
@JsonProperty("errcode")
private Integer errorCode;
@JsonProperty("errmsg")
private String errorMsg;
public Integer getErrorCode() {
return errorCode;
}
public void setErrorCode(Integer errorCode) {
this.errorCode = errorCode;
}
public String getErrorMsg() {
return errorMsg;
}
public void setErrorMsg(String errorMsg) {
this.errorMsg = errorMsg;
}
}

View File

@ -0,0 +1,104 @@
package com.ossez.wechat.common.model.entity;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.experimental.Accessors;
@Accessors(chain = true)
public class WeChatUser {
@JsonProperty(value = "openid", required = true)
private String openId;
@JsonProperty(required = true)
private String nickname;
private Integer sex;
private String language;
private String city;
private String province;
private String country;
@JsonProperty(value = "headimgurl")
private String headImgURL;
@JsonProperty(value = "unionid", required = true)
private String unionId;
public String getOpenId() {
return openId;
}
public void setOpenId(String openId) {
this.openId = openId;
}
public String getNickname() {
return nickname;
}
public void setNickname(String nickname) {
this.nickname = nickname;
}
public Integer getSex() {
return sex;
}
public void setSex(Integer sex) {
this.sex = sex;
}
public String getLanguage() {
return language;
}
public void setLanguage(String language) {
this.language = language;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getProvince() {
return province;
}
public void setProvince(String province) {
this.province = province;
}
public String getCountry() {
return country;
}
public void setCountry(String country) {
this.country = country;
}
public String getHeadImgURL() {
return headImgURL;
}
public void setHeadImgURL(String headImgURL) {
this.headImgURL = headImgURL;
}
public String getUnionId() {
return unionId;
}
public void setUnionId(String unionId) {
this.unionId = unionId;
}
}

View File

@ -0,0 +1,43 @@
package com.ossez.wechat.common.model.entity.builder;
import com.ossez.wechat.common.model.entity.menu.MenuButton;
import com.ossez.wechat.common.model.req.MenuRequest;
import java.util.List;
public class MenuButtonBuilder {
private List<MenuButton> subButtonList;
private String type;
private String name;
private String key;
private String url;
public MenuButtonBuilder setSubButtonList(List<MenuButton> subButtonList) {
this.subButtonList = subButtonList;
return this;
}
public MenuButtonBuilder setType(String type) {
this.type = type;
return this;
}
public MenuButtonBuilder setName(String name) {
this.name = name;
return this;
}
public MenuButtonBuilder setKey(String key) {
this.key = key;
return this;
}
public MenuButtonBuilder setUrl(String url) {
this.url = url;
return this;
}
public MenuButton createMenuButton() {
return new MenuButton(subButtonList, type, name, key, url);
}
}

View File

@ -0,0 +1,40 @@
package com.ossez.wechat.common.model.entity.menu;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.gson.annotations.SerializedName;
import com.ossez.wechat.common.model.req.MenuRequest;
import com.ossez.wechat.common.util.json.WxGsonBuilder;
import lombok.Data;
/**
* menu button.
*
* @author Daniel Qian
*/
@Data
public class MenuButton implements Serializable {
private static final long serialVersionUID = -1070939403109776555L;
public MenuButton(List<MenuButton> subButtonList, String type, String name, String key, String url) {
this.subButtonList = subButtonList;
this.type = type;
this.name = name;
this.key = key;
this.url = url;
}
@JsonProperty(value = "sub_button")
private List<MenuButton> subButtonList;
@JsonProperty("type")
private String type;
@JsonProperty("name")
private String name;
@JsonProperty("key")
private String key;
@JsonProperty("url")
private String url;
}

View File

@ -1,4 +1,4 @@
package me.chanjar.weixin.common.bean.menu;
package com.ossez.wechat.common.model.entity.menu;
import java.io.InputStream;
import java.io.InputStreamReader;
@ -7,8 +7,8 @@ import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;
import com.ossez.wechat.common.util.json.WxGsonBuilder;
import lombok.Data;
import me.chanjar.weixin.common.util.json.WxGsonBuilder;
/**
* 菜单公众号和企业号共用的.
@ -19,13 +19,16 @@ import me.chanjar.weixin.common.util.json.WxGsonBuilder;
public class WxMenu implements Serializable {
private static final long serialVersionUID = -7083914585539687746L;
private List<WxMenuButton> buttons = new ArrayList<>();
private List<MenuButton> buttons = new ArrayList<>();
private WxMenuRule matchRule;
/**
* 要用 http://mp.weixin.qq.com/wiki/16/ff9b7b85220e1396ffa16794a9d95adc.html 格式来反序列化
* 相比 http://mp.weixin.qq.com/wiki/13/43de8269be54a0a6f64413e4dfa94f39.html 的格式外层多套了一个menu
*
* @param json
* @return
*/
public static WxMenu fromJson(String json) {
return WxGsonBuilder.create().fromJson(json, WxMenu.class);

View File

@ -1,10 +1,10 @@
package me.chanjar.weixin.common.bean.menu;
package com.ossez.wechat.common.model.entity.menu;
import java.io.Serializable;
import com.google.gson.annotations.SerializedName;
import com.ossez.wechat.common.util.json.WxGsonBuilder;
import lombok.Data;
import me.chanjar.weixin.common.util.json.WxGsonBuilder;
/**
* menu rule.

View File

@ -0,0 +1,128 @@
package com.ossez.wechat.common.model.req;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.gson.annotations.SerializedName;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import java.io.Serializable;
/**
* CustomMessage
*
* @author YuCheng
*/
public class CustomMessage implements Serializable {
private static final long serialVersionUID = -9196732086954365246L;
@JsonProperty("touser")
private String toUser;
@JsonProperty("msgtype")
private String msgType;
@JsonProperty("text")
private KfText text;
@JsonProperty("image")
private KfImage image;
@JsonProperty("link")
private KfLink link;
@JsonProperty("miniprogrampage")
private KfMaPage maPage;
@Data
@AllArgsConstructor
public static class KfText implements Serializable {
private static final long serialVersionUID = 151122958720941270L;
private String content;
}
@Data
@AllArgsConstructor
public static class KfImage implements Serializable {
private static final long serialVersionUID = -5409342945117300782L;
@SerializedName("media_id")
private String mediaId;
}
@Data
@Builder
public static class KfLink implements Serializable {
private static final long serialVersionUID = -6728776817556127413L;
private String title;
private String description;
private String url;
@SerializedName("thumb_url")
private String thumbUrl;
}
@Data
@Builder
public static class KfMaPage implements Serializable {
private static final long serialVersionUID = -5633492281871634466L;
private String title;
@SerializedName("pagepath")
private String pagePath;
@SerializedName("thumb_media_id")
private String thumbMediaId;
}
public String getToUser() {
return toUser;
}
public void setToUser(String toUser) {
this.toUser = toUser;
}
public String getMsgType() {
return msgType;
}
public void setMsgType(String msgType) {
this.msgType = msgType;
}
public KfText getText() {
return text;
}
public void setText(KfText text) {
this.text = text;
}
public KfImage getImage() {
return image;
}
public void setImage(KfImage image) {
this.image = image;
}
public KfLink getLink() {
return link;
}
public void setLink(KfLink link) {
this.link = link;
}
public KfMaPage getMaPage() {
return maPage;
}
public void setMaPage(KfMaPage maPage) {
this.maPage = maPage;
}
}

View File

@ -0,0 +1,40 @@
package com.ossez.wechat.common.model.req;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.gson.annotations.SerializedName;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import java.io.Serializable;
/**
* CustomMessage
*
* @author YuCheng
*/
public class DataCubeRequest implements Serializable {
private static final long serialVersionUID = -9196732086954365246L;
@JsonProperty(value = "begin_date", required = true)
private String beginDate;
@JsonProperty(value = "end_date", required = true)
private String endDate;
public String getBeginDate() {
return beginDate;
}
public void setBeginDate(String beginDate) {
this.beginDate = beginDate;
}
public String getEndDate() {
return endDate;
}
public void setEndDate(String endDate) {
this.endDate = endDate;
}
}

View File

@ -0,0 +1,28 @@
package com.ossez.wechat.common.model.req;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.ossez.wechat.common.model.entity.menu.MenuButton;
import com.ossez.wechat.common.model.res.DataCubeArticle;
import java.io.Serializable;
import java.util.List;
/**
* CustomMessage
*
* @author YuCheng
*/
public class MenuRequest implements Serializable {
private static final long serialVersionUID = -9196732086954365246L;
@JsonProperty(value = "button", required = true)
private List<MenuButton> buttonList;
public List<MenuButton> getButtonList() {
return buttonList;
}
public void setButtonList(List<MenuButton> buttonList) {
this.buttonList = buttonList;
}
}

View File

@ -0,0 +1,33 @@
package com.ossez.wechat.common.model.req;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.ossez.wechat.common.util.json.WxGsonBuilder;
import org.apache.commons.lang3.StringUtils;
/**
* WeChatAccessToken Response Object
*
* @author YuCheng Hu
*/
public class NetworkCheck {
@JsonProperty("action")
private String action = "all";
@JsonProperty("check_operator")
private String checkOperator = StringUtils.upperCase("DEFAULT");
public String getAction() {
return action;
}
public void setAction(String action) {
this.action = action;
}
public String getCheckOperator() {
return checkOperator;
}
public void setCheckOperator(String checkOperator) {
this.checkOperator = checkOperator;
}
}

View File

@ -0,0 +1,22 @@
package com.ossez.wechat.common.model.req;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.apache.commons.lang3.StringUtils;
/**
* WeChatAccessToken Response Object
*
* @author YuCheng Hu
*/
public class QueryQuota {
@JsonProperty("cgi_path")
private String cgiPath = "/cgi-bin/message/custom/send";
public String getCgiPath() {
return cgiPath;
}
public void setCgiPath(String cgiPath) {
this.cgiPath = cgiPath;
}
}

View File

@ -0,0 +1,130 @@
package com.ossez.wechat.common.model.res;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
/**
* UserSummaryResponse Object
*
* @author YuCheng Hu
*/
public class DataCubeArticle {
@JsonProperty("list")
private List<ArticleData> articleDataList;
public static class ArticleData {
@JsonProperty("ref_date")
private String refDate;
@JsonProperty("msgid")
private String msgId;
@JsonProperty("title")
private String title;
@JsonProperty("int_page_read_user")
private Long intPageReadUser;
@JsonProperty("ori_page_read_user")
private Long oriPageReadUser;
@JsonProperty("ori_page_read_count")
private Long oriPageReadCount;
@JsonProperty("share_user")
private Long shareUser;
@JsonProperty("shareCount")
private Long shareCount;
@JsonProperty("add_to_fav_user")
private Long addToFavUser;
@JsonProperty("add_to_fav_count")
private Long addToFavCount;
public String getRefDate() {
return refDate;
}
public void setRefDate(String refDate) {
this.refDate = refDate;
}
public String getMsgId() {
return msgId;
}
public void setMsgId(String msgId) {
this.msgId = msgId;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public Long getIntPageReadUser() {
return intPageReadUser;
}
public void setIntPageReadUser(Long intPageReadUser) {
this.intPageReadUser = intPageReadUser;
}
public Long getOriPageReadUser() {
return oriPageReadUser;
}
public void setOriPageReadUser(Long oriPageReadUser) {
this.oriPageReadUser = oriPageReadUser;
}
public Long getOriPageReadCount() {
return oriPageReadCount;
}
public void setOriPageReadCount(Long oriPageReadCount) {
this.oriPageReadCount = oriPageReadCount;
}
public Long getShareUser() {
return shareUser;
}
public void setShareUser(Long shareUser) {
this.shareUser = shareUser;
}
public Long getShareCount() {
return shareCount;
}
public void setShareCount(Long shareCount) {
this.shareCount = shareCount;
}
public Long getAddToFavUser() {
return addToFavUser;
}
public void setAddToFavUser(Long addToFavUser) {
this.addToFavUser = addToFavUser;
}
public Long getAddToFavCount() {
return addToFavCount;
}
public void setAddToFavCount(Long addToFavCount) {
this.addToFavCount = addToFavCount;
}
}
public List<ArticleData> getArticleDataList() {
return articleDataList;
}
public void setArticleDataList(List<ArticleData> articleDataList) {
this.articleDataList = articleDataList;
}
}

View File

@ -0,0 +1,78 @@
package com.ossez.wechat.common.model.res;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
/**
* UserSummaryResponse Object
*
* @author YuCheng Hu
*/
public class DataCubeUser {
@JsonProperty("list")
private List<UserData> userDataList;
public static class UserData {
@JsonProperty("ref_date")
private String refDate;
@JsonProperty("user_source")
private Long userSource;
@JsonProperty("new_user")
private Long newUser;
@JsonProperty("cancel_user")
private Long cancelUser;
@JsonProperty("cumulate_user")
private Long cumulateUser;
public String getRefDate() {
return refDate;
}
public void setRefDate(String refDate) {
this.refDate = refDate;
}
public Long getUserSource() {
return userSource;
}
public void setUserSource(Long userSource) {
this.userSource = userSource;
}
public Long getNewUser() {
return newUser;
}
public void setNewUser(Long newUser) {
this.newUser = newUser;
}
public Long getCancelUser() {
return cancelUser;
}
public void setCancelUser(Long cancelUser) {
this.cancelUser = cancelUser;
}
public Long getCumulateUser() {
return cumulateUser;
}
public void setCumulateUser(Long cumulateUser) {
this.cumulateUser = cumulateUser;
}
}
public List<UserData> getUserDataList() {
return userDataList;
}
public void setUserDataList(List<UserData> userDataList) {
this.userDataList = userDataList;
}
}

View File

@ -0,0 +1,35 @@
package com.ossez.wechat.common.model.res;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.ossez.wechat.common.api.WxMessageInMemoryDuplicateCheckerSingleton;
import org.apache.commons.lang3.StringUtils;
/**
* WeChatAccessToken Response Object
*
* @author YuCheng Hu
*/
public class NetworkCheckResponse {
@JsonProperty("dns")
private String dns;
@JsonProperty("ping")
private Ping ping;
private static class dns {
@JsonProperty("ip")
private String ip;
@JsonProperty("real_operator")
private String realOperator;
}
private static class Ping {
@JsonProperty("ip")
private String ip;
@JsonProperty("from_operator")
private String fromOperator;
@JsonProperty("package_loss")
private String packageLoss;
@JsonProperty("time")
private String time;
}
}

View File

@ -0,0 +1,66 @@
package com.ossez.wechat.common.model.res;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* WeChatAccessToken Response Object
*
* @author YuCheng Hu
*/
public class QueryQuotaResponse {
@JsonProperty("errcode")
private Integer errorCode;
@JsonProperty("errmsg")
private String errorMsg;
@JsonProperty("quota")
private Quota quota;
private static class Quota {
@JsonProperty("daily_limit")
private String dailyLimit;
@JsonProperty("used")
private String used;
@JsonProperty("remain")
private String remain;
public String getDailyLimit() {
return dailyLimit;
}
public void setDailyLimit(String dailyLimit) {
this.dailyLimit = dailyLimit;
}
public String getUsed() {
return used;
}
public void setUsed(String used) {
this.used = used;
}
public String getRemain() {
return remain;
}
public void setRemain(String remain) {
this.remain = remain;
}
}
public Integer getErrorCode() {
return errorCode;
}
public void setErrorCode(Integer errorCode) {
this.errorCode = errorCode;
}
public String getErrorMsg() {
return errorMsg;
}
public void setErrorMsg(String errorMsg) {
this.errorMsg = errorMsg;
}
}

View File

@ -1,4 +1,4 @@
package me.chanjar.weixin.common.redis;
package com.ossez.wechat.common.redis;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.Lock;

View File

@ -1,8 +1,8 @@
package me.chanjar.weixin.common.redis;
package com.ossez.wechat.common.redis;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;
import me.chanjar.weixin.common.util.locks.RedisTemplateSimpleDistributedLock;
import com.ossez.wechat.common.util.locks.RedisTemplateSimpleDistributedLock;
import org.springframework.data.redis.core.StringRedisTemplate;
import java.util.concurrent.TimeUnit;

View File

@ -1,4 +1,4 @@
package me.chanjar.weixin.common.redis;
package com.ossez.wechat.common.redis;
import lombok.RequiredArgsConstructor;
import org.redisson.api.RedissonClient;

View File

@ -1,4 +1,4 @@
package me.chanjar.weixin.common.redis;
package com.ossez.wechat.common.redis;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.Lock;
@ -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

@ -1,10 +1,10 @@
package me.chanjar.weixin.common.requestexecuter.ocr;
package com.ossez.wechat.common.requestexecuter.ocr;
import me.chanjar.weixin.common.enums.WxType;
import me.chanjar.weixin.common.error.WxError;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.common.util.http.RequestHttp;
import me.chanjar.weixin.common.util.http.apache.Utf8ResponseHandler;
import com.ossez.wechat.common.enums.WxType;
import com.ossez.wechat.common.exception.WxError;
import com.ossez.wechat.common.exception.WxErrorException;
import com.ossez.wechat.common.util.http.RequestHttp;
import com.ossez.wechat.common.util.http.apache.Utf8ResponseHandler;
import org.apache.http.HttpEntity;
import org.apache.http.HttpHost;
import org.apache.http.client.config.RequestConfig;
@ -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

@ -1,10 +1,10 @@
package me.chanjar.weixin.common.requestexecuter.ocr;
package com.ossez.wechat.common.requestexecuter.ocr;
import me.chanjar.weixin.common.enums.WxType;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.common.util.http.RequestExecutor;
import me.chanjar.weixin.common.util.http.RequestHttp;
import me.chanjar.weixin.common.util.http.ResponseHandler;
import com.ossez.wechat.common.enums.WxType;
import com.ossez.wechat.common.exception.WxErrorException;
import com.ossez.wechat.common.util.http.RequestExecutor;
import com.ossez.wechat.common.util.http.RequestHttp;
import com.ossez.wechat.common.util.http.ResponseHandler;
import java.io.File;
import java.io.IOException;
@ -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

@ -1,9 +1,9 @@
package me.chanjar.weixin.common.service;
package com.ossez.wechat.common.service;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.common.bean.imgproc.WxImgProcAiCropResult;
import me.chanjar.weixin.common.bean.imgproc.WxImgProcQrCodeResult;
import me.chanjar.weixin.common.bean.imgproc.WxImgProcSuperResolutionResult;
import com.ossez.wechat.common.exception.WxErrorException;
import com.ossez.wechat.common.bean.imgproc.WxImgProcAiCropResult;
import com.ossez.wechat.common.bean.imgproc.WxImgProcQrCodeResult;
import com.ossez.wechat.common.bean.imgproc.WxImgProcSuperResolutionResult;
import java.io.File;

View File

@ -1,14 +1,14 @@
package me.chanjar.weixin.common.service;
package com.ossez.wechat.common.service;
import me.chanjar.weixin.common.bean.WxOAuth2UserInfo;
import me.chanjar.weixin.common.bean.oauth2.WxOAuth2AccessToken;
import me.chanjar.weixin.common.error.WxErrorException;
import com.ossez.wechat.common.model.entity.WeChatOAuth2UserInfo;
import com.ossez.wechat.common.model.WeChatOAuth2AccessToken;
import com.ossez.wechat.common.exception.WxErrorException;
/**
* oauth2 相关接口.
*
* @author <a href="https://github.com/binarywang">Binary Wang</a>
* @date 2020-08-08
* created on 2020-08-08
*/
public interface WxOAuth2Service {
/**
@ -34,7 +34,7 @@ public interface WxOAuth2Service {
* @return token对象
* @throws WxErrorException .
*/
WxOAuth2AccessToken getAccessToken(String code) throws WxErrorException;
WeChatOAuth2AccessToken getAccessToken(String code) throws WxErrorException;
/**
* 用code换取oauth2的access token.
@ -45,7 +45,7 @@ public interface WxOAuth2Service {
* @return token对象
* @throws WxErrorException .
*/
WxOAuth2AccessToken getAccessToken(String appId, String appSecret, String code) throws WxErrorException;
WeChatOAuth2AccessToken getAccessToken(String appId, String appSecret, String code) throws WxErrorException;
/**
* <pre>
@ -56,7 +56,7 @@ public interface WxOAuth2Service {
* @return 新的token对象
* @throws WxErrorException .
*/
WxOAuth2AccessToken refreshAccessToken(String refreshToken) throws WxErrorException;
WeChatOAuth2AccessToken refreshAccessToken(String refreshToken) throws WxErrorException;
/**
* <pre>
@ -68,7 +68,7 @@ public interface WxOAuth2Service {
* @return 用户对象
* @throws WxErrorException .
*/
WxOAuth2UserInfo getUserInfo(WxOAuth2AccessToken oAuth2AccessToken, String lang) throws WxErrorException;
WeChatOAuth2UserInfo getUserInfo(WeChatOAuth2AccessToken oAuth2AccessToken, String lang) throws WxErrorException;
/**
* <pre>
@ -78,6 +78,6 @@ public interface WxOAuth2Service {
* @param oAuth2AccessToken token对象
* @return 是否有效
*/
boolean validateAccessToken(WxOAuth2AccessToken oAuth2AccessToken);
boolean validateAccessToken(WeChatOAuth2AccessToken oAuth2AccessToken);
}

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