-
-
-
- |
- ||
-
-
-
- |
- ||
-
-
-
- |
-
-
-
-
- |
-
-
-
-
- |
-
+-
+
+> 赞助商招募中,欢迎联系合作。
+
+### 关注公众号
+想获得技术交流群(QQ群/微信群/钉钉群)等信息,请扫码关注 `WxJava` 公众号:
+
+[](https://mp.weixin.qq.com/mp/homepage?__biz=MzI3MzAwMzk4OA==&hid=1&sn=f31af3bf562b116b061c9ab4edf70b61&scene=18#wechat_redirect)
+
+### 目录索引
+- [快速开始(3分钟)](#快速开始3分钟)
+- [AI 编程智能体 SKILL 安装](#ai-编程智能体-skill-安装)
+- [我该选哪个模块?](#我该选哪个模块)
+- [Maven 引用方式](#maven-引用方式)
+- [最小示例](#最小示例)
+- [重要信息](#重要信息)
+- [其他说明](#其他说明)
+- [版本说明](#版本说明)
+- [应用案例](#应用案例)
+- [特别赞助](#特别赞助)
+- [关注公众号](#关注公众号)
+- [贡献者列表](#贡献者列表)
+
+### 快速开始(3分钟)
+1. 根据业务场景选择模块(见下方“我该选哪个模块?”)
+2. 引入 Maven 依赖并选择对应模块
+3. 参考最小示例完成初始化并调用 API
+
+### AI 编程智能体 SKILL 安装
+
+仓库的 [`skills`](skills) 目录提供面向 WxJava 用户和贡献者的通用 SKILL,包括模块选择、接入、排障、接口贡献和升级迁移。每个 SKILL 都以 `SKILL.md` 为入口,可用于支持该约定的 AI 编程智能体。
+
+支持远程安装 SKILL 的智能体,可以直接使用自然语言指令安装所需目录。例如:
+
+> 安装 https://github.com/binarywang/WxJava/tree/develop/skills/wxjava-integration-guide 中的技能。
+
+可安装的 SKILL 包括:
+
+- [模块选择](https://github.com/binarywang/WxJava/tree/develop/skills/wxjava-module-selector)
+- [接入指南](https://github.com/binarywang/WxJava/tree/develop/skills/wxjava-integration-guide)
+- [故障排查](https://github.com/binarywang/WxJava/tree/develop/skills/wxjava-troubleshooter)
+- [接口贡献](https://github.com/binarywang/WxJava/tree/develop/skills/wxjava-api-contributor)
+- [升级迁移](https://github.com/binarywang/WxJava/tree/develop/skills/wxjava-upgrade-guide)
+
+不支持远程安装时,可将所需的 `skills/wxjava-*` 目录复制到智能体的 SKILL 目录或工作区配置目录;不同智能体的目录和启用方式请以其官方文档为准。
+
+以 Codex 为例,可复制到个人 SKILL 目录:
+
+```shell
+git clone https://github.com/binarywang/WxJava.git
+mkdir -p "${CODEX_HOME:-$HOME/.codex}/skills"
+cp -R WxJava/skills/wxjava-* "${CODEX_HOME:-$HOME/.codex}/skills/"
+```
+
+如果已在本仓库根目录,可直接执行:
+
+```shell
+mkdir -p "${CODEX_HOME:-$HOME/.codex}/skills"
+cp -R skills/wxjava-* "${CODEX_HOME:-$HOME/.codex}/skills/"
+```
+
+重启或新建智能体会话后,即可按需使用。例如:`使用 wxjava-integration-guide 为我的 Spring Boot 项目接入微信支付。`
+
+### 我该选哪个模块?
+
+| 业务场景 | 模块 | artifactId |
+|---|---|---|
+| 微信公众号开发 | MP | `weixin-java-mp` |
+| 微信小程序开发 | MiniApp | `weixin-java-miniapp` |
+| 微信支付 | Pay | `weixin-java-pay` |
+| 企业微信 | CP | `weixin-java-cp` |
+| 微信开放平台(第三方平台) | Open | `weixin-java-open` |
+| 视频号 / 微信小店 | Channel | `weixin-java-channel` |
+
+> 移动端(iOS/Android)微信登录、分享等能力仍需集成微信官方客户端 SDK;本项目为服务端 SDK。
### 重要信息
-1. 项目合作洽谈请联系微信`binary0000`(在微信里自行搜索并添加好友,请注明来意,如有关于SDK问题需讨论请参考下文入群讨论,不要加此微信)。
-2. **2023-4-23 发布 [【4.5.0正式版】](https://mp.weixin.qq.com/s/4ZYKJnIwP9YNDvbyOhW_3A)**!
-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
+1. [`WxJava` 荣获 `GitCode` 2024年度十大开源社区奖项](https://mp.weixin.qq.com/s/wM_UlMsDm3IZ1CPPDvcvQw)。
+2. 项目合作洽谈请联系微信`binary0000`(在微信里自行搜索并添加好友,请注明来意,如有关于SDK问题需讨论请参考下文入群讨论,不要加此微信)。
+3. **2026-01-03 发布 [【4.8.0正式版】](https://mp.weixin.qq.com/s/mJoFtGc25pXCn3uZRh6Q-w)**!
+5. 贡献源码可以参考视频:[【贡献源码全过程(上集)】](https://mp.weixin.qq.com/s/3xUZSATWwHR_gZZm207h7Q)、[【贡献源码全过程(下集)】](https://mp.weixin.qq.com/s/nyzJwVVoYSJ4hSbwyvTx9A) ,友情提供:[程序员小山与Bug](https://space.bilibili.com/473631007)
+6. 新手重要提示:本项目仅是一个SDK开发工具包,未提供Web实现,建议使用 `maven` 或 `gradle` 引用本项目即可使用本SDK提供的各种功能,详情可参考 **[【Demo项目】](demo.md)** 或本项目中的部分单元测试代码;
+7. 微信开发新手请务必阅读【开发文档】([Gitee Wiki](https://gitee.com/binary/weixin-java-tools/wikis/Home) 或者 [Github Wiki](https://github.com/binarywang/WxJava/wiki))的常见问题部分,可以少走很多弯路,节省不少时间。
+8. 技术交流群:想获得QQ群/微信群/钉钉企业群等信息的同学,请使用微信扫描上面的微信公众号二维码关注 `WxJava` 后点击相关菜单即可获取加入方式,同时也可以在微信中搜索 `weixin-java-tools` 或 `WxJava` 后选择正确的公众号进行关注,该公众号会及时通知SDK相关更新信息,并不定期分享微信Java开发相关技术知识;
+9. 钉钉技术交流群:`32206329`(技术交流2群), `30294972`(技术交流1群,目前已满),`35724728`(通知群,实时通知Github项目变更记录)。
+10. 微信开发新手或者Java开发新手在群内提问或新开Issue提问前,请先阅读[【提问的智慧】](https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way/blob/master/README-zh_CN.md),并确保已查阅过 [【开发文档Wiki】](https://github.com/binarywang/WxJava/wiki) ,避免浪费大家的宝贵时间;
+11. 寻求帮助时需贴代码或大长串异常信息的,请利用 http://paste.ubuntu.com
--------------------------------
### 其他说明
1. **阅读源码的同学请注意,本SDK为简化代码编译时加入了`lombok`支持,如果不了解`lombok`的话,请先学习下相关知识,比如可以阅读[此文章](https://mp.weixin.qq.com/s/cUc-bUcprycADfNepnSwZQ);**
-2. 如有新功能需求,发现BUG,或者由于微信官方接口调整导致的代码问题,可以直接在[【Issues】](https://github.com/Wechat-Group/WxJava/issues)页提出issue,便于讨论追踪问题;
+2. 如有新功能需求,发现BUG,或者由于微信官方接口调整导致的代码问题,可以直接在[【Issues】](https://github.com/binarywang/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),部分文档可能未能及时更新,如有发现,可以及时上报或者自行修改。
+6. SDK开发文档请查阅 [【开发文档Wiki】](https://github.com/binarywang/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
-* GitHub:https://github.com/wechat-group/WxJava
+* GitHub:https://github.com/binarywang/WxJava
---------------------------------
### Maven 引用方式
-注意:最新版本(包括测试版)为 [](http://mvnrepository.com/artifact/com.github.binarywang/wx-java),以下为最新正式版。
+注意:最新版本(包括测试版)为 [](https://central.sonatype.com/artifact/com.github.binarywang/wx-java/versions),以下为最新正式版。
+
+#### 方式一:使用 BOM 统一管理版本(推荐)
+
+如果同时使用多个 WxJava 模块,推荐通过 BOM 统一管理版本,无需为每个模块单独指定版本号。
+`wx-java-bom` 从 **4.8.3.B** 版本开始提供,请使用该版本或更高版本:
+
+```xml
+{@link me.chanjar.weixin.channel.api.WxChannelService#setMaxRetryTimes(int)}
+ *{@link me.chanjar.weixin.channel.api.impl.BaseWxChannelServiceImpl#setMaxRetryTimes(int)}
+ */ + private int maxRetryTimes = 5; + + /** + * http 请求重试间隔 + * + *{@link me.chanjar.weixin.channel.api.WxChannelService#setRetrySleepMillis(int)}
+ *{@link me.chanjar.weixin.channel.api.impl.BaseWxChannelServiceImpl#setRetrySleepMillis(int)}
+ */ + private int retrySleepMillis = 1000; + } +} diff --git a/solon-plugins/wx-java-channel-multi-solon-plugin/src/main/java/com/binarywang/solon/wxjava/channel/properties/WxChannelMultiRedisProperties.java b/solon-plugins/wx-java-channel-multi-solon-plugin/src/main/java/com/binarywang/solon/wxjava/channel/properties/WxChannelMultiRedisProperties.java new file mode 100644 index 0000000000..36c649b311 --- /dev/null +++ b/solon-plugins/wx-java-channel-multi-solon-plugin/src/main/java/com/binarywang/solon/wxjava/channel/properties/WxChannelMultiRedisProperties.java @@ -0,0 +1,63 @@ +package com.binarywang.solon.wxjava.channel.properties; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * Redis配置 + * + * @author Winnie + * @date 2024/9/13 + */ +@Data +@NoArgsConstructor +public class WxChannelMultiRedisProperties implements Serializable { + private static final long serialVersionUID = 9061055444734277357L; + + /** + * 主机地址. + */ + private String host = "127.0.0.1"; + + /** + * 端口号. + */ + private int port = 6379; + + /** + * 密码. + */ + private String password; + + /** + * 超时. + */ + private int timeout = 2000; + + /** + * 数据库. + */ + private int database = 0; + + /** + * 最大活动连接数 + */ + private Integer maxActive; + + /** + * 最大空闲连接数 + */ + private Integer maxIdle; + + /** + * 最小空闲连接数 + */ + private Integer minIdle; + + /** + * 最大等待时间 + */ + private Integer maxWaitMillis; +} diff --git a/solon-plugins/wx-java-channel-multi-solon-plugin/src/main/java/com/binarywang/solon/wxjava/channel/properties/WxChannelSingleProperties.java b/solon-plugins/wx-java-channel-multi-solon-plugin/src/main/java/com/binarywang/solon/wxjava/channel/properties/WxChannelSingleProperties.java new file mode 100644 index 0000000000..438c3ecb03 --- /dev/null +++ b/solon-plugins/wx-java-channel-multi-solon-plugin/src/main/java/com/binarywang/solon/wxjava/channel/properties/WxChannelSingleProperties.java @@ -0,0 +1,43 @@ +package com.binarywang.solon.wxjava.channel.properties; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * 微信视频号相关配置属性 + * + * @author Winnie + * @date 2024/9/13 + */ +@Data +@NoArgsConstructor +public class WxChannelSingleProperties implements Serializable { + private static final long serialVersionUID = 5306630351265124825L; + + /** + * 设置微信视频号的 appid. + */ + private String appId; + + /** + * 设置微信视频号的 secret. + */ + private String secret; + + /** + * 设置微信视频号的 token. + */ + private String token; + + /** + * 设置微信视频号的 EncodingAESKey. + */ + private String aesKey; + + /** + * 是否使用稳定版 Access Token + */ + private boolean useStableAccessToken = false; +} diff --git a/solon-plugins/wx-java-channel-multi-solon-plugin/src/main/java/com/binarywang/solon/wxjava/channel/service/WxChannelMultiServices.java b/solon-plugins/wx-java-channel-multi-solon-plugin/src/main/java/com/binarywang/solon/wxjava/channel/service/WxChannelMultiServices.java new file mode 100644 index 0000000000..f12461e197 --- /dev/null +++ b/solon-plugins/wx-java-channel-multi-solon-plugin/src/main/java/com/binarywang/solon/wxjava/channel/service/WxChannelMultiServices.java @@ -0,0 +1,26 @@ +package com.binarywang.solon.wxjava.channel.service; + +import me.chanjar.weixin.channel.api.WxChannelService; + +/** + * 视频号 {@link WxChannelService} 所有实例存放类. + * + * @author Winnie + * @date 2024/9/13 + */ +public interface WxChannelMultiServices { + /** + * 通过租户 Id 获取 WxChannelService + * + * @param tenantId 租户 Id + * @return WxChannelService + */ + WxChannelService getWxChannelService(String tenantId); + + /** + * 根据租户 Id,从列表中移除一个 WxChannelService 实例 + * + * @param tenantId 租户 Id + */ + void removeWxChannelService(String tenantId); +} diff --git a/solon-plugins/wx-java-channel-multi-solon-plugin/src/main/java/com/binarywang/solon/wxjava/channel/service/WxChannelMultiServicesImpl.java b/solon-plugins/wx-java-channel-multi-solon-plugin/src/main/java/com/binarywang/solon/wxjava/channel/service/WxChannelMultiServicesImpl.java new file mode 100644 index 0000000000..8420e29d73 --- /dev/null +++ b/solon-plugins/wx-java-channel-multi-solon-plugin/src/main/java/com/binarywang/solon/wxjava/channel/service/WxChannelMultiServicesImpl.java @@ -0,0 +1,36 @@ +package com.binarywang.solon.wxjava.channel.service; + +import me.chanjar.weixin.channel.api.WxChannelService; + +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +/** + * 视频号 {@link WxChannelMultiServices} 实现 + * + * @author Winnie + * @date 2024/9/13 + */ +public class WxChannelMultiServicesImpl implements WxChannelMultiServices { + private final Map
+ * {@link me.chanjar.weixin.channel.api.BaseWxChannelService#setRetrySleepMillis(int)}
+ *
+ */
+ private int retrySleepMillis = 1000;
+ /**
+ * http 请求最大重试次数
+ *
+ * {@link me.chanjar.weixin.channel.api.BaseWxChannelService#setMaxRetryTimes(int)}
+ *
+ */
+ private int maxRetryTimes = 5;
+ }
+
+}
diff --git a/solon-plugins/wx-java-channel-solon-plugin/src/main/resources/META-INF/solon/wx-java-channel-solon-plugin.properties b/solon-plugins/wx-java-channel-solon-plugin/src/main/resources/META-INF/solon/wx-java-channel-solon-plugin.properties
new file mode 100644
index 0000000000..d8ec8f5112
--- /dev/null
+++ b/solon-plugins/wx-java-channel-solon-plugin/src/main/resources/META-INF/solon/wx-java-channel-solon-plugin.properties
@@ -0,0 +1,2 @@
+solon.plugin=com.binarywang.solon.wxjava.channel.integration.WxChannelPluginImpl
+solon.plugin.priority=10
diff --git a/solon-plugins/wx-java-channel-solon-plugin/src/test/java/features/test/LoadTest.java b/solon-plugins/wx-java-channel-solon-plugin/src/test/java/features/test/LoadTest.java
new file mode 100644
index 0000000000..d049f5a51a
--- /dev/null
+++ b/solon-plugins/wx-java-channel-solon-plugin/src/test/java/features/test/LoadTest.java
@@ -0,0 +1,15 @@
+package features.test;
+
+import org.junit.jupiter.api.Test;
+import org.noear.solon.test.SolonTest;
+
+/**
+ * @author noear 2024/9/4 created
+ */
+@SolonTest
+public class LoadTest {
+ @Test
+ public void load(){
+
+ }
+}
diff --git a/solon-plugins/wx-java-channel-solon-plugin/src/test/resources/app.yml b/solon-plugins/wx-java-channel-solon-plugin/src/test/resources/app.yml
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/solon-plugins/wx-java-cp-multi-solon-plugin/README.md b/solon-plugins/wx-java-cp-multi-solon-plugin/README.md
new file mode 100644
index 0000000000..8eb467f98f
--- /dev/null
+++ b/solon-plugins/wx-java-cp-multi-solon-plugin/README.md
@@ -0,0 +1,108 @@
+# wx-java-cp-multi-solon-plugin
+
+企业微信多账号配置
+
+- 实现多 WxCpService 初始化。
+- 未实现 WxCpTpService 初始化,需要的小伙伴可以参考多 WxCpService 配置的实现。
+- 未实现 WxCpCgService 初始化,需要的小伙伴可以参考多 WxCpService 配置的实现。
+
+## 关于 corp-secret 的说明
+
+企业微信中不同功能模块对应不同的 `corp-secret`,每种 Secret 只对对应模块的接口具有调用权限:
+
+| Secret 类型 | 获取位置 | 可调用的接口 | 是否需要 agent-id |
+|---|---|---|---|
+| 自建应用 Secret | 应用管理 → 自建应用 → 选择应用 → 查看 Secret | 该应用有权限的接口 | **必填** |
+| 通讯录同步 Secret | 管理工具 → 通讯录同步 → 查看 Secret | 部门/成员增删改查等通讯录接口 | **不填** |
+| 客户联系 Secret | 客户联系 → API → Secret | 客户联系相关接口 | 不填 |
+
+> **常见问题**:
+> - 使用自建应用 Secret + agent-id 可以获取部门列表,但**无法更新部门**(因为写接口需要通讯录同步权限)
+> - 使用通讯录同步 Secret 可以同步部门,但**调用某些需要 agent-id 的应用接口会报错**
+
+如需同时使用多种权限范围,可在 `wx.cp.corps` 下配置多个条目,每个条目使用对应权限的 Secret,通过不同的 `tenantId` 区分后使用。
+
+> **注意**:
+> 当前插件实现会校验同一 `corp-id` 下的 `agent-id` **必须唯一**,并且 **只能有一个条目不填写 `agent-id`**。
+> 如果在同一 `corp-id` 下同时配置多个未填写 `agent-id` 的条目,会因 token/ticket 缓存 key 冲突而在启动时直接抛异常。
+## 快速开始
+
+1. 引入依赖
+ ```xml
+ 同一企业(corpId 相同)下可配置多个条目以使用不同的权限 Secret,例如:
+ *但同一 corpId 下不允许出现重复的 agentId(包括多个 null)。
+ * + * 查看 {@link me.chanjar.weixin.cp.config.impl.AbstractWxCpInRedisConfigImpl#setAgentId(Integer)} + */ + Collection
+ * {@link me.chanjar.weixin.cp.api.WxCpService#setMaxRetryTimes(int)}
+ * {@link me.chanjar.weixin.cp.api.impl.BaseWxCpServiceImpl#setMaxRetryTimes(int)}
+ *
+ */
+ private int maxRetryTimes = 5;
+
+ /**
+ * http 请求重试间隔
+ *
+ * {@link me.chanjar.weixin.cp.api.WxCpService#setRetrySleepMillis(int)}
+ * {@link me.chanjar.weixin.cp.api.impl.BaseWxCpServiceImpl#setRetrySleepMillis(int)}
+ *
+ */
+ private int retrySleepMillis = 1000;
+ }
+
+ public enum StorageType {
+ /**
+ * 内存
+ */
+ memory,
+ /**
+ * jedis
+ */
+ jedis,
+ /**
+ * redisson
+ */
+ redisson,
+ /**
+ * redistemplate
+ */
+ redistemplate
+ }
+
+ public enum HttpClientType {
+ /**
+ * HttpClient
+ */
+ HTTP_CLIENT,
+ /**
+ * HttpComponents
+ */
+ HTTP_COMPONENTS,
+ /**
+ * OkHttp
+ */
+ OK_HTTP,
+ /**
+ * JoddHttp
+ */
+ JODD_HTTP
+ }
+}
diff --git a/solon-plugins/wx-java-cp-multi-solon-plugin/src/main/java/com/binarywang/solon/wxjava/cp_multi/properties/WxCpMultiRedisProperties.java b/solon-plugins/wx-java-cp-multi-solon-plugin/src/main/java/com/binarywang/solon/wxjava/cp_multi/properties/WxCpMultiRedisProperties.java
new file mode 100644
index 0000000000..14952d69d9
--- /dev/null
+++ b/solon-plugins/wx-java-cp-multi-solon-plugin/src/main/java/com/binarywang/solon/wxjava/cp_multi/properties/WxCpMultiRedisProperties.java
@@ -0,0 +1,48 @@
+package com.binarywang.solon.wxjava.cp_multi.properties;
+
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+/**
+ * Redis配置.
+ *
+ * @author yl
+ * created on 2023/10/16
+ */
+@Data
+@NoArgsConstructor
+public class WxCpMultiRedisProperties implements Serializable {
+ private static final long serialVersionUID = -5924815351660074401L;
+
+ /**
+ * 主机地址.
+ */
+ private String host;
+
+ /**
+ * 端口号.
+ */
+ private int port = 6379;
+
+ /**
+ * 密码.
+ */
+ private String password;
+
+ /**
+ * 超时.
+ */
+ private int timeout = 2000;
+
+ /**
+ * 数据库.
+ */
+ private int database = 0;
+
+ private Integer maxActive;
+ private Integer maxIdle;
+ private Integer maxWaitMillis;
+ private Integer minIdle;
+}
diff --git a/solon-plugins/wx-java-cp-multi-solon-plugin/src/main/java/com/binarywang/solon/wxjava/cp_multi/properties/WxCpSingleProperties.java b/solon-plugins/wx-java-cp-multi-solon-plugin/src/main/java/com/binarywang/solon/wxjava/cp_multi/properties/WxCpSingleProperties.java
new file mode 100644
index 0000000000..6f7f633c3f
--- /dev/null
+++ b/solon-plugins/wx-java-cp-multi-solon-plugin/src/main/java/com/binarywang/solon/wxjava/cp_multi/properties/WxCpSingleProperties.java
@@ -0,0 +1,68 @@
+package com.binarywang.solon.wxjava.cp_multi.properties;
+
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+/**
+ * 企业微信企业相关配置属性
+ *
+ * 企业微信中不同的 corpSecret 对应不同的权限范围,常见的有:
+ *如需同时使用多种权限范围(例如:既要操作通讯录,又要调用自建应用接口), + * 可在 {@code wx.cp.corps} 下配置多个条目,每个条目使用对应权限的 {@code corpSecret}, + * 其中通讯录同步的条目无需填写 {@code agentId}。
+ * + * @author yl + * created on 2023/10/16 + */ +@Data +@NoArgsConstructor +public class WxCpSingleProperties implements Serializable { + private static final long serialVersionUID = -7502823825007859418L; + /** + * 微信企业号 corpId + */ + private String corpId; + /** + * 微信企业号 corpSecret(权限密钥) + * + *企业微信针对不同的功能模块提供了不同的 Secret,每种 Secret 只对对应模块的接口有调用权限:
+ *使用自建应用 Secret 时,需要填写对应应用的 AgentId。
+ *使用通讯录同步 Secret 时,无需填写此字段。
+ */ + private Integer agentId; + /** + * 微信企业号应用 EncodingAESKey + */ + private String aesKey; + /** + * 微信企业号应用 会话存档私钥 + */ + private String msgAuditPriKey; + /** + * 微信企业号应用 会话存档类库路径 + */ + private String msgAuditLibPath; +} diff --git a/solon-plugins/wx-java-cp-multi-solon-plugin/src/main/java/com/binarywang/solon/wxjava/cp_multi/service/WxCpMultiServices.java b/solon-plugins/wx-java-cp-multi-solon-plugin/src/main/java/com/binarywang/solon/wxjava/cp_multi/service/WxCpMultiServices.java new file mode 100644 index 0000000000..c66c28233d --- /dev/null +++ b/solon-plugins/wx-java-cp-multi-solon-plugin/src/main/java/com/binarywang/solon/wxjava/cp_multi/service/WxCpMultiServices.java @@ -0,0 +1,26 @@ +package com.binarywang.solon.wxjava.cp_multi.service; + +import me.chanjar.weixin.cp.api.WxCpService; + +/** + * 企业微信 {@link WxCpService} 所有实例存放类. + * + * @author yl + * created on 2023/10/16 + */ +public interface WxCpMultiServices { + /** + * 通过租户 Id 获取 WxCpService + * + * @param tenantId 租户 Id + * @return WxCpService + */ + WxCpService getWxCpService(String tenantId); + + /** + * 根据租户 Id,从列表中移除一个 WxCpService 实例 + * + * @param tenantId 租户 Id + */ + void removeWxCpService(String tenantId); +} diff --git a/solon-plugins/wx-java-cp-multi-solon-plugin/src/main/java/com/binarywang/solon/wxjava/cp_multi/service/WxCpMultiServicesImpl.java b/solon-plugins/wx-java-cp-multi-solon-plugin/src/main/java/com/binarywang/solon/wxjava/cp_multi/service/WxCpMultiServicesImpl.java new file mode 100644 index 0000000000..d7833a05f9 --- /dev/null +++ b/solon-plugins/wx-java-cp-multi-solon-plugin/src/main/java/com/binarywang/solon/wxjava/cp_multi/service/WxCpMultiServicesImpl.java @@ -0,0 +1,42 @@ +package com.binarywang.solon.wxjava.cp_multi.service; + +import me.chanjar.weixin.cp.api.WxCpService; + +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +/** + * 企业微信 {@link WxCpMultiServices} 默认实现 + * + * @author yl + * created on 2023/10/16 + */ +public class WxCpMultiServicesImpl implements WxCpMultiServices { + private final Map
+ * {@link me.chanjar.weixin.cp.api.WxCpService#setMaxRetryTimes(int)}
+ * {@link me.chanjar.weixin.cp.api.impl.BaseWxCpServiceImpl#setMaxRetryTimes(int)}
+ *
+ */
+ private int maxRetryTimes = 5;
+
+ /**
+ * http 请求重试间隔
+ *
+ * {@link me.chanjar.weixin.cp.api.WxCpService#setRetrySleepMillis(int)}
+ * {@link me.chanjar.weixin.cp.api.impl.BaseWxCpServiceImpl#setRetrySleepMillis(int)}
+ *
+ */
+ private int retrySleepMillis = 1000;
+ }
+
+ public enum StorageType {
+ /**
+ * 内存
+ */
+ memory,
+ /**
+ * jedis
+ */
+ jedis,
+ /**
+ * redisson
+ */
+ redisson,
+ /**
+ * redistemplate
+ */
+ redistemplate
+ }
+}
diff --git a/solon-plugins/wx-java-cp-solon-plugin/src/main/java/com/binarywang/solon/wxjava/cp/properties/WxCpRedisProperties.java b/solon-plugins/wx-java-cp-solon-plugin/src/main/java/com/binarywang/solon/wxjava/cp/properties/WxCpRedisProperties.java
new file mode 100644
index 0000000000..43b8788d3f
--- /dev/null
+++ b/solon-plugins/wx-java-cp-solon-plugin/src/main/java/com/binarywang/solon/wxjava/cp/properties/WxCpRedisProperties.java
@@ -0,0 +1,46 @@
+package com.binarywang.solon.wxjava.cp.properties;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * Redis配置.
+ *
+ * @author yl
+ * created on 2023/04/23
+ */
+@Data
+public class WxCpRedisProperties implements Serializable {
+ private static final long serialVersionUID = -5924815351660074401L;
+
+ /**
+ * 主机地址.
+ */
+ private String host;
+
+ /**
+ * 端口号.
+ */
+ private int port = 6379;
+
+ /**
+ * 密码.
+ */
+ private String password;
+
+ /**
+ * 超时.
+ */
+ private int timeout = 2000;
+
+ /**
+ * 数据库.
+ */
+ private int database = 0;
+
+ private Integer maxActive;
+ private Integer maxIdle;
+ private Integer maxWaitMillis;
+ private Integer minIdle;
+}
diff --git a/solon-plugins/wx-java-cp-solon-plugin/src/main/java/com/binarywang/solon/wxjava/cp/storage/AbstractWxCpConfigStorageConfiguration.java b/solon-plugins/wx-java-cp-solon-plugin/src/main/java/com/binarywang/solon/wxjava/cp/storage/AbstractWxCpConfigStorageConfiguration.java
new file mode 100644
index 0000000000..9fcdd5779a
--- /dev/null
+++ b/solon-plugins/wx-java-cp-solon-plugin/src/main/java/com/binarywang/solon/wxjava/cp/storage/AbstractWxCpConfigStorageConfiguration.java
@@ -0,0 +1,61 @@
+package com.binarywang.solon.wxjava.cp.storage;
+
+import com.binarywang.solon.wxjava.cp.properties.WxCpProperties;
+import me.chanjar.weixin.cp.config.impl.WxCpDefaultConfigImpl;
+import org.apache.commons.lang3.StringUtils;
+
+/**
+ * WxCpConfigStorage 抽象配置类
+ *
+ * @author yl & Wang_Wong
+ * created on 2021/12/6
+ */
+public abstract class AbstractWxCpConfigStorageConfiguration {
+
+ protected WxCpDefaultConfigImpl config(WxCpDefaultConfigImpl config, WxCpProperties properties) {
+ String corpId = properties.getCorpId();
+ String corpSecret = properties.getCorpSecret();
+ Integer agentId = properties.getAgentId();
+ String token = properties.getToken();
+ String aesKey = properties.getAesKey();
+ // 企业微信,私钥,会话存档路径
+ String msgAuditPriKey = properties.getMsgAuditPriKey();
+ String msgAuditLibPath = properties.getMsgAuditLibPath();
+
+ config.setCorpId(corpId);
+ config.setCorpSecret(corpSecret);
+ config.setAgentId(agentId);
+ if (StringUtils.isNotBlank(token)) {
+ config.setToken(token);
+ }
+ if (StringUtils.isNotBlank(aesKey)) {
+ config.setAesKey(aesKey);
+ }
+ if (StringUtils.isNotBlank(msgAuditPriKey)) {
+ config.setMsgAuditPriKey(msgAuditPriKey);
+ }
+ if (StringUtils.isNotBlank(msgAuditLibPath)) {
+ config.setMsgAuditLibPath(msgAuditLibPath);
+ }
+
+ WxCpProperties.ConfigStorage storage = properties.getConfigStorage();
+ String httpProxyHost = storage.getHttpProxyHost();
+ Integer httpProxyPort = storage.getHttpProxyPort();
+ String httpProxyUsername = storage.getHttpProxyUsername();
+ String httpProxyPassword = storage.getHttpProxyPassword();
+ if (StringUtils.isNotBlank(httpProxyHost)) {
+ config.setHttpProxyHost(httpProxyHost);
+ if (httpProxyPort != null) {
+ config.setHttpProxyPort(httpProxyPort);
+ }
+ if (StringUtils.isNotBlank(httpProxyUsername)) {
+ config.setHttpProxyUsername(httpProxyUsername);
+ }
+ if (StringUtils.isNotBlank(httpProxyPassword)) {
+ config.setHttpProxyPassword(httpProxyPassword);
+ }
+ }
+ return config;
+ }
+
+}
diff --git a/solon-plugins/wx-java-cp-solon-plugin/src/main/java/com/binarywang/solon/wxjava/cp/storage/WxCpInJedisConfigStorageConfiguration.java b/solon-plugins/wx-java-cp-solon-plugin/src/main/java/com/binarywang/solon/wxjava/cp/storage/WxCpInJedisConfigStorageConfiguration.java
new file mode 100644
index 0000000000..f6f6931992
--- /dev/null
+++ b/solon-plugins/wx-java-cp-solon-plugin/src/main/java/com/binarywang/solon/wxjava/cp/storage/WxCpInJedisConfigStorageConfiguration.java
@@ -0,0 +1,74 @@
+package com.binarywang.solon.wxjava.cp.storage;
+
+import com.binarywang.solon.wxjava.cp.properties.WxCpProperties;
+import com.binarywang.solon.wxjava.cp.properties.WxCpRedisProperties;
+import lombok.RequiredArgsConstructor;
+import me.chanjar.weixin.cp.config.WxCpConfigStorage;
+import me.chanjar.weixin.cp.config.impl.WxCpDefaultConfigImpl;
+import me.chanjar.weixin.cp.config.impl.WxCpJedisConfigImpl;
+import org.apache.commons.lang3.StringUtils;
+import org.noear.solon.annotation.Bean;
+import org.noear.solon.annotation.Condition;
+import org.noear.solon.annotation.Configuration;
+import org.noear.solon.core.AppContext;
+import redis.clients.jedis.JedisPool;
+import redis.clients.jedis.JedisPoolConfig;
+
+/**
+ * 自动装配基于 jedis 策略配置
+ *
+ * @author yl
+ * created on 2023/04/23
+ */
+@Configuration
+@Condition(
+ onProperty = "${"+WxCpProperties.PREFIX + ".configStorage.type} = jedis",
+ onClass = JedisPool.class
+)
+@RequiredArgsConstructor
+public class WxCpInJedisConfigStorageConfiguration extends AbstractWxCpConfigStorageConfiguration {
+ private final WxCpProperties wxCpProperties;
+ private final AppContext applicationContext;
+
+ @Bean
+ @Condition(onMissingBean=WxCpConfigStorage.class)
+ public WxCpConfigStorage wxCpConfigStorage() {
+ WxCpDefaultConfigImpl config = getConfigStorage();
+ return this.config(config, wxCpProperties);
+ }
+
+ private WxCpJedisConfigImpl getConfigStorage() {
+ WxCpRedisProperties wxCpRedisProperties = wxCpProperties.getConfigStorage().getRedis();
+ JedisPool jedisPool;
+ if (wxCpRedisProperties != null && StringUtils.isNotEmpty(wxCpRedisProperties.getHost())) {
+ jedisPool = getJedisPool();
+ } else {
+ jedisPool = applicationContext.getBean(JedisPool.class);
+ }
+ return new WxCpJedisConfigImpl(jedisPool, wxCpProperties.getConfigStorage().getKeyPrefix());
+ }
+
+ private JedisPool getJedisPool() {
+ WxCpProperties.ConfigStorage storage = wxCpProperties.getConfigStorage();
+ WxCpRedisProperties redis = storage.getRedis();
+
+ JedisPoolConfig config = new JedisPoolConfig();
+ if (redis.getMaxActive() != null) {
+ config.setMaxTotal(redis.getMaxActive());
+ }
+ if (redis.getMaxIdle() != null) {
+ config.setMaxIdle(redis.getMaxIdle());
+ }
+ if (redis.getMaxWaitMillis() != null) {
+ config.setMaxWaitMillis(redis.getMaxWaitMillis());
+ }
+ if (redis.getMinIdle() != null) {
+ config.setMinIdle(redis.getMinIdle());
+ }
+ config.setTestOnBorrow(true);
+ config.setTestWhileIdle(true);
+
+ return new JedisPool(config, redis.getHost(), redis.getPort(),
+ redis.getTimeout(), redis.getPassword(), redis.getDatabase());
+ }
+}
diff --git a/solon-plugins/wx-java-cp-solon-plugin/src/main/java/com/binarywang/solon/wxjava/cp/storage/WxCpInMemoryConfigStorageConfiguration.java b/solon-plugins/wx-java-cp-solon-plugin/src/main/java/com/binarywang/solon/wxjava/cp/storage/WxCpInMemoryConfigStorageConfiguration.java
new file mode 100644
index 0000000000..2776fea368
--- /dev/null
+++ b/solon-plugins/wx-java-cp-solon-plugin/src/main/java/com/binarywang/solon/wxjava/cp/storage/WxCpInMemoryConfigStorageConfiguration.java
@@ -0,0 +1,31 @@
+package com.binarywang.solon.wxjava.cp.storage;
+
+import com.binarywang.solon.wxjava.cp.properties.WxCpProperties;
+import lombok.RequiredArgsConstructor;
+import me.chanjar.weixin.cp.config.WxCpConfigStorage;
+import me.chanjar.weixin.cp.config.impl.WxCpDefaultConfigImpl;
+import org.noear.solon.annotation.Bean;
+import org.noear.solon.annotation.Condition;
+import org.noear.solon.annotation.Configuration;
+
+/**
+ * 自动装配基于内存策略配置
+ *
+ * @author yl
+ * created on 2021/12/6
+ */
+@Configuration
+@Condition(
+ onProperty = "${"+WxCpProperties.PREFIX + ".configStorage.type:memory} = memory"
+)
+@RequiredArgsConstructor
+public class WxCpInMemoryConfigStorageConfiguration extends AbstractWxCpConfigStorageConfiguration {
+ private final WxCpProperties wxCpProperties;
+
+ @Bean
+ @Condition(onMissingBean=WxCpConfigStorage.class)
+ public WxCpConfigStorage wxCpConfigStorage() {
+ WxCpDefaultConfigImpl config = new WxCpDefaultConfigImpl();
+ return this.config(config, wxCpProperties);
+ }
+}
diff --git a/solon-plugins/wx-java-cp-solon-plugin/src/main/java/com/binarywang/solon/wxjava/cp/storage/WxCpInRedissonConfigStorageConfiguration.java b/solon-plugins/wx-java-cp-solon-plugin/src/main/java/com/binarywang/solon/wxjava/cp/storage/WxCpInRedissonConfigStorageConfiguration.java
new file mode 100644
index 0000000000..0aef4d520a
--- /dev/null
+++ b/solon-plugins/wx-java-cp-solon-plugin/src/main/java/com/binarywang/solon/wxjava/cp/storage/WxCpInRedissonConfigStorageConfiguration.java
@@ -0,0 +1,65 @@
+package com.binarywang.solon.wxjava.cp.storage;
+
+import com.binarywang.solon.wxjava.cp.properties.WxCpProperties;
+import com.binarywang.solon.wxjava.cp.properties.WxCpRedisProperties;
+import lombok.RequiredArgsConstructor;
+import me.chanjar.weixin.cp.config.WxCpConfigStorage;
+import me.chanjar.weixin.cp.config.impl.WxCpDefaultConfigImpl;
+import me.chanjar.weixin.cp.config.impl.WxCpRedissonConfigImpl;
+import org.apache.commons.lang3.StringUtils;
+import org.noear.solon.annotation.Bean;
+import org.noear.solon.annotation.Condition;
+import org.noear.solon.annotation.Configuration;
+import org.noear.solon.core.AppContext;
+import org.redisson.Redisson;
+import org.redisson.api.RedissonClient;
+import org.redisson.config.Config;
+import org.redisson.config.TransportMode;
+
+/**
+ * 自动装配基于 redisson 策略配置
+ *
+ * @author yl
+ * created on 2023/04/23
+ */
+@Configuration
+@Condition(
+ onProperty = "${"+WxCpProperties.PREFIX + ".configStorage.type} = redisson",
+ onClass = Redisson.class
+)
+@RequiredArgsConstructor
+public class WxCpInRedissonConfigStorageConfiguration extends AbstractWxCpConfigStorageConfiguration {
+ private final WxCpProperties wxCpProperties;
+ private final AppContext applicationContext;
+
+ @Bean
+ @Condition(onMissingBean=WxCpConfigStorage.class)
+ public WxCpConfigStorage wxCpConfigStorage() {
+ WxCpDefaultConfigImpl config = getConfigStorage();
+ return this.config(config, wxCpProperties);
+ }
+
+ private WxCpRedissonConfigImpl getConfigStorage() {
+ WxCpRedisProperties redisProperties = wxCpProperties.getConfigStorage().getRedis();
+ RedissonClient redissonClient;
+ if (redisProperties != null && StringUtils.isNotEmpty(redisProperties.getHost())) {
+ redissonClient = getRedissonClient();
+ } else {
+ redissonClient = applicationContext.getBean(RedissonClient.class);
+ }
+ return new WxCpRedissonConfigImpl(redissonClient, wxCpProperties.getConfigStorage().getKeyPrefix());
+ }
+
+ private RedissonClient getRedissonClient() {
+ WxCpProperties.ConfigStorage storage = wxCpProperties.getConfigStorage();
+ WxCpRedisProperties redis = storage.getRedis();
+
+ Config config = new Config();
+ config.useSingleServer()
+ .setAddress("redis://" + redis.getHost() + ":" + redis.getPort())
+ .setDatabase(redis.getDatabase())
+ .setPassword(redis.getPassword());
+ config.setTransportMode(TransportMode.NIO);
+ return Redisson.create(config);
+ }
+}
diff --git a/solon-plugins/wx-java-cp-solon-plugin/src/main/resources/META-INF/solon/wx-java-cp-solon-plugin.properties b/solon-plugins/wx-java-cp-solon-plugin/src/main/resources/META-INF/solon/wx-java-cp-solon-plugin.properties
new file mode 100644
index 0000000000..c765affecb
--- /dev/null
+++ b/solon-plugins/wx-java-cp-solon-plugin/src/main/resources/META-INF/solon/wx-java-cp-solon-plugin.properties
@@ -0,0 +1,2 @@
+solon.plugin=com.binarywang.solon.wxjava.cp.integration.WxCpPluginImpl
+solon.plugin.priority=10
diff --git a/solon-plugins/wx-java-cp-solon-plugin/src/test/java/features/test/LoadTest.java b/solon-plugins/wx-java-cp-solon-plugin/src/test/java/features/test/LoadTest.java
new file mode 100644
index 0000000000..d049f5a51a
--- /dev/null
+++ b/solon-plugins/wx-java-cp-solon-plugin/src/test/java/features/test/LoadTest.java
@@ -0,0 +1,15 @@
+package features.test;
+
+import org.junit.jupiter.api.Test;
+import org.noear.solon.test.SolonTest;
+
+/**
+ * @author noear 2024/9/4 created
+ */
+@SolonTest
+public class LoadTest {
+ @Test
+ public void load(){
+
+ }
+}
diff --git a/solon-plugins/wx-java-cp-solon-plugin/src/test/resources/app.properties b/solon-plugins/wx-java-cp-solon-plugin/src/test/resources/app.properties
new file mode 100644
index 0000000000..0c99c8b64d
--- /dev/null
+++ b/solon-plugins/wx-java-cp-solon-plugin/src/test/resources/app.properties
@@ -0,0 +1,20 @@
+# ???????(??)
+wx.cp.corp-id = @corp-id
+wx.cp.corp-secret = @corp-secret
+# ??
+wx.cp.agent-id = @agent-id
+wx.cp.token = @token
+wx.cp.aes-key = @aes-key
+wx.cp.msg-audit-priKey = @msg-audit-priKey
+wx.cp.msg-audit-lib-path = @msg-audit-lib-path
+# ConfigStorage ??????
+wx.cp.config-storage.type=memory # ????: memory(??), jedis, redisson, redistemplate
+# http ?????????
+wx.cp.config-storage.http-proxy-host=
+wx.cp.config-storage.http-proxy-port=
+wx.cp.config-storage.http-proxy-username=
+wx.cp.config-storage.http-proxy-password=
+# ??????????5 ?????? 0??? 0
+wx.cp.config-storage.max-retry-times=5
+# ????????????1000 ??????? 0??? 1000
+wx.cp.config-storage.retry-sleep-millis=1000
diff --git a/solon-plugins/wx-java-miniapp-multi-solon-plugin/README.md b/solon-plugins/wx-java-miniapp-multi-solon-plugin/README.md
new file mode 100644
index 0000000000..4555a4fc5e
--- /dev/null
+++ b/solon-plugins/wx-java-miniapp-multi-solon-plugin/README.md
@@ -0,0 +1,95 @@
+# wx-java-miniapp-multi-solon-plugin
+
+## 快速开始
+
+1. 引入依赖
+ ```xml
+
+ * {@link cn.binarywang.wx.miniapp.api.WxMaService#setMaxRetryTimes(int)}
+ * {@link cn.binarywang.wx.miniapp.api.impl.BaseWxMaServiceImpl#setMaxRetryTimes(int)}
+ *
+ */
+ private int maxRetryTimes = 5;
+
+ /**
+ * http 请求重试间隔
+ *
+ * {@link cn.binarywang.wx.miniapp.api.WxMaService#setRetrySleepMillis(int)}
+ * {@link cn.binarywang.wx.miniapp.api.impl.BaseWxMaServiceImpl#setRetrySleepMillis(int)}
+ *
+ */
+ private int retrySleepMillis = 1000;
+ }
+
+ public enum StorageType {
+ /**
+ * 内存
+ */
+ MEMORY,
+ /**
+ * jedis
+ */
+ JEDIS,
+ /**
+ * redisson
+ */
+ REDISSON,
+ /**
+ * redisTemplate
+ */
+ REDIS_TEMPLATE
+ }
+
+ public enum HttpClientType {
+ /**
+ * HttpClient
+ */
+ HTTP_CLIENT,
+ /**
+ * OkHttp
+ */
+ OK_HTTP,
+ /**
+ * JoddHttp
+ */
+ JODD_HTTP,
+ /**
+ * HttpComponents
+ */
+ HTTP_COMPONENTS
+ }
+}
diff --git a/solon-plugins/wx-java-miniapp-multi-solon-plugin/src/main/java/com/binarywang/solon/wxjava/miniapp/properties/WxMaMultiRedisProperties.java b/solon-plugins/wx-java-miniapp-multi-solon-plugin/src/main/java/com/binarywang/solon/wxjava/miniapp/properties/WxMaMultiRedisProperties.java
new file mode 100644
index 0000000000..1f4c07806e
--- /dev/null
+++ b/solon-plugins/wx-java-miniapp-multi-solon-plugin/src/main/java/com/binarywang/solon/wxjava/miniapp/properties/WxMaMultiRedisProperties.java
@@ -0,0 +1,56 @@
+package com.binarywang.solon.wxjava.miniapp.properties;
+
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+/**
+ * @author monch
+ * created on 2024/9/6
+ */
+@Data
+@NoArgsConstructor
+public class WxMaMultiRedisProperties implements Serializable {
+ private static final long serialVersionUID = -5924815351660074401L;
+
+ /**
+ * 主机地址.
+ */
+ private String host = "127.0.0.1";
+
+ /**
+ * 端口号.
+ */
+ private int port = 6379;
+
+ /**
+ * 密码.
+ */
+ private String password;
+
+ /**
+ * 超时.
+ */
+ private int timeout = 2000;
+
+ /**
+ * 数据库.
+ */
+ private int database = 0;
+
+ /**
+ * sentinel ips
+ */
+ private String sentinelIps;
+
+ /**
+ * sentinel name
+ */
+ private String sentinelName;
+
+ private Integer maxActive;
+ private Integer maxIdle;
+ private Integer maxWaitMillis;
+ private Integer minIdle;
+}
diff --git a/solon-plugins/wx-java-miniapp-multi-solon-plugin/src/main/java/com/binarywang/solon/wxjava/miniapp/properties/WxMaSingleProperties.java b/solon-plugins/wx-java-miniapp-multi-solon-plugin/src/main/java/com/binarywang/solon/wxjava/miniapp/properties/WxMaSingleProperties.java
new file mode 100644
index 0000000000..f61985716e
--- /dev/null
+++ b/solon-plugins/wx-java-miniapp-multi-solon-plugin/src/main/java/com/binarywang/solon/wxjava/miniapp/properties/WxMaSingleProperties.java
@@ -0,0 +1,40 @@
+package com.binarywang.solon.wxjava.miniapp.properties;
+
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+/**
+ * @author monch
+ * created on 2024/9/6
+ */
+@Data
+@NoArgsConstructor
+public class WxMaSingleProperties implements Serializable {
+ private static final long serialVersionUID = 1980986361098922525L;
+ /**
+ * 设置微信公众号的 appid.
+ */
+ private String appId;
+
+ /**
+ * 设置微信公众号的 app secret.
+ */
+ private String appSecret;
+
+ /**
+ * 设置微信公众号的 token.
+ */
+ private String token;
+
+ /**
+ * 设置微信公众号的 EncodingAESKey.
+ */
+ private String aesKey;
+
+ /**
+ * 是否使用稳定版 Access Token
+ */
+ private boolean useStableAccessToken = false;
+}
diff --git a/solon-plugins/wx-java-miniapp-multi-solon-plugin/src/main/java/com/binarywang/solon/wxjava/miniapp/service/WxMaMultiServices.java b/solon-plugins/wx-java-miniapp-multi-solon-plugin/src/main/java/com/binarywang/solon/wxjava/miniapp/service/WxMaMultiServices.java
new file mode 100644
index 0000000000..80d073cceb
--- /dev/null
+++ b/solon-plugins/wx-java-miniapp-multi-solon-plugin/src/main/java/com/binarywang/solon/wxjava/miniapp/service/WxMaMultiServices.java
@@ -0,0 +1,27 @@
+package com.binarywang.solon.wxjava.miniapp.service;
+
+
+import cn.binarywang.wx.miniapp.api.WxMaService;
+
+/**
+ * 微信小程序 {@link WxMaService} 所有实例存放类.
+ *
+ * @author monch
+ * created on 2024/9/6
+ */
+public interface WxMaMultiServices {
+ /**
+ * 通过租户 Id 获取 WxMaService
+ *
+ * @param tenantId 租户 Id
+ * @return WxMaService
+ */
+ WxMaService getWxMaService(String tenantId);
+
+ /**
+ * 根据租户 Id,从列表中移除一个 WxMaService 实例
+ *
+ * @param tenantId 租户 Id
+ */
+ void removeWxMaService(String tenantId);
+}
diff --git a/solon-plugins/wx-java-miniapp-multi-solon-plugin/src/main/java/com/binarywang/solon/wxjava/miniapp/service/WxMaMultiServicesImpl.java b/solon-plugins/wx-java-miniapp-multi-solon-plugin/src/main/java/com/binarywang/solon/wxjava/miniapp/service/WxMaMultiServicesImpl.java
new file mode 100644
index 0000000000..d0ba21cdb8
--- /dev/null
+++ b/solon-plugins/wx-java-miniapp-multi-solon-plugin/src/main/java/com/binarywang/solon/wxjava/miniapp/service/WxMaMultiServicesImpl.java
@@ -0,0 +1,36 @@
+package com.binarywang.solon.wxjava.miniapp.service;
+
+import cn.binarywang.wx.miniapp.api.WxMaService;
+
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+/**
+ * 微信小程序 {@link WxMaMultiServices} 默认实现
+ *
+ * @author monch
+ * created on 2024/9/6
+ */
+public class WxMaMultiServicesImpl implements WxMaMultiServices {
+ private final Map
+ * {@link cn.binarywang.wx.miniapp.api.impl.BaseWxMaServiceImpl#setRetrySleepMillis(int)}
+ *
+ */
+ private int retrySleepMillis = 1000;
+ /**
+ * http 请求最大重试次数
+ *
+ * {@link cn.binarywang.wx.miniapp.api.impl.BaseWxMaServiceImpl#setMaxRetryTimes(int)}
+ *
+ */
+ private int maxRetryTimes = 5;
+ }
+
+}
diff --git a/solon-plugins/wx-java-miniapp-solon-plugin/src/main/resources/META-INF/solon/wx-java-miniapp-solon-plugin.properties b/solon-plugins/wx-java-miniapp-solon-plugin/src/main/resources/META-INF/solon/wx-java-miniapp-solon-plugin.properties
new file mode 100644
index 0000000000..ba1049647e
--- /dev/null
+++ b/solon-plugins/wx-java-miniapp-solon-plugin/src/main/resources/META-INF/solon/wx-java-miniapp-solon-plugin.properties
@@ -0,0 +1,2 @@
+solon.plugin=com.binarywang.solon.wxjava.miniapp.integration.WxMiniappPluginImpl
+solon.plugin.priority=10
diff --git a/solon-plugins/wx-java-miniapp-solon-plugin/src/test/java/features/test/LoadTest.java b/solon-plugins/wx-java-miniapp-solon-plugin/src/test/java/features/test/LoadTest.java
new file mode 100644
index 0000000000..d049f5a51a
--- /dev/null
+++ b/solon-plugins/wx-java-miniapp-solon-plugin/src/test/java/features/test/LoadTest.java
@@ -0,0 +1,15 @@
+package features.test;
+
+import org.junit.jupiter.api.Test;
+import org.noear.solon.test.SolonTest;
+
+/**
+ * @author noear 2024/9/4 created
+ */
+@SolonTest
+public class LoadTest {
+ @Test
+ public void load(){
+
+ }
+}
diff --git a/solon-plugins/wx-java-miniapp-solon-plugin/src/test/resources/app.properties b/solon-plugins/wx-java-miniapp-solon-plugin/src/test/resources/app.properties
new file mode 100644
index 0000000000..22a9a4e627
--- /dev/null
+++ b/solon-plugins/wx-java-miniapp-solon-plugin/src/test/resources/app.properties
@@ -0,0 +1,18 @@
+# ?????(??)
+wx.miniapp.appid = appId
+wx.miniapp.secret = @secret
+wx.miniapp.token = @token
+wx.miniapp.aesKey = @aesKey
+wx.miniapp.msgDataFormat = @msgDataFormat # ?????XML??JSON.
+# ????redis(??)
+# ??: ??redis.host???????????redis??(JedisPool)
+wx.miniapp.config-storage.type = Jedis # ????: Memory(??), Jedis, RedisTemplate
+wx.miniapp.config-storage.key-prefix = wa # ??redis????: wa(??)
+wx.miniapp.config-storage.redis.host = 127.0.0.1
+wx.miniapp.config-storage.redis.port = 6379
+# http?????
+wx.miniapp.config-storage.http-client-type=HttpClient # http?????: HttpClient(??), OkHttp, JoddHttp
+wx.miniapp.config-storage.http-proxy-host=
+wx.miniapp.config-storage.http-proxy-port=
+wx.miniapp.config-storage.http-proxy-username=
+wx.miniapp.config-storage.http-proxy-password=
diff --git a/solon-plugins/wx-java-mp-multi-solon-plugin/README.md b/solon-plugins/wx-java-mp-multi-solon-plugin/README.md
new file mode 100644
index 0000000000..0d2b332d5a
--- /dev/null
+++ b/solon-plugins/wx-java-mp-multi-solon-plugin/README.md
@@ -0,0 +1,100 @@
+# wx-java-mp-multi-solon-plugin
+
+## 快速开始
+
+1. 引入依赖
+ ```xml
+
+ * {@link me.chanjar.weixin.mp.api.WxMpService#setMaxRetryTimes(int)}
+ * {@link me.chanjar.weixin.mp.api.impl.BaseWxMpServiceImpl#setMaxRetryTimes(int)}
+ *
+ */
+ private int maxRetryTimes = 5;
+
+ /**
+ * http 请求重试间隔
+ *
+ * {@link me.chanjar.weixin.mp.api.WxMpService#setRetrySleepMillis(int)}
+ * {@link me.chanjar.weixin.mp.api.impl.BaseWxMpServiceImpl#setRetrySleepMillis(int)}
+ *
+ */
+ private int retrySleepMillis = 1000;
+ }
+
+ public enum StorageType {
+ /**
+ * 内存
+ */
+ MEMORY,
+ /**
+ * jedis
+ */
+ JEDIS,
+ /**
+ * redisson
+ */
+ REDISSON,
+ /**
+ * redisTemplate
+ */
+ REDIS_TEMPLATE
+ }
+
+ public enum HttpClientType {
+ /**
+ * HttpClient
+ */
+ HTTP_CLIENT,
+ /**
+ * OkHttp
+ */
+ OK_HTTP,
+ /**
+ * JoddHttp
+ */
+ JODD_HTTP,
+ /**
+ * HttpComponents
+ */
+ HTTP_COMPONENTS
+ }
+}
diff --git a/solon-plugins/wx-java-mp-multi-solon-plugin/src/main/java/com/binarywang/solon/wxjava/mp_multi/properties/WxMpMultiRedisProperties.java b/solon-plugins/wx-java-mp-multi-solon-plugin/src/main/java/com/binarywang/solon/wxjava/mp_multi/properties/WxMpMultiRedisProperties.java
new file mode 100644
index 0000000000..12646d4eaf
--- /dev/null
+++ b/solon-plugins/wx-java-mp-multi-solon-plugin/src/main/java/com/binarywang/solon/wxjava/mp_multi/properties/WxMpMultiRedisProperties.java
@@ -0,0 +1,56 @@
+package com.binarywang.solon.wxjava.mp_multi.properties;
+
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+/**
+ * @author yl
+ * created on 2024/1/23
+ */
+@Data
+@NoArgsConstructor
+public class WxMpMultiRedisProperties implements Serializable {
+ private static final long serialVersionUID = -5924815351660074401L;
+
+ /**
+ * 主机地址.
+ */
+ private String host = "127.0.0.1";
+
+ /**
+ * 端口号.
+ */
+ private int port = 6379;
+
+ /**
+ * 密码.
+ */
+ private String password;
+
+ /**
+ * 超时.
+ */
+ private int timeout = 2000;
+
+ /**
+ * 数据库.
+ */
+ private int database = 0;
+
+ /**
+ * sentinel ips
+ */
+ private String sentinelIps;
+
+ /**
+ * sentinel name
+ */
+ private String sentinelName;
+
+ private Integer maxActive;
+ private Integer maxIdle;
+ private Integer maxWaitMillis;
+ private Integer minIdle;
+}
diff --git a/solon-plugins/wx-java-mp-multi-solon-plugin/src/main/java/com/binarywang/solon/wxjava/mp_multi/properties/WxMpSingleProperties.java b/solon-plugins/wx-java-mp-multi-solon-plugin/src/main/java/com/binarywang/solon/wxjava/mp_multi/properties/WxMpSingleProperties.java
new file mode 100644
index 0000000000..22938cb67c
--- /dev/null
+++ b/solon-plugins/wx-java-mp-multi-solon-plugin/src/main/java/com/binarywang/solon/wxjava/mp_multi/properties/WxMpSingleProperties.java
@@ -0,0 +1,40 @@
+package com.binarywang.solon.wxjava.mp_multi.properties;
+
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+/**
+ * @author yl
+ * created on 2024/1/23
+ */
+@Data
+@NoArgsConstructor
+public class WxMpSingleProperties implements Serializable {
+ private static final long serialVersionUID = 1980986361098922525L;
+ /**
+ * 设置微信公众号的 appid.
+ */
+ private String appId;
+
+ /**
+ * 设置微信公众号的 app secret.
+ */
+ private String appSecret;
+
+ /**
+ * 设置微信公众号的 token.
+ */
+ private String token;
+
+ /**
+ * 设置微信公众号的 EncodingAESKey.
+ */
+ private String aesKey;
+
+ /**
+ * 是否使用稳定版 Access Token
+ */
+ private boolean useStableAccessToken = false;
+}
diff --git a/solon-plugins/wx-java-mp-multi-solon-plugin/src/main/java/com/binarywang/solon/wxjava/mp_multi/service/WxMpMultiServices.java b/solon-plugins/wx-java-mp-multi-solon-plugin/src/main/java/com/binarywang/solon/wxjava/mp_multi/service/WxMpMultiServices.java
new file mode 100644
index 0000000000..a59b5962ad
--- /dev/null
+++ b/solon-plugins/wx-java-mp-multi-solon-plugin/src/main/java/com/binarywang/solon/wxjava/mp_multi/service/WxMpMultiServices.java
@@ -0,0 +1,27 @@
+package com.binarywang.solon.wxjava.mp_multi.service;
+
+
+import me.chanjar.weixin.mp.api.WxMpService;
+
+/**
+ * 企业微信 {@link WxMpService} 所有实例存放类.
+ *
+ * @author yl
+ * created on 2024/1/23
+ */
+public interface WxMpMultiServices {
+ /**
+ * 通过租户 Id 获取 WxMpService
+ *
+ * @param tenantId 租户 Id
+ * @return WxMpService
+ */
+ WxMpService getWxMpService(String tenantId);
+
+ /**
+ * 根据租户 Id,从列表中移除一个 WxMpService 实例
+ *
+ * @param tenantId 租户 Id
+ */
+ void removeWxMpService(String tenantId);
+}
diff --git a/solon-plugins/wx-java-mp-multi-solon-plugin/src/main/java/com/binarywang/solon/wxjava/mp_multi/service/WxMpMultiServicesImpl.java b/solon-plugins/wx-java-mp-multi-solon-plugin/src/main/java/com/binarywang/solon/wxjava/mp_multi/service/WxMpMultiServicesImpl.java
new file mode 100644
index 0000000000..d87cd4e8df
--- /dev/null
+++ b/solon-plugins/wx-java-mp-multi-solon-plugin/src/main/java/com/binarywang/solon/wxjava/mp_multi/service/WxMpMultiServicesImpl.java
@@ -0,0 +1,36 @@
+package com.binarywang.solon.wxjava.mp_multi.service;
+
+import me.chanjar.weixin.mp.api.WxMpService;
+
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+/**
+ * 企业微信 {@link WxMpMultiServices} 默认实现
+ *
+ * @author yl
+ * created on 2024/1/23
+ */
+public class WxMpMultiServicesImpl implements WxMpMultiServices {
+ private final Map
+ * {@link me.chanjar.weixin.mp.api.impl.BaseWxMpServiceImpl#setRetrySleepMillis(int)}
+ * {@link cn.binarywang.wx.miniapp.api.impl.BaseWxMaServiceImpl#setRetrySleepMillis(int)}
+ *
+ */
+ private int retrySleepMillis = 1000;
+ /**
+ * http 请求最大重试次数
+ *
+ * {@link me.chanjar.weixin.mp.api.impl.BaseWxMpServiceImpl#setMaxRetryTimes(int)}
+ * {@link cn.binarywang.wx.miniapp.api.impl.BaseWxMaServiceImpl#setMaxRetryTimes(int)}
+ *
+ */
+ private int maxRetryTimes = 5;
+
+ }
+
+ public enum StorageType {
+ /**
+ * 内存.
+ */
+ memory,
+ /**
+ * jedis.
+ */
+ jedis,
+ /**
+ * redisson.
+ */
+ redisson,
+ /**
+ * redistemplate
+ */
+ redistemplate
+ }
+
+ public enum HttpClientType {
+ /**
+ * HttpClient.
+ */
+ httpclient
+ }
+}
diff --git a/solon-plugins/wx-java-open-solon-plugin/src/main/java/com/binarywang/solon/wxjava/open/properties/WxOpenRedisProperties.java b/solon-plugins/wx-java-open-solon-plugin/src/main/java/com/binarywang/solon/wxjava/open/properties/WxOpenRedisProperties.java
new file mode 100644
index 0000000000..6b7a2d8654
--- /dev/null
+++ b/solon-plugins/wx-java-open-solon-plugin/src/main/java/com/binarywang/solon/wxjava/open/properties/WxOpenRedisProperties.java
@@ -0,0 +1,45 @@
+package com.binarywang.solon.wxjava.open.properties;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * Redis配置.
+ *
+ * @author someone
+ */
+@Data
+public class WxOpenRedisProperties implements Serializable {
+ private static final long serialVersionUID = -5924815351660074401L;
+
+ /**
+ * 主机地址.
+ */
+ private String host;
+
+ /**
+ * 端口号.
+ */
+ private int port = 6379;
+
+ /**
+ * 密码.
+ */
+ private String password;
+
+ /**
+ * 超时.
+ */
+ private int timeout = 2000;
+
+ /**
+ * 数据库.
+ */
+ private int database = 0;
+
+ private Integer maxActive;
+ private Integer maxIdle;
+ private Integer maxWaitMillis;
+ private Integer minIdle;
+}
diff --git a/solon-plugins/wx-java-open-solon-plugin/src/main/resources/META-INF/solon/wx-java-open-solon-plugin.properties b/solon-plugins/wx-java-open-solon-plugin/src/main/resources/META-INF/solon/wx-java-open-solon-plugin.properties
new file mode 100644
index 0000000000..289aca5eeb
--- /dev/null
+++ b/solon-plugins/wx-java-open-solon-plugin/src/main/resources/META-INF/solon/wx-java-open-solon-plugin.properties
@@ -0,0 +1,2 @@
+solon.plugin=com.binarywang.solon.wxjava.open.integration.WxOpenPluginImpl
+solon.plugin.priority=10
diff --git a/solon-plugins/wx-java-open-solon-plugin/src/test/java/features/test/LoadTest.java b/solon-plugins/wx-java-open-solon-plugin/src/test/java/features/test/LoadTest.java
new file mode 100644
index 0000000000..d049f5a51a
--- /dev/null
+++ b/solon-plugins/wx-java-open-solon-plugin/src/test/java/features/test/LoadTest.java
@@ -0,0 +1,15 @@
+package features.test;
+
+import org.junit.jupiter.api.Test;
+import org.noear.solon.test.SolonTest;
+
+/**
+ * @author noear 2024/9/4 created
+ */
+@SolonTest
+public class LoadTest {
+ @Test
+ public void load(){
+
+ }
+}
diff --git a/solon-plugins/wx-java-open-solon-plugin/src/test/resources/app.properties b/solon-plugins/wx-java-open-solon-plugin/src/test/resources/app.properties
new file mode 100644
index 0000000000..fc2e79c95b
--- /dev/null
+++ b/solon-plugins/wx-java-open-solon-plugin/src/test/resources/app.properties
@@ -0,0 +1,11 @@
+# ?????(??)
+wx.open.appId = appId
+wx.open.secret = @secret
+wx.open.token = @token
+wx.open.aesKey = @aesKey
+# ????redis(??)
+# ???????(JedisPool, RedissonClient), ????wx.open.config-storage.redis.host, ????????redis????
+wx.open.config-storage.type = redis # ????: memory(??), redis(jedis), jedis, redisson, redistemplate
+wx.open.config-storage.key-prefix = wx # ??redis????: wx(??)
+wx.open.config-storage.redis.host = 127.0.0.1
+wx.open.config-storage.redis.port = 6379
diff --git a/solon-plugins/wx-java-pay-solon-plugin/README.md b/solon-plugins/wx-java-pay-solon-plugin/README.md
new file mode 100644
index 0000000000..8ff3416293
--- /dev/null
+++ b/solon-plugins/wx-java-pay-solon-plugin/README.md
@@ -0,0 +1,45 @@
+# 使用说明
+1. 在自己的Solon项目里,引入maven依赖
+```xml
+ + * 微信支付自动配置 + * Created by BinaryWang on 2019/4/17. + *+ * + * @author Binary Wang + */ +@Configuration +@Condition( + onProperty = "${wx.pay.enabled:true} = true", + onClass=WxPayService.class +) +public class WxPayAutoConfiguration { + private WxPayProperties properties; + + public WxPayAutoConfiguration(WxPayProperties properties) { + this.properties = properties; + } + + /** + * 构造微信支付服务对象. + * + * @return 微信支付service + */ + @Bean + @Condition(onMissingBean=WxPayService.class) + public WxPayService wxPayService() { + final WxPayServiceImpl wxPayService = new WxPayServiceImpl(); + WxPayConfig payConfig = new WxPayConfig(); + payConfig.setAppId(StringUtils.trimToNull(this.properties.getAppId())); + payConfig.setMchId(StringUtils.trimToNull(this.properties.getMchId())); + payConfig.setMchKey(StringUtils.trimToNull(this.properties.getMchKey())); + payConfig.setSubAppId(StringUtils.trimToNull(this.properties.getSubAppId())); + payConfig.setSubMchId(StringUtils.trimToNull(this.properties.getSubMchId())); + payConfig.setKeyPath(StringUtils.trimToNull(this.properties.getKeyPath())); + payConfig.setUseSandboxEnv(this.properties.isUseSandboxEnv()); + payConfig.setNotifyUrl(StringUtils.trimToNull(this.properties.getNotifyUrl())); + payConfig.setRefundNotifyUrl(StringUtils.trimToNull(this.properties.getRefundNotifyUrl())); + //以下是apiv3以及支付分相关 + payConfig.setServiceId(StringUtils.trimToNull(this.properties.getServiceId())); + payConfig.setPayScoreNotifyUrl(StringUtils.trimToNull(this.properties.getPayScoreNotifyUrl())); + payConfig.setPayScorePermissionNotifyUrl(StringUtils.trimToNull(this.properties.getPayScorePermissionNotifyUrl())); + payConfig.setPrivateKeyPath(StringUtils.trimToNull(this.properties.getPrivateKeyPath())); + payConfig.setPrivateCertPath(StringUtils.trimToNull(this.properties.getPrivateCertPath())); + payConfig.setCertSerialNo(StringUtils.trimToNull(this.properties.getCertSerialNo())); + payConfig.setApiV3Key(StringUtils.trimToNull(this.properties.getApiV3Key())); + payConfig.setPublicKeyId(StringUtils.trimToNull(this.properties.getPublicKeyId())); + payConfig.setPublicKeyPath(StringUtils.trimToNull(this.properties.getPublicKeyPath())); + payConfig.setApiHostUrl(StringUtils.trimToNull(this.properties.getApiHostUrl())); + payConfig.setApiHostUrlPath(StringUtils.trimToNull(this.properties.getApiHostUrlPath())); + payConfig.setStrictlyNeedWechatPaySerial(this.properties.isStrictlyNeedWechatPaySerial()); + payConfig.setFullPublicKeyModel(this.properties.isFullPublicKeyModel()); + + wxPayService.setConfig(payConfig); + return wxPayService; + } + +} diff --git a/solon-plugins/wx-java-pay-solon-plugin/src/main/java/com/binarywang/solon/wxjava/pay/integration/WxPayPluginImpl.java b/solon-plugins/wx-java-pay-solon-plugin/src/main/java/com/binarywang/solon/wxjava/pay/integration/WxPayPluginImpl.java new file mode 100644 index 0000000000..e7ba275ca0 --- /dev/null +++ b/solon-plugins/wx-java-pay-solon-plugin/src/main/java/com/binarywang/solon/wxjava/pay/integration/WxPayPluginImpl.java @@ -0,0 +1,18 @@ +package com.binarywang.solon.wxjava.pay.integration; + +import com.binarywang.solon.wxjava.pay.config.WxPayAutoConfiguration; +import com.binarywang.solon.wxjava.pay.properties.WxPayProperties; +import org.noear.solon.core.AppContext; +import org.noear.solon.core.Plugin; + +/** + * @author noear 2024/9/2 created + */ +public class WxPayPluginImpl implements Plugin { + @Override + public void start(AppContext context) throws Throwable { + context.beanMake(WxPayProperties.class); + + context.beanMake(WxPayAutoConfiguration.class); + } +} diff --git a/solon-plugins/wx-java-pay-solon-plugin/src/main/java/com/binarywang/solon/wxjava/pay/properties/WxPayProperties.java b/solon-plugins/wx-java-pay-solon-plugin/src/main/java/com/binarywang/solon/wxjava/pay/properties/WxPayProperties.java new file mode 100644 index 0000000000..fe024f59f1 --- /dev/null +++ b/solon-plugins/wx-java-pay-solon-plugin/src/main/java/com/binarywang/solon/wxjava/pay/properties/WxPayProperties.java @@ -0,0 +1,132 @@ +package com.binarywang.solon.wxjava.pay.properties; + +import lombok.Data; +import org.noear.solon.annotation.Configuration; +import org.noear.solon.annotation.Inject; + +/** + *
+ * 微信支付属性配置类 + * Created by Binary Wang on 2019/4/17. + *+ * + * @author Binary Wang + */ +@Data +@Configuration +@Inject("${wx.pay}") +public class WxPayProperties { + /** + * 设置微信公众号或者小程序等的appid. + */ + private String appId; + + /** + * 微信支付商户号. + */ + private String mchId; + + /** + * 微信支付商户密钥. + */ + private String mchKey; + + /** + * 服务商模式下的子商户公众账号ID,普通模式请不要配置,请在配置文件中将对应项删除. + */ + private String subAppId; + + /** + * 服务商模式下的子商户号,普通模式请不要配置,最好是请在配置文件中将对应项删除. + */ + private String subMchId; + + /** + * apiclient_cert.p12文件的绝对路径,或者如果放在项目中,请以classpath:开头指定. + */ + private String keyPath; + + /** + * 微信支付分serviceId + */ + private String serviceId; + + /** + * 证书序列号 + */ + private String certSerialNo; + + /** + * apiV3秘钥 + */ + private String apiV3Key; + + /** + * 微信支付分回调地址 + */ + private String payScoreNotifyUrl; + + /** + * apiv3 商户apiclient_key.pem + */ + private String privateKeyPath; + + /** + * apiv3 商户apiclient_cert.pem + */ + private String privateCertPath; + + /** + * 微信支付是否使用仿真测试环境. + * 默认不使用 + */ + private boolean useSandboxEnv; + + /** + * 微信支付异步回调地址,通知url必须为直接可访问的url,不能携带参数 + */ + private String notifyUrl; + + /** + * 退款结果异步回调地址,通知url必须为直接可访问的url,不能携带参数. + */ + private String refundNotifyUrl; + + /** + * 微信支付分授权回调地址 + */ + private String payScorePermissionNotifyUrl; + + /** + * 公钥ID + */ + private String publicKeyId; + + /** + * pub_key.pem证书文件的绝对路径或者以classpath:开头的类路径. + */ + private String publicKeyPath; + + /** + * 自定义API主机地址,用于替换默认的 https://api.mch.weixin.qq.com + * 例如:http://proxy.company.com:8080 + */ + private String apiHostUrl; + + /** + * 自定义API主机路径前缀(用于代理入口前缀) + * 例如:/api-weixin + */ + private String apiHostUrlPath; + + /** + * 是否将全部v3接口的请求都添加Wechatpay-Serial请求头,默认添加 + */ + private boolean strictlyNeedWechatPaySerial = true; + + /** + * 是否完全使用公钥模式(用以微信从平台证书到公钥的灰度切换),默认使用 + */ + private boolean fullPublicKeyModel = true; + +} diff --git a/solon-plugins/wx-java-pay-solon-plugin/src/main/resources/META-INF/solon/wx-java-pay-solon-plugin.properties b/solon-plugins/wx-java-pay-solon-plugin/src/main/resources/META-INF/solon/wx-java-pay-solon-plugin.properties new file mode 100644 index 0000000000..98783176e2 --- /dev/null +++ b/solon-plugins/wx-java-pay-solon-plugin/src/main/resources/META-INF/solon/wx-java-pay-solon-plugin.properties @@ -0,0 +1,2 @@ +solon.plugin=com.binarywang.solon.wxjava.pay.integration.WxPayPluginImpl +solon.plugin.priority=10 diff --git a/solon-plugins/wx-java-pay-solon-plugin/src/test/java/features/test/LoadTest.java b/solon-plugins/wx-java-pay-solon-plugin/src/test/java/features/test/LoadTest.java new file mode 100644 index 0000000000..d049f5a51a --- /dev/null +++ b/solon-plugins/wx-java-pay-solon-plugin/src/test/java/features/test/LoadTest.java @@ -0,0 +1,15 @@ +package features.test; + +import org.junit.jupiter.api.Test; +import org.noear.solon.test.SolonTest; + +/** + * @author noear 2024/9/4 created + */ +@SolonTest +public class LoadTest { + @Test + public void load(){ + + } +} diff --git a/solon-plugins/wx-java-pay-solon-plugin/src/test/resources/app.yml b/solon-plugins/wx-java-pay-solon-plugin/src/test/resources/app.yml new file mode 100644 index 0000000000..1d6a61d7e5 --- /dev/null +++ b/solon-plugins/wx-java-pay-solon-plugin/src/test/resources/app.yml @@ -0,0 +1,6 @@ +wx: + pay: + appId: + mchId: + mchKey: + keyPath: diff --git a/solon-plugins/wx-java-qidian-solon-plugin/README.md b/solon-plugins/wx-java-qidian-solon-plugin/README.md new file mode 100644 index 0000000000..42daa3e4c8 --- /dev/null +++ b/solon-plugins/wx-java-qidian-solon-plugin/README.md @@ -0,0 +1,45 @@ +# wx-java-qidian-solon-plugin + +## 快速开始 + +1. 引入依赖 + ```xml +
{@link com.binarywang.wxjava.store.api.WxStoreService#setMaxRetryTimes(int)}
+ *{@link com.binarywang.wxjava.store.api.impl.BaseWxStoreServiceImpl#setMaxRetryTimes(int)}
+ */ + private int maxRetryTimes = 5; + + /** + * http 请求重试间隔 + * + *{@link com.binarywang.wxjava.store.api.WxStoreService#setRetrySleepMillis(int)}
+ *{@link com.binarywang.wxjava.store.api.impl.BaseWxStoreServiceImpl#setRetrySleepMillis(int)}
+ */ + private int retrySleepMillis = 1000; + } +} diff --git a/solon-plugins/wx-java-store-multi-solon-plugin/src/main/java/com/binarywang/solon/wxjava/store/properties/WxStoreMultiRedisProperties.java b/solon-plugins/wx-java-store-multi-solon-plugin/src/main/java/com/binarywang/solon/wxjava/store/properties/WxStoreMultiRedisProperties.java new file mode 100644 index 0000000000..1df12ab720 --- /dev/null +++ b/solon-plugins/wx-java-store-multi-solon-plugin/src/main/java/com/binarywang/solon/wxjava/store/properties/WxStoreMultiRedisProperties.java @@ -0,0 +1,63 @@ +package com.binarywang.solon.wxjava.store.properties; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * Redis配置 + * + * @author Winnie + * @date 2024/9/13 + */ +@Data +@NoArgsConstructor +public class WxStoreMultiRedisProperties implements Serializable { + private static final long serialVersionUID = 9061055444734277357L; + + /** + * 主机地址. + */ + private String host = "127.0.0.1"; + + /** + * 端口号. + */ + private int port = 6379; + + /** + * 密码. + */ + private String password; + + /** + * 超时. + */ + private int timeout = 2000; + + /** + * 数据库. + */ + private int database = 0; + + /** + * 最大活动连接数 + */ + private Integer maxActive; + + /** + * 最大空闲连接数 + */ + private Integer maxIdle; + + /** + * 最小空闲连接数 + */ + private Integer minIdle; + + /** + * 最大等待时间 + */ + private Integer maxWaitMillis; +} diff --git a/solon-plugins/wx-java-store-multi-solon-plugin/src/main/java/com/binarywang/solon/wxjava/store/properties/WxStoreSingleProperties.java b/solon-plugins/wx-java-store-multi-solon-plugin/src/main/java/com/binarywang/solon/wxjava/store/properties/WxStoreSingleProperties.java new file mode 100644 index 0000000000..47c31fe886 --- /dev/null +++ b/solon-plugins/wx-java-store-multi-solon-plugin/src/main/java/com/binarywang/solon/wxjava/store/properties/WxStoreSingleProperties.java @@ -0,0 +1,43 @@ +package com.binarywang.solon.wxjava.store.properties; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * 微信小店相关配置属性 + * + * @author Winnie + * @date 2024/9/13 + */ +@Data +@NoArgsConstructor +public class WxStoreSingleProperties implements Serializable { + private static final long serialVersionUID = 5306630351265124825L; + + /** + * 设置微信小店的 appid. + */ + private String appId; + + /** + * 设置微信小店的 secret. + */ + private String secret; + + /** + * 设置微信小店的 token. + */ + private String token; + + /** + * 设置微信小店的 EncodingAESKey. + */ + private String aesKey; + + /** + * 是否使用稳定版 Access Token + */ + private boolean useStableAccessToken = false; +} diff --git a/solon-plugins/wx-java-store-multi-solon-plugin/src/main/java/com/binarywang/solon/wxjava/store/service/WxStoreMultiServices.java b/solon-plugins/wx-java-store-multi-solon-plugin/src/main/java/com/binarywang/solon/wxjava/store/service/WxStoreMultiServices.java new file mode 100644 index 0000000000..f059819909 --- /dev/null +++ b/solon-plugins/wx-java-store-multi-solon-plugin/src/main/java/com/binarywang/solon/wxjava/store/service/WxStoreMultiServices.java @@ -0,0 +1,26 @@ +package com.binarywang.solon.wxjava.store.service; + +import com.binarywang.wxjava.store.api.WxStoreService; + +/** + * 视频号 {@link WxStoreService} 所有实例存放类. + * + * @author Winnie + * @date 2024/9/13 + */ +public interface WxStoreMultiServices { + /** + * 通过租户 Id 获取 WxStoreService + * + * @param tenantId 租户 Id + * @return WxStoreService + */ + WxStoreService getWxStoreService(String tenantId); + + /** + * 根据租户 Id,从列表中移除一个 WxStoreService 实例 + * + * @param tenantId 租户 Id + */ + void removeWxStoreService(String tenantId); +} diff --git a/solon-plugins/wx-java-store-multi-solon-plugin/src/main/java/com/binarywang/solon/wxjava/store/service/WxStoreMultiServicesImpl.java b/solon-plugins/wx-java-store-multi-solon-plugin/src/main/java/com/binarywang/solon/wxjava/store/service/WxStoreMultiServicesImpl.java new file mode 100644 index 0000000000..daa6cb1305 --- /dev/null +++ b/solon-plugins/wx-java-store-multi-solon-plugin/src/main/java/com/binarywang/solon/wxjava/store/service/WxStoreMultiServicesImpl.java @@ -0,0 +1,36 @@ +package com.binarywang.solon.wxjava.store.service; + +import com.binarywang.wxjava.store.api.WxStoreService; + +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +/** + * 视频号 {@link WxStoreMultiServices} 实现 + * + * @author Winnie + * @date 2024/9/13 + */ +public class WxStoreMultiServicesImpl implements WxStoreMultiServices { + private final Map
+ * {@link com.binarywang.wxjava.store.api.BaseWxStoreService#setRetrySleepMillis(int)}
+ *
+ */
+ private int retrySleepMillis = 1000;
+ /**
+ * http 请求最大重试次数
+ *
+ * {@link com.binarywang.wxjava.store.api.BaseWxStoreService#setMaxRetryTimes(int)}
+ *
+ */
+ private int maxRetryTimes = 5;
+ }
+
+}
diff --git a/solon-plugins/wx-java-store-solon-plugin/src/main/resources/META-INF/solon/wx-java-store-solon-plugin.properties b/solon-plugins/wx-java-store-solon-plugin/src/main/resources/META-INF/solon/wx-java-store-solon-plugin.properties
new file mode 100644
index 0000000000..fd2f516d62
--- /dev/null
+++ b/solon-plugins/wx-java-store-solon-plugin/src/main/resources/META-INF/solon/wx-java-store-solon-plugin.properties
@@ -0,0 +1,2 @@
+solon.plugin=com.binarywang.solon.wxjava.store.integration.WxStorePluginImpl
+solon.plugin.priority=10
diff --git a/solon-plugins/wx-java-store-solon-plugin/src/test/java/features/test/LoadTest.java b/solon-plugins/wx-java-store-solon-plugin/src/test/java/features/test/LoadTest.java
new file mode 100644
index 0000000000..d049f5a51a
--- /dev/null
+++ b/solon-plugins/wx-java-store-solon-plugin/src/test/java/features/test/LoadTest.java
@@ -0,0 +1,15 @@
+package features.test;
+
+import org.junit.jupiter.api.Test;
+import org.noear.solon.test.SolonTest;
+
+/**
+ * @author noear 2024/9/4 created
+ */
+@SolonTest
+public class LoadTest {
+ @Test
+ public void load(){
+
+ }
+}
diff --git a/solon-plugins/wx-java-store-solon-plugin/src/test/resources/app.yml b/solon-plugins/wx-java-store-solon-plugin/src/test/resources/app.yml
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/spring-boot-starters/MULTI_TENANT_MODE_IMPROVEMENT.md b/spring-boot-starters/MULTI_TENANT_MODE_IMPROVEMENT.md
new file mode 100644
index 0000000000..6581f6207d
--- /dev/null
+++ b/spring-boot-starters/MULTI_TENANT_MODE_IMPROVEMENT.md
@@ -0,0 +1,160 @@
+# 多租户模式配置改进说明
+
+## 问题背景
+
+用户在 issue #3835 中提出了一个架构设计问题:
+
+> 基础 Wx 实现类中已经有 configMap 了,可以用 configMap 来存储不同的小程序配置。不同的配置,都是复用同一个 http 客户端。为什么在各个 spring-boot-starter 中又单独创建类来存储不同的配置?从 spring 的配置来看,http 客户端只有一个,不同小程序配置可以实现多租户,所以似乎没必要单独再建新类存放?重复创建,增加了 http 客户端的成本?直接使用 Wx 实现类中已经有 configMap 不是更好吗?
+
+## 解决方案
+
+从 4.8.0 版本开始,我们为多租户 Spring Boot Starter 提供了**两种实现模式**供用户选择:
+
+### 1. 隔离模式(ISOLATED,默认)
+
+**实现方式**:为每个租户创建独立的 WxService 实例,每个实例拥有独立的 HTTP 客户端。
+
+**优点**:
+- ✅ 线程安全,无需担心并发问题
+- ✅ 不依赖 ThreadLocal,适合异步/响应式编程
+- ✅ 租户间完全隔离,互不影响
+
+**缺点**:
+- ❌ 每个租户创建独立的 HTTP 客户端,资源占用较多
+- ❌ 适合租户数量不多的场景(建议 < 50 个租户)
+
+**代码实现**:`WxMaMultiServicesImpl`, `WxMpMultiServicesImpl` 等
+
+### 2. 共享模式(SHARED,新增)
+
+**实现方式**:使用单个 WxService 实例管理所有租户配置,通过 ThreadLocal 切换租户,所有租户共享同一个 HTTP 客户端。
+
+**优点**:
+- ✅ 共享 HTTP 客户端,大幅节省资源
+- ✅ 适合租户数量较多的场景(支持 100+ 租户)
+- ✅ 内存占用更小
+
+**缺点**:
+- ❌ 依赖 ThreadLocal 切换配置,在异步场景需要特别注意
+- ❌ 需要注意线程上下文传递
+
+**代码实现**:`WxMaMultiServicesSharedImpl`, `WxMpMultiServicesSharedImpl` 等
+
+## 使用方式
+
+### 配置示例
+
+```yaml
+wx:
+ ma: # 或 mp, cp, channel
+ apps:
+ tenant1:
+ app-id: wxd898fcb01713c555
+ app-secret: 47a2422a5d04a27e2b3ed1f1f0b0dbad
+ tenant2:
+ app-id: wx1234567890abcdef
+ app-secret: 1234567890abcdef1234567890abcdef
+
+ config-storage:
+ type: memory
+ http-client-type: http_client
+ # 多租户模式配置(新增)
+ multi-tenant-mode: shared # isolated(默认)或 shared
+```
+
+### 代码使用(两种模式代码完全相同)
+
+```java
+@RestController
+public class WxController {
+ @Autowired
+ private WxMaMultiServices wxMaMultiServices; // 或 WxMpMultiServices
+
+ @GetMapping("/api/{tenantId}")
+ public String handle(@PathVariable String tenantId) {
+ WxMaService wxService = wxMaMultiServices.getWxMaService(tenantId);
+ // 使用 wxService 调用微信 API
+ return wxService.getAccessToken();
+ }
+}
+```
+
+## 性能对比
+
+以 100 个租户为例:
+
+| 指标 | 隔离模式 | 共享模式 |
+|------|---------|---------|
+| HTTP 客户端数量 | 100 个 | 1 个 |
+| 内存占用(估算) | ~500MB | ~50MB |
+| 线程安全 | ✅ 完全安全 | ⚠️ 需注意异步场景 |
+| 性能 | 略高(无 ThreadLocal 切换) | 略低(有 ThreadLocal 切换) |
+| 适用场景 | 中小规模 | 大规模 |
+
+## 支持的模块
+
+目前已实现共享模式支持的模块:
+
+- ✅ **小程序(MiniApp)**:`wx-java-miniapp-multi-spring-boot-starter`
+- ✅ **公众号(MP)**:`wx-java-mp-multi-spring-boot-starter`
+
+后续版本将支持:
+- ⏳ 企业微信(CP)
+- ⏳ 视频号(Channel)
+- ⏳ 企业微信第三方应用(CP-TP)
+
+## 迁移指南
+
+### 从旧版本升级
+
+升级到 4.8.0+ 后:
+
+1. **默认行为不变**:如果不配置 `multi-tenant-mode`,将继续使用隔离模式(与旧版本行为一致)
+2. **向后兼容**:所有现有代码无需修改
+3. **可选升级**:如需节省资源,可配置 `multi-tenant-mode: shared` 启用共享模式
+
+### 选择建议
+
+**使用隔离模式(ISOLATED)的场景**:
+- 租户数量较少(< 50 个)
+- 使用异步编程、响应式编程
+- 对线程安全有严格要求
+- 对资源占用不敏感
+
+**使用共享模式(SHARED)的场景**:
+- 租户数量较多(> 50 个)
+- 同步编程场景
+- 对资源占用敏感
+- 可以接受 ThreadLocal 的约束
+
+## 注意事项
+
+### 共享模式下的异步编程
+
+如果使用共享模式,在异步编程时需要注意 ThreadLocal 的传递:
+
+```java
+// ❌ 错误:异步线程无法获取到正确的配置
+CompletableFuture.runAsync(() -> {
+ wxService.getUserService().getUserInfo(...); // 可能使用错误的租户配置
+});
+
+// ✅ 正确:在主线程获取必要信息,传递给异步线程
+String appId = wxService.getWxMaConfig().getAppid();
+CompletableFuture.runAsync(() -> {
+ log.info("AppId: {}", appId); // 使用已获取的配置信息
+});
+```
+
+## 详细文档
+
+- 小程序模块详细说明:[spring-boot-starters/wx-java-miniapp-multi-spring-boot-starter/MULTI_TENANT_MODE.md](spring-boot-starters/wx-java-miniapp-multi-spring-boot-starter/MULTI_TENANT_MODE.md)
+
+## 相关链接
+
+- Issue: [#3835](https://github.com/binarywang/WxJava/issues/3835)
+- Pull Request: [#3840](https://github.com/binarywang/WxJava/pull/3840)
+
+## 致谢
+
+感谢 issue 提出者对项目架构的深入思考和建议,这帮助我们提供了更灵活、更高效的多租户解决方案。
diff --git a/spring-boot-starters/pom.xml b/spring-boot-starters/pom.xml
index 6fce17485a..24c45074bb 100644
--- a/spring-boot-starters/pom.xml
+++ b/spring-boot-starters/pom.xml
@@ -1,10 +1,12 @@
-{@link me.chanjar.weixin.channel.api.WxChannelService#setMaxRetryTimes(int)}
+ *{@link me.chanjar.weixin.channel.api.impl.BaseWxChannelServiceImpl#setMaxRetryTimes(int)}
+ */ + private int maxRetryTimes = 5; + + /** + * http 请求重试间隔 + * + *{@link me.chanjar.weixin.channel.api.WxChannelService#setRetrySleepMillis(int)}
+ *{@link me.chanjar.weixin.channel.api.impl.BaseWxChannelServiceImpl#setRetrySleepMillis(int)}
+ */ + private int retrySleepMillis = 1000; + } +} diff --git a/spring-boot-starters/wx-java-channel-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/channel/properties/WxChannelMultiRedisProperties.java b/spring-boot-starters/wx-java-channel-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/channel/properties/WxChannelMultiRedisProperties.java new file mode 100644 index 0000000000..99c426765c --- /dev/null +++ b/spring-boot-starters/wx-java-channel-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/channel/properties/WxChannelMultiRedisProperties.java @@ -0,0 +1,63 @@ +package com.binarywang.spring.starter.wxjava.channel.properties; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * Redis配置 + * + * @author Winnie + * @date 2024/9/13 + */ +@Data +@NoArgsConstructor +public class WxChannelMultiRedisProperties implements Serializable { + private static final long serialVersionUID = 9061055444734277357L; + + /** + * 主机地址. + */ + private String host = "127.0.0.1"; + + /** + * 端口号. + */ + private int port = 6379; + + /** + * 密码. + */ + private String password; + + /** + * 超时. + */ + private int timeout = 2000; + + /** + * 数据库. + */ + private int database = 0; + + /** + * 最大活动连接数 + */ + private Integer maxActive; + + /** + * 最大空闲连接数 + */ + private Integer maxIdle; + + /** + * 最小空闲连接数 + */ + private Integer minIdle; + + /** + * 最大等待时间 + */ + private Integer maxWaitMillis; +} diff --git a/spring-boot-starters/wx-java-channel-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/channel/properties/WxChannelSingleProperties.java b/spring-boot-starters/wx-java-channel-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/channel/properties/WxChannelSingleProperties.java new file mode 100644 index 0000000000..4b613e3bf6 --- /dev/null +++ b/spring-boot-starters/wx-java-channel-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/channel/properties/WxChannelSingleProperties.java @@ -0,0 +1,55 @@ +package com.binarywang.spring.starter.wxjava.channel.properties; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * 微信视频号相关配置属性 + * + * @author Winnie + * @date 2024/9/13 + */ +@Data +@NoArgsConstructor +public class WxChannelSingleProperties implements Serializable { + private static final long serialVersionUID = 5306630351265124825L; + + /** + * 设置微信视频号的 appid. + */ + private String appId; + + /** + * 设置微信视频号的 secret. + */ + private String secret; + + /** + * 设置微信视频号的 token. + */ + private String token; + + /** + * 设置微信视频号的 EncodingAESKey. + */ + private String aesKey; + + /** + * 是否使用稳定版 Access Token + */ + private boolean useStableAccessToken = false; + + /** + * 自定义API主机地址,用于替换默认的 https://api.weixin.qq.com + * 例如:http://proxy.company.com:8080 + */ + private String apiHostUrl; + + /** + * 自定义获取AccessToken地址,用于向自定义统一服务获取AccessToken + * 例如:http://proxy.company.com:8080/oauth/token + */ + private String accessTokenUrl; +} diff --git a/spring-boot-starters/wx-java-channel-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/channel/service/WxChannelMultiServices.java b/spring-boot-starters/wx-java-channel-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/channel/service/WxChannelMultiServices.java new file mode 100644 index 0000000000..acd4ebf20b --- /dev/null +++ b/spring-boot-starters/wx-java-channel-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/channel/service/WxChannelMultiServices.java @@ -0,0 +1,26 @@ +package com.binarywang.spring.starter.wxjava.channel.service; + +import me.chanjar.weixin.channel.api.WxChannelService; + +/** + * 视频号 {@link WxChannelService} 所有实例存放类. + * + * @author Winnie + * @date 2024/9/13 + */ +public interface WxChannelMultiServices { + /** + * 通过租户 Id 获取 WxChannelService + * + * @param tenantId 租户 Id + * @return WxChannelService + */ + WxChannelService getWxChannelService(String tenantId); + + /** + * 根据租户 Id,从列表中移除一个 WxChannelService 实例 + * + * @param tenantId 租户 Id + */ + void removeWxChannelService(String tenantId); +} diff --git a/spring-boot-starters/wx-java-channel-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/channel/service/WxChannelMultiServicesImpl.java b/spring-boot-starters/wx-java-channel-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/channel/service/WxChannelMultiServicesImpl.java new file mode 100644 index 0000000000..1673289cb5 --- /dev/null +++ b/spring-boot-starters/wx-java-channel-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/channel/service/WxChannelMultiServicesImpl.java @@ -0,0 +1,36 @@ +package com.binarywang.spring.starter.wxjava.channel.service; + +import me.chanjar.weixin.channel.api.WxChannelService; + +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +/** + * 视频号 {@link WxChannelMultiServices} 实现 + * + * @author Winnie + * @date 2024/9/13 + */ +public class WxChannelMultiServicesImpl implements WxChannelMultiServices { + private final Map同一企业(corpId 相同)下可配置多个条目以使用不同的权限 Secret,例如:
+ *但同一 corpId 下不允许出现重复的 agentId(包括多个 null)。
+ * + * 查看 {@link me.chanjar.weixin.cp.config.impl.AbstractWxCpInRedisConfigImpl#setAgentId(Integer)} + */ + Collection
+ * {@link me.chanjar.weixin.cp.api.WxCpService#setMaxRetryTimes(int)}
+ * {@link me.chanjar.weixin.cp.api.impl.BaseWxCpServiceImpl#setMaxRetryTimes(int)}
+ *
+ */
+ private int maxRetryTimes = 5;
+
+ /**
+ * http 请求重试间隔
+ *
+ * {@link me.chanjar.weixin.cp.api.WxCpService#setRetrySleepMillis(int)}
+ * {@link me.chanjar.weixin.cp.api.impl.BaseWxCpServiceImpl#setRetrySleepMillis(int)}
+ *
+ */
+ private int retrySleepMillis = 1000;
+ }
+
+ public enum StorageType {
+ /**
+ * 内存
+ */
+ memory,
+ /**
+ * jedis
+ */
+ jedis,
+ /**
+ * redisson
+ */
+ redisson,
+ /**
+ * redistemplate
+ */
+ redistemplate
+ }
+
+ public enum HttpClientType {
+ /**
+ * HttpClient
+ */
+ HTTP_CLIENT,
+ /**
+ * OkHttp
+ */
+ OK_HTTP,
+ /**
+ * JoddHttp
+ */
+ JODD_HTTP
+ }
+}
diff --git a/spring-boot-starters/wx-java-cp-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/cp/properties/WxCpMultiRedisProperties.java b/spring-boot-starters/wx-java-cp-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/cp/properties/WxCpMultiRedisProperties.java
new file mode 100644
index 0000000000..ea1f257c41
--- /dev/null
+++ b/spring-boot-starters/wx-java-cp-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/cp/properties/WxCpMultiRedisProperties.java
@@ -0,0 +1,48 @@
+package com.binarywang.spring.starter.wxjava.cp.properties;
+
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+/**
+ * Redis配置.
+ *
+ * @author yl
+ * created on 2023/10/16
+ */
+@Data
+@NoArgsConstructor
+public class WxCpMultiRedisProperties implements Serializable {
+ private static final long serialVersionUID = -5924815351660074401L;
+
+ /**
+ * 主机地址.
+ */
+ private String host;
+
+ /**
+ * 端口号.
+ */
+ private int port = 6379;
+
+ /**
+ * 密码.
+ */
+ private String password;
+
+ /**
+ * 超时.
+ */
+ private int timeout = 2000;
+
+ /**
+ * 数据库.
+ */
+ private int database = 0;
+
+ private Integer maxActive;
+ private Integer maxIdle;
+ private Integer maxWaitMillis;
+ private Integer minIdle;
+}
diff --git a/spring-boot-starters/wx-java-cp-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/cp/properties/WxCpSingleProperties.java b/spring-boot-starters/wx-java-cp-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/cp/properties/WxCpSingleProperties.java
new file mode 100644
index 0000000000..740f5a2a3b
--- /dev/null
+++ b/spring-boot-starters/wx-java-cp-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/cp/properties/WxCpSingleProperties.java
@@ -0,0 +1,74 @@
+package com.binarywang.spring.starter.wxjava.cp.properties;
+
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+/**
+ * 企业微信企业相关配置属性
+ *
+ * 企业微信中不同的 corpSecret 对应不同的权限范围,常见的有:
+ *如需同时使用多种权限范围(例如:既要操作通讯录,又要调用自建应用接口), + * 可在 {@code wx.cp.corps} 下配置多个条目,每个条目使用对应权限的 {@code corpSecret}, + * 其中通讯录同步的条目无需填写 {@code agentId}。
+ * + * @author yl + * created on 2023/10/16 + */ +@Data +@NoArgsConstructor +public class WxCpSingleProperties implements Serializable { + private static final long serialVersionUID = -7502823825007859418L; + /** + * 微信企业号 corpId + */ + private String corpId; + /** + * 微信企业号 corpSecret(权限密钥) + * + *企业微信针对不同的功能模块提供了不同的 Secret,每种 Secret 只对对应模块的接口有调用权限:
+ *使用自建应用 Secret 时,需要填写对应应用的 AgentId。
+ *使用通讯录同步 Secret 时,无需填写此字段。
+ */ + private Long agentId; + /** + * 微信企业号应用 EncodingAESKey + */ + private String aesKey; + /** + * 微信企业号应用 会话存档私钥 + */ + private String msgAuditPriKey; + /** + * 微信企业号应用 会话存档类库路径 + */ + private String msgAuditLibPath; + + /** + * 自定义企业微信服务器baseUrl,用于替换默认的 https://qyapi.weixin.qq.com + * 例如:http://proxy.company.com:8080 + */ + private String baseApiUrl; +} diff --git a/spring-boot-starters/wx-java-cp-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/cp/service/WxCpMultiServices.java b/spring-boot-starters/wx-java-cp-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/cp/service/WxCpMultiServices.java new file mode 100644 index 0000000000..dfcb25631d --- /dev/null +++ b/spring-boot-starters/wx-java-cp-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/cp/service/WxCpMultiServices.java @@ -0,0 +1,26 @@ +package com.binarywang.spring.starter.wxjava.cp.service; + +import me.chanjar.weixin.cp.api.WxCpService; + +/** + * 企业微信 {@link WxCpService} 所有实例存放类. + * + * @author yl + * created on 2023/10/16 + */ +public interface WxCpMultiServices { + /** + * 通过租户 Id 获取 WxCpService + * + * @param tenantId 租户 Id + * @return WxCpService + */ + WxCpService getWxCpService(String tenantId); + + /** + * 根据租户 Id,从列表中移除一个 WxCpService 实例 + * + * @param tenantId 租户 Id + */ + void removeWxCpService(String tenantId); +} diff --git a/spring-boot-starters/wx-java-cp-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/cp/service/WxCpMultiServicesImpl.java b/spring-boot-starters/wx-java-cp-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/cp/service/WxCpMultiServicesImpl.java new file mode 100644 index 0000000000..19eae24159 --- /dev/null +++ b/spring-boot-starters/wx-java-cp-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/cp/service/WxCpMultiServicesImpl.java @@ -0,0 +1,42 @@ +package com.binarywang.spring.starter.wxjava.cp.service; + +import me.chanjar.weixin.cp.api.WxCpService; + +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +/** + * 企业微信 {@link WxCpMultiServices} 默认实现 + * + * @author yl + * created on 2023/10/16 + */ +public class WxCpMultiServicesImpl implements WxCpMultiServices { + private final Map
+ * {@link me.chanjar.weixin.cp.api.WxCpService#setMaxRetryTimes(int)}
+ * {@link me.chanjar.weixin.cp.api.impl.BaseWxCpServiceImpl#setMaxRetryTimes(int)}
+ *
+ */
+ private int maxRetryTimes = 5;
+
+ /**
+ * http 请求重试间隔
+ *
+ * {@link me.chanjar.weixin.cp.api.WxCpService#setRetrySleepMillis(int)}
+ * {@link me.chanjar.weixin.cp.api.impl.BaseWxCpServiceImpl#setRetrySleepMillis(int)}
+ *
+ */
+ private int retrySleepMillis = 1000;
+ }
+
+ public enum StorageType {
+ /**
+ * 内存
+ */
+ memory,
+ /**
+ * jedis
+ */
+ jedis,
+ /**
+ * redisson
+ */
+ redisson,
+ /**
+ * redistemplate
+ */
+ redistemplate
+ }
+
+ public enum HttpClientType {
+ /**
+ * HttpClient
+ */
+ HTTP_CLIENT,
+ /**
+ * OkHttp
+ */
+ OK_HTTP,
+ /**
+ * JoddHttp
+ */
+ JODD_HTTP
+ }
+}
diff --git a/spring-boot-starters/wx-java-cp-tp-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/cp/properties/WxCpTpMultiRedisProperties.java b/spring-boot-starters/wx-java-cp-tp-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/cp/properties/WxCpTpMultiRedisProperties.java
new file mode 100644
index 0000000000..b94711216f
--- /dev/null
+++ b/spring-boot-starters/wx-java-cp-tp-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/cp/properties/WxCpTpMultiRedisProperties.java
@@ -0,0 +1,48 @@
+package com.binarywang.spring.starter.wxjava.cp.properties;
+
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+/**
+ * Redis配置.
+ *
+ * @author yl
+ * created on 2023/10/16
+ */
+@Data
+@NoArgsConstructor
+public class WxCpTpMultiRedisProperties implements Serializable {
+ private static final long serialVersionUID = -5924815351660074401L;
+
+ /**
+ * 主机地址.
+ */
+ private String host;
+
+ /**
+ * 端口号.
+ */
+ private int port = 6379;
+
+ /**
+ * 密码.
+ */
+ private String password;
+
+ /**
+ * 超时.
+ */
+ private int timeout = 2000;
+
+ /**
+ * 数据库.
+ */
+ private int database = 0;
+
+ private Integer maxActive;
+ private Integer maxIdle;
+ private Integer maxWaitMillis;
+ private Integer minIdle;
+}
diff --git a/spring-boot-starters/wx-java-cp-tp-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/cp/properties/WxCpTpSingleProperties.java b/spring-boot-starters/wx-java-cp-tp-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/cp/properties/WxCpTpSingleProperties.java
new file mode 100644
index 0000000000..02a52657db
--- /dev/null
+++ b/spring-boot-starters/wx-java-cp-tp-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/cp/properties/WxCpTpSingleProperties.java
@@ -0,0 +1,43 @@
+package com.binarywang.spring.starter.wxjava.cp.properties;
+
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+/**
+ * 企业微信企业相关配置属性
+ *
+ * @author yl
+ * created on 2023/10/16
+ */
+@Data
+@NoArgsConstructor
+public class WxCpTpSingleProperties implements Serializable {
+ private static final long serialVersionUID = -7502823825007859418L;
+ /**
+ * 微信企业号 corpId
+ */
+ private String corpId;
+ /**
+ * 微信企业号 服务商 providerSecret
+ */
+ private String providerSecret;
+ /**
+ * 微信企业号应用 token
+ */
+ private String token;
+
+ private String encodingAESKey;
+
+ /**
+ * 微信企业号 第三方 应用 ID
+ */
+ private String suiteId;
+ /**
+ * 微信企业号应用
+ */
+ private String suiteSecret;
+
+
+}
diff --git a/spring-boot-starters/wx-java-cp-tp-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/cp/service/WxCpTpMultiServices.java b/spring-boot-starters/wx-java-cp-tp-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/cp/service/WxCpTpMultiServices.java
new file mode 100644
index 0000000000..c0a9faf51e
--- /dev/null
+++ b/spring-boot-starters/wx-java-cp-tp-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/cp/service/WxCpTpMultiServices.java
@@ -0,0 +1,29 @@
+package com.binarywang.spring.starter.wxjava.cp.service;
+
+
+import me.chanjar.weixin.cp.tp.service.WxCpTpService;
+
+/**
+ * 企业微信 {@link WxCpTpService} 所有实例存放类.
+ *
+ * @author yl
+ * created on 2023/10/16
+ */
+public interface WxCpTpMultiServices {
+ /**
+ * 通过租户 Id 获取 WxCpTpService
+ *
+ * @param tenantId 租户 Id
+ * @return WxCpTpService
+ */
+ WxCpTpService getWxCpTpService(String tenantId);
+
+ void addWxCpTpService(String tenantId, WxCpTpService wxCpService);
+
+ /**
+ * 根据租户 Id,从列表中移除一个 WxCpTpService 实例
+ *
+ * @param tenantId 租户 Id
+ */
+ void removeWxCpTpService(String tenantId);
+}
diff --git a/spring-boot-starters/wx-java-cp-tp-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/cp/service/WxCpTpMultiServicesImpl.java b/spring-boot-starters/wx-java-cp-tp-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/cp/service/WxCpTpMultiServicesImpl.java
new file mode 100644
index 0000000000..84b381230c
--- /dev/null
+++ b/spring-boot-starters/wx-java-cp-tp-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/cp/service/WxCpTpMultiServicesImpl.java
@@ -0,0 +1,44 @@
+package com.binarywang.spring.starter.wxjava.cp.service;
+
+
+import me.chanjar.weixin.cp.tp.service.WxCpTpService;
+
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+/**
+ * 企业微信 {@link WxCpTpMultiServices} 默认实现
+ *
+ * @author yl
+ * created on 2023/10/16
+ */
+public class WxCpTpMultiServicesImpl implements WxCpTpMultiServices {
+ private final Map
+ * {@link cn.binarywang.wx.miniapp.api.WxMaService#setMaxRetryTimes(int)}
+ * {@link cn.binarywang.wx.miniapp.api.impl.BaseWxMaServiceImpl#setMaxRetryTimes(int)}
+ *
+ */
+ private int maxRetryTimes = 5;
+
+ /**
+ * http 请求重试间隔
+ *
+ * {@link cn.binarywang.wx.miniapp.api.WxMaService#setRetrySleepMillis(int)}
+ * {@link cn.binarywang.wx.miniapp.api.impl.BaseWxMaServiceImpl#setRetrySleepMillis(int)}
+ *
+ */
+ private int retrySleepMillis = 1000;
+
+ /**
+ * 多租户实现模式.
+ * + * 使用单个 WxMaService 实例管理多个租户配置,通过 switchover 切换租户。 + * 相比 {@link WxMaMultiServicesImpl},此实现共享 HTTP 客户端,节省资源。 + *
+ *+ * 注意:由于使用 ThreadLocal 切换配置,在异步或多线程场景需要特别注意线程上下文切换。 + *
+ * + * @author Binary Wang + * created on 2026/1/9 + */ +@RequiredArgsConstructor +public class WxMaMultiServicesSharedImpl implements WxMaMultiServices { + private final WxMaService sharedWxMaService; + + @Override + public WxMaService getWxMaService(String tenantId) { + if (tenantId == null) { + return null; + } + // 使用 switchover 检查配置是否存在,保持与隔离模式 API 行为一致(不存在时返回 null) + if (!sharedWxMaService.switchover(tenantId)) { + return null; + } + return sharedWxMaService; + } + + @Override + public void removeWxMaService(String tenantId) { + if (tenantId != null) { + sharedWxMaService.removeConfig(tenantId); + } + } + + /** + * 添加租户配置到共享的 WxMaService 实例 + * + * @param tenantId 租户 ID + * @param wxMaService 要添加配置的 WxMaService(仅使用其配置,不使用其实例) + */ + public void addWxMaService(String tenantId, WxMaService wxMaService) { + if (tenantId != null && wxMaService != null) { + sharedWxMaService.addConfig(tenantId, wxMaService.getWxMaConfig()); + } + } +} diff --git a/spring-boot-starters/wx-java-miniapp-multi-spring-boot-starter/src/main/resources/META-INF/spring.factories b/spring-boot-starters/wx-java-miniapp-multi-spring-boot-starter/src/main/resources/META-INF/spring.factories new file mode 100644 index 0000000000..bc9bec9bfb --- /dev/null +++ b/spring-boot-starters/wx-java-miniapp-multi-spring-boot-starter/src/main/resources/META-INF/spring.factories @@ -0,0 +1,2 @@ +org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ +com.binarywang.spring.starter.wxjava.miniapp.autoconfigure.WxMaMultiAutoConfiguration diff --git a/spring-boot-starters/wx-java-miniapp-multi-spring-boot-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/spring-boot-starters/wx-java-miniapp-multi-spring-boot-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports new file mode 100644 index 0000000000..3023f06bdd --- /dev/null +++ b/spring-boot-starters/wx-java-miniapp-multi-spring-boot-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -0,0 +1 @@ +com.binarywang.spring.starter.wxjava.miniapp.autoconfigure.WxMaMultiAutoConfiguration diff --git a/spring-boot-starters/wx-java-miniapp-spring-boot-starter/README.md b/spring-boot-starters/wx-java-miniapp-spring-boot-starter/README.md index 82f6bdd8b1..cbf0b53925 100644 --- a/spring-boot-starters/wx-java-miniapp-spring-boot-starter/README.md +++ b/spring-boot-starters/wx-java-miniapp-spring-boot-starter/README.md @@ -10,12 +10,13 @@ ``` 2. 添加配置(application.properties) ```properties - # 公众号配置(必填) + # 小程序配置(必填) wx.miniapp.appid = appId wx.miniapp.secret = @secret wx.miniapp.token = @token wx.miniapp.aesKey = @aesKey wx.miniapp.msgDataFormat = @msgDataFormat # 消息格式,XML或者JSON. + wx.miniapp.use-stable-access-token=@useStableAccessToken # 存储配置redis(可选) # 注意: 指定redis.host值后不会使用容器注入的redis连接(JedisPool) wx.miniapp.config-storage.type = Jedis # 配置类型: Memory(默认), Jedis, RedisTemplate diff --git a/spring-boot-starters/wx-java-miniapp-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-miniapp-spring-boot-starter/pom.xml index 738f6e6b05..3a2bc80986 100644 --- a/spring-boot-starters/wx-java-miniapp-spring-boot-starter/pom.xml +++ b/spring-boot-starters/wx-java-miniapp-spring-boot-starter/pom.xml @@ -4,7 +4,7 @@
+ * {@link me.chanjar.weixin.mp.api.WxMpService#setMaxRetryTimes(int)}
+ * {@link me.chanjar.weixin.mp.api.impl.BaseWxMpServiceImpl#setMaxRetryTimes(int)}
+ *
+ */
+ private int maxRetryTimes = 5;
+
+ /**
+ * http 请求重试间隔
+ *
+ * {@link me.chanjar.weixin.mp.api.WxMpService#setRetrySleepMillis(int)}
+ * {@link me.chanjar.weixin.mp.api.impl.BaseWxMpServiceImpl#setRetrySleepMillis(int)}
+ *
+ */
+ private int retrySleepMillis = 1000;
+
+ /**
+ * 多租户实现模式.
+ * + * 使用单个 WxMpService 实例管理多个租户配置,通过 switchover 切换租户。 + * 相比 {@link WxMpMultiServicesImpl},此实现共享 HTTP 客户端,节省资源。 + *
+ *+ * 注意:由于使用 ThreadLocal 切换配置,在异步或多线程场景需要特别注意线程上下文切换。 + *
+ * + * @author Binary Wang + * created on 2026/1/9 + */ +@RequiredArgsConstructor +public class WxMpMultiServicesSharedImpl implements WxMpMultiServices { + private final WxMpService sharedWxMpService; + + @Override + public WxMpService getWxMpService(String tenantId) { + if (tenantId == null) { + return null; + } + // 使用 switchover 检查配置是否存在,保持与隔离模式 API 行为一致(不存在时返回 null) + if (!sharedWxMpService.switchover(tenantId)) { + return null; + } + return sharedWxMpService; + } + + @Override + public void removeWxMpService(String tenantId) { + if (tenantId != null) { + sharedWxMpService.removeConfigStorage(tenantId); + } + } + + /** + * 添加租户配置到共享的 WxMpService 实例 + * + * @param tenantId 租户 ID + * @param wxMpService 要添加配置的 WxMpService(仅使用其配置,不使用其实例) + */ + public void addWxMpService(String tenantId, WxMpService wxMpService) { + if (tenantId != null && wxMpService != null) { + sharedWxMpService.addConfigStorage(tenantId, wxMpService.getWxMpConfigStorage()); + } + } +} diff --git a/spring-boot-starters/wx-java-mp-multi-spring-boot-starter/src/main/resources/META-INF/spring.factories b/spring-boot-starters/wx-java-mp-multi-spring-boot-starter/src/main/resources/META-INF/spring.factories new file mode 100644 index 0000000000..d20dc22dc3 --- /dev/null +++ b/spring-boot-starters/wx-java-mp-multi-spring-boot-starter/src/main/resources/META-INF/spring.factories @@ -0,0 +1,2 @@ +org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ +com.binarywang.spring.starter.wxjava.mp.autoconfigure.WxMpMultiAutoConfiguration diff --git a/spring-boot-starters/wx-java-mp-multi-spring-boot-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/spring-boot-starters/wx-java-mp-multi-spring-boot-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports new file mode 100644 index 0000000000..324e3555ba --- /dev/null +++ b/spring-boot-starters/wx-java-mp-multi-spring-boot-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -0,0 +1 @@ +com.binarywang.spring.starter.wxjava.mp.autoconfigure.WxMpMultiAutoConfiguration diff --git a/spring-boot-starters/wx-java-mp-spring-boot-starter/README.md b/spring-boot-starters/wx-java-mp-spring-boot-starter/README.md index 81a075432f..091912cfad 100644 --- a/spring-boot-starters/wx-java-mp-spring-boot-starter/README.md +++ b/spring-boot-starters/wx-java-mp-spring-boot-starter/README.md @@ -1,5 +1,7 @@ # wx-java-mp-spring-boot-starter + ## 快速开始 + 1. 引入依赖 ```xml
+ * {@link me.chanjar.weixin.mp.api.impl.BaseWxMpServiceImpl#setMaxRetryTimes(int)}
+ * {@link cn.binarywang.wx.miniapp.api.impl.BaseWxMaServiceImpl#setMaxRetryTimes(int)}
+ *
+ */
+ private int maxRetryTimes = 5;
+
+ /**
+ * http 请求重试间隔
+ *
+ * {@link me.chanjar.weixin.mp.api.impl.BaseWxMpServiceImpl#setRetrySleepMillis(int)}
+ * {@link cn.binarywang.wx.miniapp.api.impl.BaseWxMaServiceImpl#setRetrySleepMillis(int)}
+ *
+ */
+ private int retrySleepMillis = 1000;
+
+ /**
+ * 连接超时时间,单位毫秒
+ */
+ private int connectionTimeout = 5000;
+
+ /**
+ * 读数据超时时间,即socketTimeout,单位毫秒
+ */
+ private int soTimeout = 5000;
+
+ /**
+ * 从连接池获取链接的超时时间,单位毫秒
+ */
+ private int connectionRequestTimeout = 5000;
+ }
+
+ public enum StorageType {
+ /**
+ * 内存
+ */
+ memory,
+ /**
+ * jedis
+ */
+ jedis,
+ /**
+ * redisson
+ */
+ redisson,
+ /**
+ * redisTemplate
+ */
+ redistemplate
+ }
+
+ public enum HttpClientType {
+ /**
+ * Apache HttpClient 4.x
+ */
+ APACHE_HTTP,
+ /**
+ * Apache HttpClient 5.x (HttpComponents)
+ */
+ HTTP_COMPONENTS
+ }
+
+}
diff --git a/spring-boot-starters/wx-java-open-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/open/properties/WxOpenMultiRedisProperties.java b/spring-boot-starters/wx-java-open-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/open/properties/WxOpenMultiRedisProperties.java
new file mode 100644
index 0000000000..ae6d5368d7
--- /dev/null
+++ b/spring-boot-starters/wx-java-open-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/open/properties/WxOpenMultiRedisProperties.java
@@ -0,0 +1,57 @@
+package com.binarywang.spring.starter.wxjava.open.properties;
+
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+/**
+ * 微信开放平台多账号Redis配置.
+ *
+ * @author Binary Wang
+ */
+@Data
+@NoArgsConstructor
+public class WxOpenMultiRedisProperties implements Serializable {
+ private static final long serialVersionUID = -5924815351660074401L;
+
+ /**
+ * 主机地址.
+ */
+ private String host = "127.0.0.1";
+
+ /**
+ * 端口号.
+ */
+ private int port = 6379;
+
+ /**
+ * 密码.
+ */
+ private String password;
+
+ /**
+ * 超时.
+ */
+ private int timeout = 2000;
+
+ /**
+ * 数据库.
+ */
+ private int database = 0;
+
+ /**
+ * sentinel ips
+ */
+ private String sentinelIps;
+
+ /**
+ * sentinel name
+ */
+ private String sentinelName;
+
+ private Integer maxActive;
+ private Integer maxIdle;
+ private Integer maxWaitMillis;
+ private Integer minIdle;
+}
diff --git a/spring-boot-starters/wx-java-open-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/open/properties/WxOpenSingleProperties.java b/spring-boot-starters/wx-java-open-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/open/properties/WxOpenSingleProperties.java
new file mode 100644
index 0000000000..116da323dc
--- /dev/null
+++ b/spring-boot-starters/wx-java-open-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/open/properties/WxOpenSingleProperties.java
@@ -0,0 +1,49 @@
+package com.binarywang.spring.starter.wxjava.open.properties;
+
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+/**
+ * 微信开放平台单个应用配置.
+ *
+ * @author Binary Wang
+ */
+@Data
+@NoArgsConstructor
+public class WxOpenSingleProperties implements Serializable {
+ private static final long serialVersionUID = 1980986361098922525L;
+
+ /**
+ * 设置微信开放平台的appid.
+ */
+ private String appId;
+
+ /**
+ * 设置微信开放平台的app secret.
+ */
+ private String secret;
+
+ /**
+ * 设置微信开放平台的token.
+ */
+ private String token;
+
+ /**
+ * 设置微信开放平台的EncodingAESKey.
+ */
+ private String aesKey;
+
+ /**
+ * 自定义API主机地址,用于替换默认的 https://api.weixin.qq.com
+ * 例如:http://proxy.company.com:8080
+ */
+ private String apiHostUrl;
+
+ /**
+ * 自定义获取AccessToken地址,用于向自定义统一服务获取AccessToken
+ * 例如:http://proxy.company.com:8080/oauth/token
+ */
+ private String accessTokenUrl;
+}
diff --git a/spring-boot-starters/wx-java-open-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/open/service/WxOpenMultiServices.java b/spring-boot-starters/wx-java-open-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/open/service/WxOpenMultiServices.java
new file mode 100644
index 0000000000..9228071a10
--- /dev/null
+++ b/spring-boot-starters/wx-java-open-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/open/service/WxOpenMultiServices.java
@@ -0,0 +1,26 @@
+package com.binarywang.spring.starter.wxjava.open.service;
+
+
+import me.chanjar.weixin.open.api.WxOpenService;
+
+/**
+ * 微信开放平台 {@link WxOpenService} 所有实例存放类.
+ *
+ * @author binarywang
+ */
+public interface WxOpenMultiServices {
+ /**
+ * 通过租户 Id 获取 WxOpenService
+ *
+ * @param tenantId 租户 Id
+ * @return WxOpenService
+ */
+ WxOpenService getWxOpenService(String tenantId);
+
+ /**
+ * 根据租户 Id,从列表中移除一个 WxOpenService 实例
+ *
+ * @param tenantId 租户 Id
+ */
+ void removeWxOpenService(String tenantId);
+}
diff --git a/spring-boot-starters/wx-java-open-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/open/service/WxOpenMultiServicesImpl.java b/spring-boot-starters/wx-java-open-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/open/service/WxOpenMultiServicesImpl.java
new file mode 100644
index 0000000000..76fb139e6c
--- /dev/null
+++ b/spring-boot-starters/wx-java-open-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/open/service/WxOpenMultiServicesImpl.java
@@ -0,0 +1,35 @@
+package com.binarywang.spring.starter.wxjava.open.service;
+
+import me.chanjar.weixin.open.api.WxOpenService;
+
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+/**
+ * 微信开放平台 {@link WxOpenMultiServices} 默认实现
+ *
+ * @author Binary Wang
+ */
+public class WxOpenMultiServicesImpl implements WxOpenMultiServices {
+ private final Map+ * 注意:configKey 是配置文件中定义的 key(如 wx.pay.configs.<configKey>.xxx), + * 而不是 appId。如果使用 appId 作为配置 key,则可以直接传入 appId。 + *
+ * + * @param configKey 配置标识(配置文件中 wx.pay.configs 下的 key) + * @return WxPayService + */ + WxPayService getWxPayService(String configKey); + + /** + * 根据配置标识,从列表中移除一个 WxPayService 实例. + *+ * 注意:configKey 是配置文件中定义的 key(如 wx.pay.configs.<configKey>.xxx), + * 而不是 appId。如果使用 appId 作为配置 key,则可以直接传入 appId。 + *
+ * + * @param configKey 配置标识(配置文件中 wx.pay.configs 下的 key) + */ + void removeWxPayService(String configKey); +} diff --git a/spring-boot-starters/wx-java-pay-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/pay/service/WxPayMultiServicesImpl.java b/spring-boot-starters/wx-java-pay-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/pay/service/WxPayMultiServicesImpl.java new file mode 100644 index 0000000000..7cbcceabb4 --- /dev/null +++ b/spring-boot-starters/wx-java-pay-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/pay/service/WxPayMultiServicesImpl.java @@ -0,0 +1,93 @@ +package com.binarywang.spring.starter.wxjava.pay.service; + +import com.binarywang.spring.starter.wxjava.pay.properties.WxPayMultiProperties; +import com.binarywang.spring.starter.wxjava.pay.properties.WxPaySingleProperties; +import com.github.binarywang.wxpay.config.WxPayConfig; +import com.github.binarywang.wxpay.service.WxPayService; +import com.github.binarywang.wxpay.service.impl.WxPayServiceImpl; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; + +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +/** + * 微信支付多服务管理实现类. + * + * @author Binary Wang + */ +@Slf4j +public class WxPayMultiServicesImpl implements WxPayMultiServices { + private final Map+ * 本示例展示了如何使用 wx-java-pay-multi-spring-boot-starter 来管理多个公众号的支付配置。 + *
+ * + * @author Binary Wang + */ +@Slf4j +@Service +public class WxPayMultiExample { + + @Autowired + private WxPayMultiServices wxPayMultiServices; + + /** + * 示例1:根据appId创建支付订单. + *+ * 适用场景:系统需要支持多个公众号,根据用户所在的公众号动态选择支付配置 + *
+ * + * @param appId 公众号appId + * @param openId 用户的openId + * @param totalFee 支付金额(分) + * @param body 商品描述 + * @return JSAPI支付参数 + */ + public WxPayUnifiedOrderV3Result.JsapiResult createJsapiOrder(String appId, String openId, + Integer totalFee, String body) { + try { + // 根据appId获取对应的WxPayService + WxPayService wxPayService = wxPayMultiServices.getWxPayService(appId); + + if (wxPayService == null) { + log.error("未找到appId对应的微信支付配置: {}", appId); + throw new IllegalArgumentException("未找到appId对应的微信支付配置"); + } + + // 构建支付请求 + WxPayUnifiedOrderV3Request request = new WxPayUnifiedOrderV3Request(); + request.setOutTradeNo(generateOutTradeNo()); + request.setDescription(body); + request.setAmount(new WxPayUnifiedOrderV3Request.Amount().setTotal(totalFee)); + request.setPayer(new WxPayUnifiedOrderV3Request.Payer().setOpenid(openId)); + request.setNotifyUrl(wxPayService.getConfig().getNotifyUrl()); + + // 调用微信支付API创建订单 + WxPayUnifiedOrderV3Result.JsapiResult result = + wxPayService.createOrderV3(TradeTypeEnum.JSAPI, request); + + log.info("创建JSAPI支付订单成功,appId: {}, outTradeNo: {}", appId, request.getOutTradeNo()); + return result; + + } catch (Exception e) { + log.error("创建JSAPI支付订单失败,appId: {}", appId, e); + throw new RuntimeException("创建支付订单失败", e); + } + } + + /** + * 示例2:服务商模式 - 为不同子商户创建订单. + *+ * 适用场景:服务商为多个子商户提供支付服务 + *
+ * + * @param configKey 配置标识(在配置文件中定义) + * @param subOpenId 子商户用户的openId + * @param totalFee 支付金额(分) + * @param body 商品描述 + * @return JSAPI支付参数 + */ + public WxPayUnifiedOrderV3Result.JsapiResult createPartnerOrder(String configKey, String subOpenId, + Integer totalFee, String body) { + try { + // 根据配置标识获取WxPayService + WxPayService wxPayService = wxPayMultiServices.getWxPayService(configKey); + + if (wxPayService == null) { + log.error("未找到配置: {}", configKey); + throw new IllegalArgumentException("未找到配置"); + } + + // 获取子商户信息 + String subAppId = wxPayService.getConfig().getSubAppId(); + String subMchId = wxPayService.getConfig().getSubMchId(); + log.info("使用服务商模式,子商户appId: {}, 子商户号: {}", subAppId, subMchId); + + // 构建支付请求 + WxPayUnifiedOrderV3Request request = new WxPayUnifiedOrderV3Request(); + request.setOutTradeNo(generateOutTradeNo()); + request.setDescription(body); + request.setAmount(new WxPayUnifiedOrderV3Request.Amount().setTotal(totalFee)); + request.setPayer(new WxPayUnifiedOrderV3Request.Payer().setOpenid(subOpenId)); + request.setNotifyUrl(wxPayService.getConfig().getNotifyUrl()); + + // 调用微信支付API创建订单 + WxPayUnifiedOrderV3Result.JsapiResult result = + wxPayService.createOrderV3(TradeTypeEnum.JSAPI, request); + + log.info("创建服务商支付订单成功,配置: {}, outTradeNo: {}", configKey, request.getOutTradeNo()); + return result; + + } catch (Exception e) { + log.error("创建服务商支付订单失败,配置: {}", configKey, e); + throw new RuntimeException("创建支付订单失败", e); + } + } + + /** + * 示例3:查询订单状态. + *+ * 适用场景:查询不同公众号的订单支付状态 + *
+ * + * @param appId 公众号appId + * @param outTradeNo 商户订单号 + * @return 订单状态 + */ + public String queryOrderStatus(String appId, String outTradeNo) { + try { + WxPayService wxPayService = wxPayMultiServices.getWxPayService(appId); + + if (wxPayService == null) { + log.error("未找到appId对应的微信支付配置: {}", appId); + throw new IllegalArgumentException("未找到appId对应的微信支付配置"); + } + + // 查询订单 + WxPayOrderQueryV3Result result = wxPayService.queryOrderV3(null, outTradeNo); + String tradeState = result.getTradeState(); + + log.info("查询订单状态成功,appId: {}, outTradeNo: {}, 状态: {}", appId, outTradeNo, tradeState); + return tradeState; + + } catch (Exception e) { + log.error("查询订单状态失败,appId: {}, outTradeNo: {}", appId, outTradeNo, e); + throw new RuntimeException("查询订单失败", e); + } + } + + /** + * 示例4:申请退款. + *+ * 适用场景:为不同公众号的订单申请退款 + *
+ * + * @param appId 公众号appId + * @param outTradeNo 商户订单号 + * @param refundFee 退款金额(分) + * @param totalFee 订单总金额(分) + * @param reason 退款原因 + * @return 退款单号 + */ + public String refund(String appId, String outTradeNo, Integer refundFee, + Integer totalFee, String reason) { + try { + WxPayService wxPayService = wxPayMultiServices.getWxPayService(appId); + + if (wxPayService == null) { + log.error("未找到appId对应的微信支付配置: {}", appId); + throw new IllegalArgumentException("未找到appId对应的微信支付配置"); + } + + // 构建退款请求 + com.github.binarywang.wxpay.bean.request.WxPayRefundV3Request request = + new com.github.binarywang.wxpay.bean.request.WxPayRefundV3Request(); + request.setOutTradeNo(outTradeNo); + request.setOutRefundNo(generateRefundNo()); + request.setReason(reason); + request.setNotifyUrl(wxPayService.getConfig().getRefundNotifyUrl()); + + com.github.binarywang.wxpay.bean.request.WxPayRefundV3Request.Amount amount = + new com.github.binarywang.wxpay.bean.request.WxPayRefundV3Request.Amount(); + amount.setRefund(refundFee); + amount.setTotal(totalFee); + amount.setCurrency("CNY"); + request.setAmount(amount); + + // 调用微信支付API申请退款 + WxPayRefundV3Result result = wxPayService.refundV3(request); + + log.info("申请退款成功,appId: {}, outTradeNo: {}, outRefundNo: {}", + appId, outTradeNo, request.getOutRefundNo()); + return request.getOutRefundNo(); + + } catch (Exception e) { + log.error("申请退款失败,appId: {}, outTradeNo: {}", appId, outTradeNo, e); + throw new RuntimeException("申请退款失败", e); + } + } + + /** + * 示例5:动态管理配置. + *+ * 适用场景:需要在运行时更新配置(如证书更新后需要重新加载) + *
+ * + * @param configKey 配置标识 + */ + public void reloadConfig(String configKey) { + try { + // 移除缓存的WxPayService实例 + wxPayMultiServices.removeWxPayService(configKey); + log.info("移除配置成功,下次获取时将重新创建: {}", configKey); + + // 下次调用 getWxPayService 时会重新创建实例 + WxPayService wxPayService = wxPayMultiServices.getWxPayService(configKey); + if (wxPayService != null) { + log.info("重新加载配置成功: {}", configKey); + } + + } catch (Exception e) { + log.error("重新加载配置失败: {}", configKey, e); + throw new RuntimeException("重新加载配置失败", e); + } + } + + /** + * 生成商户订单号. + * + * @return 商户订单号 + */ + private String generateOutTradeNo() { + return "ORDER_" + System.currentTimeMillis(); + } + + /** + * 生成商户退款单号. + * + * @return 商户退款单号 + */ + private String generateRefundNo() { + return "REFUND_" + System.currentTimeMillis(); + } +} diff --git a/spring-boot-starters/wx-java-pay-spring-boot-starter/README.md b/spring-boot-starters/wx-java-pay-spring-boot-starter/README.md index 8d96901f24..bed890d5e8 100644 --- a/spring-boot-starters/wx-java-pay-spring-boot-starter/README.md +++ b/spring-boot-starters/wx-java-pay-spring-boot-starter/README.md @@ -15,8 +15,6 @@ wx: appId: mchId: mchKey: - subAppId: - subMchId: keyPath: ``` ###### 2)V3版本 @@ -25,15 +23,23 @@ wx: pay: appId: xxxxxxxxxxx mchId: 15xxxxxxxxx #商户id + apiHostUrl: http://10.0.0.1:3128 # 可选:代理主机 + apiHostUrlPath: /api-weixin # 可选:代理入口前缀 apiV3Key: Dc1DBwSc094jACxxxxxxxxxxxxxxx #V3密钥 certSerialNo: 62C6CEAA360BCxxxxxxxxxxxxxxx privateKeyPath: classpath:cert/apiclient_key.pem #apiclient_key.pem证书文件的绝对路径或者以classpath:开头的类路径 privateCertPath: classpath:cert/apiclient_cert.pem #apiclient_cert.pem证书文件的绝对路径或者以classpath:开头的类路径 ``` - - - - - - - +###### 3)V3服务商版本 +```yml +wx: + pay: #微信服务商支付 + configs: + - appId: wxe97b2x9c2b3d #spAppId + mchId: 16486610 #服务商商户 + subAppId: wx118cexxe3c07679 #子appId + subMchId: 16496705 #子商户 + apiV3Key: Dc1DBwSc094jAKDGR5aqqb7PTHr #apiV3密钥 + privateKeyPath: classpath:cert/apiclient_key.pem #服务商证书文件,apiclient_key.pem证书文件的绝对路径或者以classpath:开头的类路径(可以配置绝对路径) + privateCertPath: classpath:cert/apiclient_cert.pem #apiclient_cert.pem证书文件的绝对路径或者以classpath:开头的类路径 +``` diff --git a/spring-boot-starters/wx-java-pay-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-pay-spring-boot-starter/pom.xml index 14d9268575..6625201696 100644 --- a/spring-boot-starters/wx-java-pay-spring-boot-starter/pom.xml +++ b/spring-boot-starters/wx-java-pay-spring-boot-starter/pom.xml @@ -5,7 +5,7 @@{@link com.binarywang.wxjava.store.api.WxStoreService#setMaxRetryTimes(int)}
+ *{@link com.binarywang.wxjava.store.api.impl.BaseWxStoreServiceImpl#setMaxRetryTimes(int)}
+ */ + private int maxRetryTimes = 5; + + /** + * http 请求重试间隔 + * + *{@link com.binarywang.wxjava.store.api.WxStoreService#setRetrySleepMillis(int)}
+ *{@link com.binarywang.wxjava.store.api.impl.BaseWxStoreServiceImpl#setRetrySleepMillis(int)}
+ */ + private int retrySleepMillis = 1000; + } +} diff --git a/spring-boot-starters/wx-java-store-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/store/properties/WxStoreMultiRedisProperties.java b/spring-boot-starters/wx-java-store-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/store/properties/WxStoreMultiRedisProperties.java new file mode 100644 index 0000000000..828325c3bf --- /dev/null +++ b/spring-boot-starters/wx-java-store-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/store/properties/WxStoreMultiRedisProperties.java @@ -0,0 +1,63 @@ +package com.binarywang.spring.starter.wxjava.store.properties; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * Redis配置 + * + * @author Winnie + * @date 2024/9/13 + */ +@Data +@NoArgsConstructor +public class WxStoreMultiRedisProperties implements Serializable { + private static final long serialVersionUID = 9061055444734277357L; + + /** + * 主机地址. + */ + private String host = "127.0.0.1"; + + /** + * 端口号. + */ + private int port = 6379; + + /** + * 密码. + */ + private String password; + + /** + * 超时. + */ + private int timeout = 2000; + + /** + * 数据库. + */ + private int database = 0; + + /** + * 最大活动连接数 + */ + private Integer maxActive; + + /** + * 最大空闲连接数 + */ + private Integer maxIdle; + + /** + * 最小空闲连接数 + */ + private Integer minIdle; + + /** + * 最大等待时间 + */ + private Integer maxWaitMillis; +} diff --git a/spring-boot-starters/wx-java-store-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/store/properties/WxStoreSingleProperties.java b/spring-boot-starters/wx-java-store-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/store/properties/WxStoreSingleProperties.java new file mode 100644 index 0000000000..335147c7b7 --- /dev/null +++ b/spring-boot-starters/wx-java-store-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/store/properties/WxStoreSingleProperties.java @@ -0,0 +1,55 @@ +package com.binarywang.spring.starter.wxjava.store.properties; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * 微信小店相关配置属性 + * + * @author Winnie + * @date 2024/9/13 + */ +@Data +@NoArgsConstructor +public class WxStoreSingleProperties implements Serializable { + private static final long serialVersionUID = 5306630351265124825L; + + /** + * 设置微信小店的 appid. + */ + private String appId; + + /** + * 设置微信小店的 secret. + */ + private String secret; + + /** + * 设置微信小店的 token. + */ + private String token; + + /** + * 设置微信小店的 EncodingAESKey. + */ + private String aesKey; + + /** + * 是否使用稳定版 Access Token + */ + private boolean useStableAccessToken = false; + + /** + * 自定义API主机地址,用于替换默认的 https://api.weixin.qq.com + * 例如:http://proxy.company.com:8080 + */ + private String apiHostUrl; + + /** + * 自定义获取AccessToken地址,用于向自定义统一服务获取AccessToken + * 例如:http://proxy.company.com:8080/oauth/token + */ + private String accessTokenUrl; +} diff --git a/spring-boot-starters/wx-java-store-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/store/service/WxStoreMultiServices.java b/spring-boot-starters/wx-java-store-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/store/service/WxStoreMultiServices.java new file mode 100644 index 0000000000..ff5192ac48 --- /dev/null +++ b/spring-boot-starters/wx-java-store-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/store/service/WxStoreMultiServices.java @@ -0,0 +1,26 @@ +package com.binarywang.spring.starter.wxjava.store.service; + +import com.binarywang.wxjava.store.api.WxStoreService; + +/** + * 视频号 {@link WxStoreService} 所有实例存放类. + * + * @author Winnie + * @date 2024/9/13 + */ +public interface WxStoreMultiServices { + /** + * 通过租户 Id 获取 WxStoreService + * + * @param tenantId 租户 Id + * @return WxStoreService + */ + WxStoreService getWxStoreService(String tenantId); + + /** + * 根据租户 Id,从列表中移除一个 WxStoreService 实例 + * + * @param tenantId 租户 Id + */ + void removeWxStoreService(String tenantId); +} diff --git a/spring-boot-starters/wx-java-store-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/store/service/WxStoreMultiServicesImpl.java b/spring-boot-starters/wx-java-store-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/store/service/WxStoreMultiServicesImpl.java new file mode 100644 index 0000000000..44fe0f947d --- /dev/null +++ b/spring-boot-starters/wx-java-store-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/store/service/WxStoreMultiServicesImpl.java @@ -0,0 +1,36 @@ +package com.binarywang.spring.starter.wxjava.store.service; + +import com.binarywang.wxjava.store.api.WxStoreService; + +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +/** + * 视频号 {@link WxStoreMultiServices} 实现 + * + * @author Winnie + * @date 2024/9/13 + */ +public class WxStoreMultiServicesImpl implements WxStoreMultiServices { + private final Map
+ * {@link com.binarywang.wxjava.store.api.BaseWxStoreService#setRetrySleepMillis(int)}
+ *
+ */
+ private int retrySleepMillis = 1000;
+ /**
+ * http 请求最大重试次数
+ *
+ * {@link com.binarywang.wxjava.store.api.BaseWxStoreService#setMaxRetryTimes(int)}
+ *
+ */
+ private int maxRetryTimes = 5;
+ }
+
+}
diff --git a/spring-boot-starters/wx-java-store-spring-boot-starter/src/main/resources/META-INF/spring.factories b/spring-boot-starters/wx-java-store-spring-boot-starter/src/main/resources/META-INF/spring.factories
new file mode 100644
index 0000000000..cbf38ae2c2
--- /dev/null
+++ b/spring-boot-starters/wx-java-store-spring-boot-starter/src/main/resources/META-INF/spring.factories
@@ -0,0 +1,2 @@
+org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
+ com.binarywang.spring.starter.wxjava.store.config.WxStoreAutoConfiguration
diff --git a/spring-boot-starters/wx-java-store-spring-boot-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/spring-boot-starters/wx-java-store-spring-boot-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
new file mode 100644
index 0000000000..80044c332a
--- /dev/null
+++ b/spring-boot-starters/wx-java-store-spring-boot-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
@@ -0,0 +1 @@
+com.binarywang.spring.starter.wxjava.store.config.WxStoreAutoConfiguration
diff --git a/weixin-graal/pom.xml b/weixin-graal/pom.xml
index d95d6e86d4..f689fe886f 100644
--- a/weixin-graal/pom.xml
+++ b/weixin-graal/pom.xml
@@ -6,7 +6,7 @@
* 获取access_token,本方法线程安全.
* 且在多线程同时刷新时只刷新一次,避免超出2000次/日的调用次数上限
- *
- * 另:本service的所有方法都会在access_token过期是调用此方法
+ * 使用【稳定版接口】获取access_token时,限制【20次/日】,连续使用该模式时,请保证调用时间隔至少为30s,否则不会刷新
*
* 程序员在非必要情况下尽量不要主动调用此方法
*
@@ -132,5 +131,5 @@ public interface BaseWxChannelService extends WxService {
*
* @return . request http
*/
- RequestHttp getRequestHttp();
+ RequestHttp, ?> getRequestHttp();
}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxAssistantService.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxAssistantService.java
new file mode 100644
index 0000000000..7adaf30a3e
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxAssistantService.java
@@ -0,0 +1,55 @@
+package me.chanjar.weixin.channel.api;
+
+import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
+import me.chanjar.weixin.channel.bean.window.request.AddWindowProductRequest;
+import me.chanjar.weixin.channel.bean.window.request.GetWindowProductListRequest;
+import me.chanjar.weixin.channel.bean.window.request.WindowProductRequest;
+import me.chanjar.weixin.channel.bean.window.response.GetWindowProductListResponse;
+import me.chanjar.weixin.channel.bean.window.response.GetWindowProductResponse;
+import me.chanjar.weixin.common.error.WxErrorException;
+
+/**
+ * 视频号助手 橱窗管理服务
+ * 关于橱窗商品ID的说明:
+ * 不支持带货中心来源的商品,其余商品的橱窗商品ID与商品来源处的平台内部商品ID相同,对应关系如下
+ *
+ * 商品来源 橱窗ID说明
+ * 视频号小店 视频号小店商品的 product_id 字段
+ * 交易组件 组件商品的 product_id 字段
+ *
+ *
+ * @author imyzt
+ */
+public interface WxAssistantService {
+
+ /**
+ * 上架商品到橱窗
+ * @param req 商品信息
+ * @return 操作结果
+ */
+ WxChannelBaseResponse addWindowProduct(AddWindowProductRequest req) throws WxErrorException;
+
+ /**
+ * 获取橱窗商品详情
+ *
+ * @param req 商品信息
+ * @return 橱窗商品详情
+ */
+ GetWindowProductResponse getWindowProduct(WindowProductRequest req) throws WxErrorException;
+
+ /**
+ * 获取已添加到橱窗的商品列表
+ * 接口限制了 page_size × page_index ≤ 10000。命中限制时建议改用传last_buffer顺序翻页的请求方式
+ * @param req 商品信息
+ * @return 已添加到橱窗的商品列表
+ */
+ GetWindowProductListResponse getWindowProductList(GetWindowProductListRequest req) throws WxErrorException;
+
+ /**
+ * 下架橱窗商品
+ * @param req 商品信息
+ * @return 操作结果
+ */
+ WxChannelBaseResponse offWindowProduct(WindowProductRequest req) throws WxErrorException;
+
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelAddressService.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelAddressService.java
index 063dd53948..545d30b737 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelAddressService.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelAddressService.java
@@ -12,7 +12,9 @@
* 视频号小店 地址管理服务
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.api.WxStoreAddressService}。
*/
+@Deprecated
public interface WxChannelAddressService {
/**
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelAfterSaleService.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelAfterSaleService.java
index ac1e61729b..2ff04faf1d 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelAfterSaleService.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelAfterSaleService.java
@@ -2,8 +2,8 @@
import java.util.List;
-import me.chanjar.weixin.channel.bean.after.AfterSaleInfoResponse;
-import me.chanjar.weixin.channel.bean.after.AfterSaleListResponse;
+
+import me.chanjar.weixin.channel.bean.after.*;
import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
import me.chanjar.weixin.channel.bean.complaint.ComplaintOrderResponse;
import me.chanjar.weixin.common.error.WxErrorException;
@@ -12,7 +12,9 @@
* 视频号小店 售后服务接口
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.api.WxStoreAfterSaleService}。
*/
+@Deprecated
public interface WxChannelAfterSaleService {
/**
@@ -24,10 +26,22 @@ public interface WxChannelAfterSaleService {
* @return 售后单列表
*
* @throws WxErrorException 异常
+ * @deprecated 使用 {@link WxChannelAfterSaleService#listIds(AfterSaleListParam)}
*/
+ @Deprecated
AfterSaleListResponse listIds(Long beginCreateTime, Long endCreateTime, String nextKey)
throws WxErrorException;
+ /**
+ * 获取售后单列表
+ *
+ * @param param 参数
+ * @return 售后单列表
+ *
+ * @throws WxErrorException 异常
+ */
+ AfterSaleListResponse listIds(AfterSaleListParam param) throws WxErrorException;
+
/**
* 获取售后单详情
*
@@ -39,26 +53,47 @@ AfterSaleListResponse listIds(Long beginCreateTime, Long endCreateTime, String n
AfterSaleInfoResponse get(String afterSaleOrderId) throws WxErrorException;
/**
- * 同意退款
+ * 同意售后
+ * 文档地址 https://developers.weixin.qq.com/doc/channels/API/aftersale/acceptapply.html
*
* @param afterSaleOrderId 售后单号
* @param addressId 同意退货时传入地址id
+ * @param acceptType 1. 同意退货退款,并通知用户退货; 2. 确认收到货并退款给用户。 如果不填则将根据当前的售后单状态自动选择相应操作。对于仅退款的情况,由于只存在一种同意的场景,无需填写此字段。
* @return BaseResponse
*
* @throws WxErrorException 异常
*/
- WxChannelBaseResponse accept(String afterSaleOrderId, String addressId) throws WxErrorException;
+ WxChannelBaseResponse accept(String afterSaleOrderId, String addressId, Integer acceptType) throws WxErrorException;
/**
* 拒绝售后
+ * 文档地址 https://developers.weixin.qq.com/doc/channels/API/aftersale/rejectapply.html
*
* @param afterSaleOrderId 售后单号
* @param rejectReason 拒绝原因
+ * @param rejectReasonType 拒绝原因枚举值
+ * @see #getRejectReason()
* @return BaseResponse
*
* @throws WxErrorException 异常
*/
- WxChannelBaseResponse reject(String afterSaleOrderId, String rejectReason) throws WxErrorException;
+ WxChannelBaseResponse reject(String afterSaleOrderId, String rejectReason, Integer rejectReasonType) throws WxErrorException;
+
+ /**
+ * 拒绝售后(支持拒绝凭证)
+ * 文档地址 https://developers.weixin.qq.com/doc/channels/API/aftersale/rejectapply.html
+ *
+ * @param afterSaleOrderId 售后单号
+ * @param rejectReason 拒绝原因
+ * @param rejectReasonType 拒绝原因枚举值
+ * @param rejectCertificates 拒绝凭证图片列表,可使用图片上传接口获取media_id
+ * @see #getRejectReason()
+ * @return BaseResponse
+ *
+ * @throws WxErrorException 异常
+ */
+ WxChannelBaseResponse reject(String afterSaleOrderId, String rejectReason, Integer rejectReasonType,
+ List rejectCertificates) throws WxErrorException;
/**
* 上传退款凭证
@@ -108,4 +143,134 @@ WxChannelBaseResponse addComplaintEvidence(String complaintId, String content, L
* @throws WxErrorException 异常
*/
ComplaintOrderResponse getComplaint(String complaintId) throws WxErrorException;
+
+
+ /**
+ * 获取全量售后原因
+ * 文档地址:https://developers.weixin.qq.com/doc/channels/API/aftersale/getaftersalereason.html
+ *
+ * @return 售后原因
+ *
+ * @throws WxErrorException 异常
+ */
+ AfterSaleReasonResponse getAllReason() throws WxErrorException;
+
+ /**
+ * 获取拒绝售后原因
+ * 文档地址:https://developers.weixin.qq.com/doc/channels/API/aftersale/getrejectreason.html
+ *
+ * @return 拒绝售后原因
+ *
+ * @throws WxErrorException 异常
+ */
+ AfterSaleRejectReasonResponse getRejectReason() throws WxErrorException;
+
+ /**
+ * 换货发货
+ * 文档地址:https://developers.weixin.qq.com/doc/store/shop/API/channels-shop-aftersale/api_acceptexchangereship.html
+ *
+ * @param afterSaleOrderId 售后单号
+ * @param waybillId 快递单号
+ * @param deliveryId 快递公司id
+ * @return BaseResponse
+ *
+ * @throws WxErrorException 异常
+ */
+ WxChannelBaseResponse acceptExchangeReship(String afterSaleOrderId, String waybillId, String deliveryId) throws WxErrorException;
+
+ /**
+ * 换货拒绝发货
+ * 文档地址:https://developers.weixin.qq.com/doc/store/shop/API/channels-shop-aftersale/api_rejectexchangereship.html
+ *
+ * @param afterSaleOrderId 售后单号
+ * @param rejectReason 拒绝原因具体描述 ,可使用默认描述,也可以自定义描述
+ * @param rejectReasonType 拒绝原因枚举值
+ * @param rejectCertificates 退款凭证,可使用图片上传接口获取media_id(数据类型填0)
+ * @return BaseResponse
+ *
+ * @throws WxErrorException 异常
+ */
+ WxChannelBaseResponse rejectExchangeReship(String afterSaleOrderId, String rejectReason, Integer rejectReasonType, List rejectCertificates) throws WxErrorException;
+
+ /**
+ * 商家协商
+ * 文档地址:https://developers.weixin.qq.com/doc/store/shop/API/channels-shop-aftersale/api_merchantupdateaftersale.html
+ * @param param 参数
+ * @return BaseResponse
+ *
+ * @throws WxErrorException 异常
+ */
+ WxChannelBaseResponse merchantUpdateAfterSale(AfterSaleMerchantUpdateParam param) throws WxErrorException;
+
+ /**
+ * 获取保障单列表。
+ * 文档地址:https://developers.weixin.qq.com/doc/channels/API/channels-shop-aftersale/guarantee/api_searchguaranteeorder
+ *
+ * @param param 查询参数
+ * @return 保障单列表
+ * @throws WxErrorException 异常
+ */
+ default GuaranteeOrderListResponse listGuaranteeOrder(GuaranteeOrderListParam param) throws WxErrorException {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * 获取保障单详情。
+ * 文档地址:https://developers.weixin.qq.com/doc/channels/API/channels-shop-aftersale/guarantee/api_getguaranteeorder
+ *
+ * @param guaranteeOrderId 保障单号
+ * @return 保障单详情
+ * @throws WxErrorException 异常
+ */
+ default GuaranteeOrderInfoResponse getGuaranteeOrder(String guaranteeOrderId) throws WxErrorException {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * 同意保障单申请。
+ * 文档地址:https://developers.weixin.qq.com/doc/channels/API/channels-shop-aftersale/guarantee/api_merchantacceptguarantee
+ *
+ * @param guaranteeOrderId 保障单号
+ * @return 响应结果
+ * @throws WxErrorException 异常
+ */
+ default WxChannelBaseResponse acceptGuarantee(String guaranteeOrderId) throws WxErrorException {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * 商家协商保障单。
+ * 文档地址:https://developers.weixin.qq.com/doc/channels/API/channels-shop-aftersale/guarantee/api_merchantmodifyguarantee
+ *
+ * @param request 协商参数
+ * @return 响应结果
+ * @throws WxErrorException 异常
+ */
+ default WxChannelBaseResponse modifyGuarantee(GuaranteeModifyRequest request) throws WxErrorException {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * 商家举证保障单。
+ * 文档地址:https://developers.weixin.qq.com/doc/channels/API/channels-shop-aftersale/guarantee/api_merchantproofguarantee
+ *
+ * @param request 举证参数
+ * @return 响应结果
+ * @throws WxErrorException 异常
+ */
+ default WxChannelBaseResponse proofGuarantee(GuaranteeProofRequest request) throws WxErrorException {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * 拒绝保障单申请。
+ * 文档地址:https://developers.weixin.qq.com/doc/channels/API/channels-shop-aftersale/guarantee/api_merchantrefuseguarantee
+ *
+ * @param request 拒绝参数
+ * @return 响应结果
+ * @throws WxErrorException 异常
+ */
+ default WxChannelBaseResponse refuseGuarantee(GuaranteeRefuseRequest request) throws WxErrorException {
+ throw new UnsupportedOperationException();
+ }
}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelBasicService.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelBasicService.java
index a687aaeb5c..2f1a37f024 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelBasicService.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelBasicService.java
@@ -5,14 +5,19 @@
import me.chanjar.weixin.channel.bean.image.ChannelImageInfo;
import me.chanjar.weixin.channel.bean.image.ChannelImageResponse;
import me.chanjar.weixin.channel.bean.image.QualificationFileResponse;
+import me.chanjar.weixin.channel.bean.shop.ShopH5UrlResponse;
import me.chanjar.weixin.channel.bean.shop.ShopInfoResponse;
+import me.chanjar.weixin.channel.bean.shop.ShopQrCodeResponse;
+import me.chanjar.weixin.channel.bean.shop.ShopTagLinkResponse;
import me.chanjar.weixin.common.error.WxErrorException;
/**
* 基础接口
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.api.WxStoreBasicService}。
*/
+@Deprecated
public interface WxChannelBasicService {
/**
@@ -22,6 +27,31 @@ public interface WxChannelBasicService {
*/
ShopInfoResponse getShopInfo() throws WxErrorException;
+ /**
+ * 获取店铺H5链接
+ *
+ * @return 店铺H5链接
+ * @throws WxErrorException 异常
+ */
+ ShopH5UrlResponse getShopH5Url() throws WxErrorException;
+
+ /**
+ * 获取店铺二维码
+ *
+ * @param qrcodeType 二维码类型,1:二维码;2:标准物料;3:送礼物物料
+ * @return 店铺二维码
+ * @throws WxErrorException 异常
+ */
+ ShopQrCodeResponse getShopQrCode(int qrcodeType) throws WxErrorException;
+
+ /**
+ * 获取店铺口令
+ *
+ * @return 店铺口令
+ * @throws WxErrorException 异常
+ */
+ ShopTagLinkResponse getShopTagLink() throws WxErrorException;
+
/**
* 上传图片
*
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelBrandService.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelBrandService.java
index 905d354955..8a5dda562c 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelBrandService.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelBrandService.java
@@ -13,7 +13,9 @@
* 视频号小店 品牌服务接口
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.api.WxStoreBrandService}。
*/
+@Deprecated
public interface WxChannelBrandService {
/**
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelCategoryService.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelCategoryService.java
index ddbc99e5d4..f4129ffc19 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelCategoryService.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelCategoryService.java
@@ -4,18 +4,19 @@
import java.util.List;
import me.chanjar.weixin.channel.bean.audit.AuditApplyResponse;
import me.chanjar.weixin.channel.bean.audit.AuditResponse;
+import me.chanjar.weixin.channel.bean.audit.CategoryAuditInfo;
import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
-import me.chanjar.weixin.channel.bean.category.CategoryDetailResult;
-import me.chanjar.weixin.channel.bean.category.CategoryQualificationResponse;
-import me.chanjar.weixin.channel.bean.category.PassCategoryResponse;
-import me.chanjar.weixin.channel.bean.category.ShopCategory;
+import me.chanjar.weixin.channel.bean.category.*;
import me.chanjar.weixin.common.error.WxErrorException;
/**
* 视频号小店 商品类目相关接口
*
* @author Zeyes
+ * @see 新旧类目树差异
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.api.WxStoreCategoryService}。
*/
+@Deprecated
public interface WxChannelCategoryService {
/**
@@ -30,12 +31,27 @@ public interface WxChannelCategoryService {
/**
* 获取商品类目列表(全量) 有频率限制
*
- * @param parentId 类目父id
+ * @param fCatId 类目父id
* @return 类目列表
*
* @throws WxErrorException 异常
+ * @deprecated 接口返回更新,请使用 {@link #listAvailableCategories(String)}
*/
- List listAvailableCategory(String parentId) throws WxErrorException;
+ @Deprecated
+ List listAvailableCategory(String fCatId) throws WxErrorException;
+
+ /**
+ * 获取可用的子类目详情
+ *
+ * 1.f_cat_id 为旧类目树中的非叶子类目,仅设置 cat_list 字段。
+ * 2.f_cat_id 为新类目树中的非叶子类目,仅设置 cat_list_v2 字段。
+ * 3.f_cat_id 为0,同时设置 cat_list 和 cat_list_v2 字段
+ *
+ * @param fCatId 父类目ID,可先填0获取根部类目
+ * @return 类目列表
+ * @throws WxErrorException 异常
+ */
+ ShopCategoryResponse listAvailableCategories(String fCatId) throws WxErrorException;
/**
* 获取类目信息
@@ -58,10 +74,23 @@ public interface WxChannelCategoryService {
*
* @throws WxErrorException 异常
* @see WxChannelBasicService#uploadQualificationFile(File)
+ * @deprecated 请使用 {@link #addCategory(CategoryAuditInfo)}
*/
+ @Deprecated
AuditApplyResponse addCategory(String level1, String level2, String level3, List certificate)
throws WxErrorException;
+ /**
+ * 上传类目资质
+ *
+ * @param info 类目资质信息
+ * @return 审核id
+ *
+ * @throws WxErrorException 异常
+ * @see WxChannelBasicService#uploadQualificationFile(File)
+ */
+ AuditApplyResponse addCategory(CategoryAuditInfo info) throws WxErrorException;
+
/**
* 取消类目提审
*
@@ -90,4 +119,16 @@ AuditApplyResponse addCategory(String level1, String level2, String level3, List
* @throws WxErrorException 异常
*/
PassCategoryResponse listPassCategory() throws WxErrorException;
+
+ /**
+ * 获取店铺的类目权限列表
+ *
+ * @param isFilterStatus 是否按状态筛选
+ * @param status 类目状态(当 isFilterStatus 为 true 时有效)
+ * @return 类目权限列表
+ *
+ * @throws WxErrorException 异常
+ */
+ RelationCategoryResponse listRelationCategory(Boolean isFilterStatus, Integer status) throws WxErrorException;
+
}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelCompassFinderService.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelCompassFinderService.java
new file mode 100644
index 0000000000..db123f61a4
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelCompassFinderService.java
@@ -0,0 +1,58 @@
+package me.chanjar.weixin.channel.api;
+
+import me.chanjar.weixin.channel.bean.compass.finder.OverallResponse;
+import me.chanjar.weixin.channel.bean.compass.finder.ProductDataResponse;
+import me.chanjar.weixin.channel.bean.compass.finder.ProductListResponse;
+import me.chanjar.weixin.channel.bean.compass.finder.SaleProfileDataResponse;
+import me.chanjar.weixin.common.error.WxErrorException;
+
+/**
+ * 视频号助手 罗盘达人版服务
+ *
+ * @author Winnie
+ */
+public interface WxChannelCompassFinderService {
+
+ /**
+ * 获取电商概览数据
+ *
+ * @param ds 日期,格式 yyyyMMdd
+ * @return 电商概览数据
+ *
+ * @throws WxErrorException 异常
+ */
+ OverallResponse getOverall(String ds) throws WxErrorException;
+
+ /**
+ * 获取带货商品数据
+ *
+ * @param ds 日期,格式 yyyyMMdd
+ * @param productId 商品id
+ * @return 带货商品数据
+ *
+ * @throws WxErrorException 异常
+ */
+ ProductDataResponse getProductData(String ds, String productId) throws WxErrorException;
+
+ /**
+ * 获取带货商品列表
+ *
+ * @param ds 日期,格式 yyyyMMdd
+ * @return 带货商品列表
+ *
+ * @throws WxErrorException 异常
+ */
+ ProductListResponse getProductList(String ds) throws WxErrorException;
+
+ /**
+ * 获取带货人群数据
+ *
+ * @param ds 日期,格式 yyyyMMdd
+ * @param type 用户类型,1=商品曝光用户, 2=商品点击用户, 3=购买用户, 4=首购用户, 5=复购用户, 6=直播观看用户
+ * @return 带货人群数据
+ *
+ * @throws WxErrorException 异常
+ */
+ SaleProfileDataResponse getSaleProfileData(String ds, Integer type) throws WxErrorException;
+
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelCompassShopService.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelCompassShopService.java
new file mode 100644
index 0000000000..e742281289
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelCompassShopService.java
@@ -0,0 +1,128 @@
+package me.chanjar.weixin.channel.api;
+
+import me.chanjar.weixin.channel.bean.compass.shop.FinderAuthListResponse;
+import me.chanjar.weixin.channel.bean.compass.shop.FinderListResponse;
+import me.chanjar.weixin.channel.bean.compass.shop.FinderOverallResponse;
+import me.chanjar.weixin.channel.bean.compass.shop.FinderProductListResponse;
+import me.chanjar.weixin.channel.bean.compass.shop.FinderProductOverallResponse;
+import me.chanjar.weixin.channel.bean.compass.shop.ShopLiveListResponse;
+import me.chanjar.weixin.channel.bean.compass.shop.ShopOverallResponse;
+import me.chanjar.weixin.channel.bean.compass.shop.ShopProductDataResponse;
+import me.chanjar.weixin.channel.bean.compass.shop.ShopProductListResponse;
+import me.chanjar.weixin.channel.bean.compass.shop.ShopSaleProfileDataResponse;
+import me.chanjar.weixin.common.error.WxErrorException;
+
+/**
+ * 视频号/微信小店 罗盘商家版服务
+ *
+ * @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.api.WxStoreCompassShopService}。
+ */
+@Deprecated
+public interface WxChannelCompassShopService {
+
+ /**
+ * 获取电商概览数据
+ *
+ * @param ds 日期,格式 yyyyMMdd
+ * @return 电商概览数据
+ *
+ * @throws WxErrorException 异常
+ */
+ ShopOverallResponse getShopOverall(String ds) throws WxErrorException;
+
+ /**
+ * 获取授权视频号列表
+ *
+ * @return 获取授权视频号列表
+ *
+ * @throws WxErrorException 异常
+ */
+ FinderAuthListResponse getFinderAuthorizationList() throws WxErrorException;
+
+ /**
+ * 获取带货达人列表
+ *
+ * @param ds 日期,格式 yyyyMMdd
+ * @return 带货达人列表
+ *
+ * @throws WxErrorException 异常
+ */
+ FinderListResponse getFinderList(String ds) throws WxErrorException;
+
+ /**
+ * 获取带货数据概览
+ *
+ * @param ds 日期,格式 yyyyMMdd
+ * @return 带货数据概览
+ *
+ * @throws WxErrorException 异常
+ */
+ FinderOverallResponse getFinderOverall(String ds) throws WxErrorException;
+
+ /**
+ * 获取带货达人商品列表
+ *
+ * @param ds 日期,格式YYYYMMDD
+ * @param finderId 视频号ID
+ * @return 带货达人商品列表
+ *
+ * @throws WxErrorException 异常
+ */
+ FinderProductListResponse getFinderProductList(String ds, String finderId) throws WxErrorException;
+
+ /**
+ * 获取带货达人详情
+ *
+ * @param ds 日期,格式YYYYMMDD
+ * @param finderId 视频号ID
+ * @return 带货达人详情
+ *
+ * @throws WxErrorException 异常
+ */
+ FinderProductOverallResponse getFinderProductOverall(String ds, String finderId) throws WxErrorException;
+
+ /**
+ * 获取店铺开播列表
+ *
+ * @param ds 日期,格式YYYYMMDD
+ * @param finderId 视频号ID
+ * @return 店铺开播列表
+ *
+ * @throws WxErrorException 异常
+ */
+ ShopLiveListResponse getShopLiveList(String ds, String finderId) throws WxErrorException;
+
+ /**
+ * 获取商品详细信息
+ *
+ * @param ds 日期,格式YYYYMMDD
+ * @param productId 商品id
+ * @return 商品详细信息
+ *
+ * @throws WxErrorException 异常
+ */
+ ShopProductDataResponse getShopProductData(String ds, String productId) throws WxErrorException;
+
+ /**
+ * 获取商品列表
+ *
+ * @param ds 日期,格式YYYYMMDD
+ * @return 商品列表
+ *
+ * @throws WxErrorException 异常
+ */
+ ShopProductListResponse getShopProductList(String ds) throws WxErrorException;
+
+ /**
+ * 获取店铺人群数据
+ *
+ * @param ds 日期,格式 yyyyMMdd
+ * @param type 用户类型,1商品曝光用户 2商品点击用户 3购买用户 4首购用户 5复购用户
+ * @return 店铺人群数据
+ *
+ * @throws WxErrorException 异常
+ */
+ ShopSaleProfileDataResponse getShopSaleProfileData(String ds, Integer type) throws WxErrorException;
+
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelCouponService.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelCouponService.java
index df59fdc8b9..309ac713a6 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelCouponService.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelCouponService.java
@@ -15,7 +15,9 @@
* 视频号小店 优惠券服务
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.api.WxStoreCouponService}。
*/
+@Deprecated
public interface WxChannelCouponService {
/**
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelEwaybillService.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelEwaybillService.java
new file mode 100644
index 0000000000..cb96f5e3e0
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelEwaybillService.java
@@ -0,0 +1,80 @@
+package me.chanjar.weixin.channel.api;
+
+import java.util.List;
+import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
+import me.chanjar.weixin.channel.bean.ewaybill.AccountInfoResponse;
+import me.chanjar.weixin.channel.bean.ewaybill.AddSubOrderRequest;
+import me.chanjar.weixin.channel.bean.ewaybill.CreateOrderRequest;
+import me.chanjar.weixin.channel.bean.ewaybill.CreateOrderResponse;
+import me.chanjar.weixin.channel.bean.ewaybill.DeliveryListResponse;
+import me.chanjar.weixin.channel.bean.ewaybill.PrintOrderRequest;
+import me.chanjar.weixin.channel.bean.ewaybill.BatchPrintOrderRequest;
+import me.chanjar.weixin.channel.bean.ewaybill.OrderDetailResponse;
+import me.chanjar.weixin.channel.bean.ewaybill.PreCreateRequest;
+import me.chanjar.weixin.channel.bean.ewaybill.PreCreateResponse;
+import me.chanjar.weixin.channel.bean.ewaybill.PrintContentResponse;
+import me.chanjar.weixin.channel.bean.ewaybill.TemplateConfigResponse;
+import me.chanjar.weixin.channel.bean.ewaybill.TemplateCreateRequest;
+import me.chanjar.weixin.channel.bean.ewaybill.TemplateIdResponse;
+import me.chanjar.weixin.channel.bean.ewaybill.TemplateInfoResponse;
+import me.chanjar.weixin.channel.bean.ewaybill.TemplateUpdateRequest;
+import me.chanjar.weixin.common.error.WxErrorException;
+
+/**
+ * 视频号小店电子面单服务接口
+ *
+ * @author GitHub Copilot
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.api.WxStoreEwaybillService}。
+ */
+@Deprecated
+public interface WxChannelEwaybillService {
+
+ /** 获取可用的标准面单模板。 @return 模板配置 @throws WxErrorException 微信接口调用失败 */
+ TemplateConfigResponse getTemplateConfig() throws WxErrorException;
+
+ /** 创建商家面单模板。 @param req 官方模板创建字段 @return 新模板 ID @throws WxErrorException 调用失败 */
+ TemplateIdResponse createTemplate(TemplateCreateRequest req) throws WxErrorException;
+
+ /** 删除商家面单模板。 @param templateId 模板 ID @return 操作结果 @throws WxErrorException 调用失败 */
+ WxChannelBaseResponse deleteTemplate(String templateId) throws WxErrorException;
+
+ /** 更新商家面单模板。 @param req 官方模板更新字段 @return 操作结果 @throws WxErrorException 调用失败 */
+ WxChannelBaseResponse updateTemplate(TemplateUpdateRequest req) throws WxErrorException;
+
+ /** 查询标准模板信息。 @param templateCode 标准模板编码 @return 模板详情 @throws WxErrorException 调用失败 */
+ TemplateInfoResponse getTemplate(String templateCode) throws WxErrorException;
+
+ /** 按模板 ID 查询商家模板。 @param templateId 模板 ID @return 模板详情 @throws WxErrorException 调用失败 */
+ TemplateInfoResponse getTemplateById(String templateId) throws WxErrorException;
+
+ /** 查询已开通电子面单的网点和账号。 @return 账号信息 @throws WxErrorException 调用失败 */
+ AccountInfoResponse getAccount() throws WxErrorException;
+
+ /** 查询已开通电子面单的快递公司。 @return 快递公司列表 @throws WxErrorException 调用失败 */
+ DeliveryListResponse getDeliveryList() throws WxErrorException;
+
+ /** 预取电子面单号。 @param req 官方预取号字段 @return 预取号结果 @throws WxErrorException 调用失败 */
+ PreCreateResponse preCreateOrder(PreCreateRequest req) throws WxErrorException;
+
+ /** 获取电子面单号。 @param req 官方取号字段,含收寄件信息 @return 面单号结果 @throws WxErrorException 调用失败 */
+ CreateOrderResponse createOrder(CreateOrderRequest req) throws WxErrorException;
+
+ /** 追加电子面单子件。 @param req 官方子件字段 @return 操作结果 @throws WxErrorException 调用失败 */
+ WxChannelBaseResponse addSubOrder(AddSubOrderRequest req) throws WxErrorException;
+
+ /** 取消电子面单下单。 @param waybillId 运单 ID @return 操作结果 @throws WxErrorException 调用失败 */
+ WxChannelBaseResponse cancelOrder(PrintOrderRequest req) throws WxErrorException;
+
+ /** 查询电子面单详情。 @param waybillId 运单 ID @return 面单详情 @throws WxErrorException 调用失败 */
+ OrderDetailResponse getOrder(String ewaybillOrderId) throws WxErrorException;
+
+ /** 获取打印报文。 @param waybillIds 运单 ID 列表 @param templateId 可选模板 ID @return 打印内容 @throws WxErrorException 调用失败 */
+ PrintContentResponse getPrintContent(String ewaybillOrderId, String templateId)
+ throws WxErrorException;
+
+ /** 通知单个运单打印成功。 @param waybillId 运单 ID @return 操作结果 @throws WxErrorException 调用失败 */
+ WxChannelBaseResponse printOrder(PrintOrderRequest req) throws WxErrorException;
+
+ /** 批量通知运单打印成功。 @param waybillIds 运单 ID 列表 @return 操作结果 @throws WxErrorException 调用失败 */
+ WxChannelBaseResponse batchPrintOrder(BatchPrintOrderRequest req) throws WxErrorException;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelFavoriteService.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelFavoriteService.java
new file mode 100644
index 0000000000..57998a76d1
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelFavoriteService.java
@@ -0,0 +1,23 @@
+package me.chanjar.weixin.channel.api;
+
+import me.chanjar.weixin.channel.bean.favorite.FavoriteCountResponse;
+import me.chanjar.weixin.common.error.WxErrorException;
+
+/**
+ * 视频号小店 收藏管理接口
+ *
+ * @author GitHub Copilot
+ * @link 收藏管理接口文档
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.api.WxStoreFavoriteService}。
+ */
+@Deprecated
+public interface WxChannelFavoriteService {
+
+ /**
+ * 获取店铺收藏的人数
+ *
+ * @return 店铺收藏人数响应
+ * @throws WxErrorException 异常
+ */
+ FavoriteCountResponse getFavoriteCount() throws WxErrorException;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelFreightTemplateService.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelFreightTemplateService.java
index 188b33464b..0bd617f465 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelFreightTemplateService.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelFreightTemplateService.java
@@ -11,7 +11,9 @@
* 视频号小店 运费模板服务接口
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.api.WxStoreFreightTemplateService}。
*/
+@Deprecated
public interface WxChannelFreightTemplateService {
/**
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelFundService.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelFundService.java
index cb0f5aab79..7dcb1c76eb 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelFundService.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelFundService.java
@@ -24,7 +24,9 @@
* 资金相关服务
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.api.WxStoreFundService}。
*/
+@Deprecated
public interface WxChannelFundService {
/**
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelGiftService.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelGiftService.java
new file mode 100644
index 0000000000..ffea27a3a5
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelGiftService.java
@@ -0,0 +1,104 @@
+package me.chanjar.weixin.channel.api;
+
+import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
+import me.chanjar.weixin.channel.bean.product.GiftActivityAddResponse;
+import me.chanjar.weixin.channel.bean.product.GiftActivityInfo;
+import me.chanjar.weixin.channel.bean.product.GiftProductAddResponse;
+import me.chanjar.weixin.channel.bean.product.GiftProductGetResponse;
+import me.chanjar.weixin.channel.bean.product.GiftProductInfo;
+import me.chanjar.weixin.channel.bean.product.GiftProductListParam;
+import me.chanjar.weixin.channel.bean.product.GiftProductListResponse;
+import me.chanjar.weixin.common.error.WxErrorException;
+
+/**
+ * 微信小店赠品与买赠活动服务。
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.api.WxStoreGiftService}。
+ */
+@Deprecated
+public interface WxChannelGiftService {
+
+ /**
+ * 添加非卖商品。
+ *
+ * @param info 赠品信息
+ * @return 添加赠品响应
+ * @throws WxErrorException 异常
+ */
+ GiftProductAddResponse addGiftProduct(GiftProductInfo info) throws WxErrorException;
+
+ /**
+ * 更新非卖商品。
+ *
+ * @param info 赠品信息
+ * @return 操作响应
+ * @throws WxErrorException 异常
+ */
+ WxChannelBaseResponse updateGiftProduct(GiftProductInfo info) throws WxErrorException;
+
+ /**
+ * 在售商品转赠品。
+ *
+ * @param productId 商品ID
+ * @return 操作响应
+ * @throws WxErrorException 异常
+ */
+ WxChannelBaseResponse setProductAsGift(String productId) throws WxErrorException;
+
+ /**
+ * 获取赠品。
+ *
+ * @param productId 赠品商品ID
+ * @return 赠品详情响应
+ * @throws WxErrorException 异常
+ */
+ GiftProductGetResponse getGiftProduct(String productId) throws WxErrorException;
+
+ /**
+ * 获取赠品列表。
+ *
+ * @param param 查询参数
+ * @return 赠品列表
+ * @throws WxErrorException 异常
+ */
+ GiftProductListResponse listGiftProduct(GiftProductListParam param) throws WxErrorException;
+
+ /**
+ * 更新赠品库存。
+ *
+ * @param productId 赠品商品ID
+ * @param skuId 赠品sku_id
+ * @param diffType 修改类型 1增加 2减少 3设置
+ * @param num 增加、减少或者设置的库存值
+ * @return 操作响应
+ * @throws WxErrorException 异常
+ */
+ WxChannelBaseResponse updateGiftStock(String productId, String skuId, Integer diffType, Integer num)
+ throws WxErrorException;
+
+ /**
+ * 创建赠品活动。
+ *
+ * @param info 活动信息
+ * @return 创建赠品活动响应
+ * @throws WxErrorException 异常
+ */
+ GiftActivityAddResponse addGiftActivity(GiftActivityInfo info) throws WxErrorException;
+
+ /**
+ * 删除赠品活动。
+ *
+ * @param activityId 活动ID
+ * @return 操作响应
+ * @throws WxErrorException 异常
+ */
+ WxChannelBaseResponse deleteGiftActivity(String activityId) throws WxErrorException;
+
+ /**
+ * 停止赠品活动。
+ *
+ * @param activityId 活动ID
+ * @return 操作响应
+ * @throws WxErrorException 异常
+ */
+ WxChannelBaseResponse stopGiftActivity(String activityId) throws WxErrorException;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelKfService.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelKfService.java
new file mode 100644
index 0000000000..e1d28825e8
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelKfService.java
@@ -0,0 +1,46 @@
+package me.chanjar.weixin.channel.api;
+
+import me.chanjar.weixin.channel.bean.kf.WxChannelKfSendMsgParam;
+import me.chanjar.weixin.channel.bean.kf.WxChannelKfSendMsgResponse;
+import me.chanjar.weixin.common.error.WxErrorException;
+
+/**
+ * 视频号小店商家客服服务。
+ *
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.api.WxStoreKfService}。
+ */
+@Deprecated
+public interface WxChannelKfService {
+
+ /**
+ * 上传多媒体资源。
+ *
+ * @param openId 用户 open_id
+ * @param msgType 文件类型,仅支持 video、file、image
+ * @param file 文件字节内容
+ * @return COS 地址
+ * @throws WxErrorException 微信异常
+ */
+ String uploadMedia(String openId, String msgType, byte[] file) throws WxErrorException;
+
+ /**
+ * 上传多媒体资源。
+ *
+ * @param openId 用户 open_id
+ * @param msgType 文件类型,仅支持 video、file、image
+ * @param fileName 文件名
+ * @param file 文件字节内容
+ * @return COS 地址
+ * @throws WxErrorException 微信异常
+ */
+ String uploadMedia(String openId, String msgType, String fileName, byte[] file) throws WxErrorException;
+
+ /**
+ * 发送客服消息。
+ *
+ * @param param 请求参数
+ * @return 发送结果
+ * @throws WxErrorException 微信异常
+ */
+ WxChannelKfSendMsgResponse sendMessage(WxChannelKfSendMsgParam param) throws WxErrorException;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelLimitedDiscountService.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelLimitedDiscountService.java
new file mode 100644
index 0000000000..ef333f92f1
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelLimitedDiscountService.java
@@ -0,0 +1,64 @@
+package me.chanjar.weixin.channel.api;
+
+import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
+import me.chanjar.weixin.channel.bean.limit.LimitTaskAddResponse;
+import me.chanjar.weixin.channel.bean.limit.LimitTaskListResponse;
+import me.chanjar.weixin.channel.bean.limit.LimitTaskParam;
+import me.chanjar.weixin.channel.bean.limit.LimitTaskUpdateParam;
+import me.chanjar.weixin.channel.bean.limit.LimitTaskUpdateResponse;
+import me.chanjar.weixin.common.error.WxErrorException;
+
+/**
+ * 微信小店限时抢购服务。
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.api.WxStoreLimitedDiscountService}。
+ */
+@Deprecated
+public interface WxChannelLimitedDiscountService {
+
+ /**
+ * 添加限时抢购任务。
+ *
+ * @param param 限时抢购任务
+ * @return 添加任务响应
+ * @throws WxErrorException 异常
+ */
+ LimitTaskAddResponse addLimitTask(LimitTaskParam param) throws WxErrorException;
+
+ /**
+ * 拉取限时抢购任务列表。
+ *
+ * @param pageSize 每页数量
+ * @param nextKey 翻页上下文
+ * @param status 抢购活动状态
+ * @return 任务列表响应
+ * @throws WxErrorException 异常
+ */
+ LimitTaskListResponse listLimitTask(Integer pageSize, String nextKey, Integer status) throws WxErrorException;
+
+ /**
+ * 停止限时抢购任务。
+ *
+ * @param taskId 限时抢购任务ID
+ * @return 操作响应
+ * @throws WxErrorException 异常
+ */
+ WxChannelBaseResponse stopLimitTask(String taskId) throws WxErrorException;
+
+ /**
+ * 删除限时抢购任务。
+ *
+ * @param taskId 限时抢购任务ID
+ * @return 操作响应
+ * @throws WxErrorException 异常
+ */
+ WxChannelBaseResponse deleteLimitTask(String taskId) throws WxErrorException;
+
+ /**
+ * 更新限时抢购任务。
+ *
+ * @param param 更新任务参数
+ * @return 更新任务响应
+ * @throws WxErrorException 异常
+ */
+ LimitTaskUpdateResponse updateLimitTask(LimitTaskUpdateParam param) throws WxErrorException;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelLiveDashboardService.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelLiveDashboardService.java
new file mode 100644
index 0000000000..be93b06a97
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelLiveDashboardService.java
@@ -0,0 +1,34 @@
+package me.chanjar.weixin.channel.api;
+
+import me.chanjar.weixin.channel.bean.live.dashboard.LiveDataResponse;
+import me.chanjar.weixin.channel.bean.live.dashboard.LiveListResponse;
+import me.chanjar.weixin.common.error.WxErrorException;
+
+/**
+ * 视频号助手 直播大屏数据服务
+ *
+ * @author Winnie
+ */
+public interface WxChannelLiveDashboardService {
+
+ /**
+ * 获取直播大屏直播列表
+ *
+ * @param ds 日期,格式 yyyyMMdd
+ * @return 播大屏直播列表
+ *
+ * @throws WxErrorException 异常
+ */
+ LiveListResponse getLiveList(Long ds) throws WxErrorException;
+
+ /**
+ * 获取直播大屏数据
+ *
+ * @param exportId 直播唯一ID
+ * @return 播大屏数据
+ *
+ * @throws WxErrorException 异常
+ */
+ LiveDataResponse getLiveData(String exportId) throws WxErrorException;
+
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelOrderService.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelOrderService.java
index e280ace2fc..c7f43496f2 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelOrderService.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelOrderService.java
@@ -3,14 +3,22 @@
import java.util.List;
import me.chanjar.weixin.channel.bean.base.AddressInfo;
import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
+import me.chanjar.weixin.channel.bean.delivery.PackageAuditInfo;
import me.chanjar.weixin.channel.bean.delivery.DeliveryCompanyResponse;
import me.chanjar.weixin.channel.bean.delivery.DeliveryInfo;
import me.chanjar.weixin.channel.bean.order.ChangeOrderInfo;
+import me.chanjar.weixin.channel.bean.order.DecodeSensitiveInfoResponse;
import me.chanjar.weixin.channel.bean.order.DeliveryUpdateParam;
+import me.chanjar.weixin.channel.bean.order.OrderCompensationDeliveryParam;
import me.chanjar.weixin.channel.bean.order.OrderInfoResponse;
import me.chanjar.weixin.channel.bean.order.OrderListParam;
import me.chanjar.weixin.channel.bean.order.OrderListResponse;
import me.chanjar.weixin.channel.bean.order.OrderSearchParam;
+import me.chanjar.weixin.channel.bean.order.PreShipmentChangeSkuResponse;
+import me.chanjar.weixin.channel.bean.order.PresentSubOrderResponse;
+import me.chanjar.weixin.channel.bean.order.PrivateNumberGetPhoneResponse;
+import me.chanjar.weixin.channel.bean.order.RealNumberViewAuditResponse;
+import me.chanjar.weixin.channel.bean.order.VirtualTelNumberResponse;
import me.chanjar.weixin.common.error.WxErrorException;
/**
@@ -18,7 +26,9 @@
*
* @author Zeyes
* @link 订单接口文档
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.api.WxStoreOrderService}。
*/
+@Deprecated
public interface WxChannelOrderService {
/**
@@ -31,6 +41,17 @@ public interface WxChannelOrderService {
*/
OrderInfoResponse getOrder(String orderId) throws WxErrorException;
+ /**
+ * 获取订单详情
+ *
+ * @param orderId 订单id
+ * @param encodeSensitiveInfo 是否编码敏感信息
+ * @return 订单详情
+ *
+ * @throws WxErrorException 异常
+ */
+ OrderInfoResponse getOrder(String orderId, Boolean encodeSensitiveInfo) throws WxErrorException;
+
/**
* 获取订单列表
*
@@ -96,6 +117,26 @@ WxChannelBaseResponse updatePrice(String orderId, Integer expressFee, List deliveryList) throws WxErrorException;
+
+ /**
+ * 上传生鲜质检信息
+ *
+ * 注意事项:
+ * 1. 非生鲜质检的订单不能进行上传
+ * 2. 图片url必须用图片上传接口获取 {@link WxChannelBasicService#uploadImg(int, String)}
+ *
+ * @param orderId 订单id
+ * @param items 商品打包信息
+ * @return BaseResponse
+ *
+ * @throws WxErrorException 异常
+ */
+ WxChannelBaseResponse uploadFreshInspect(String orderId, List items) throws WxErrorException;
+
+ /**
+ * 兑换虚拟号
+ *
+ * @param orderId 订单id
+ * @return 虚拟号信息
+ * @throws WxErrorException 异常
+ */
+ VirtualTelNumberResponse getVirtualTelNumber(String orderId) throws WxErrorException;
+
+ /**
+ * 解码订单包含的敏感数据
+ *
+ * @param orderId 订单id
+ * @return 解码结果
+ * @throws WxErrorException 异常
+ */
+ DecodeSensitiveInfoResponse decodeSensitiveInfo(String orderId) throws WxErrorException;
+
+ /**
+ * 礼物订单新增备注信息
+ *
+ * @param orderId 礼物订单ID
+ * @param note 备注内容
+ * @return BaseResponse
+ * @throws WxErrorException 异常
+ */
+ WxChannelBaseResponse addPresentNote(String orderId, String note) throws WxErrorException;
+
+ /**
+ * 获取礼物单的子单列表
+ *
+ * @param orderId 礼物订单ID
+ * @return 子单列表
+ * @throws WxErrorException 异常
+ */
+ PresentSubOrderResponse getPresentSubOrders(String orderId) throws WxErrorException;
+
+ /**
+ * 获取待发货前更换SKU待处理请求
+ *
+ * @param orderId 订单ID
+ * @return 换SKU信息
+ * @throws WxErrorException 异常
+ */
+ PreShipmentChangeSkuResponse getPreShipmentChangeSku(String orderId) throws WxErrorException;
+
+ /**
+ * 同意待发货前更换SKU请求
+ *
+ * @param orderId 订单ID
+ * @return BaseResponse
+ * @throws WxErrorException 异常
+ */
+ WxChannelBaseResponse approvePreShipmentChangeSku(String orderId) throws WxErrorException;
+
+ /**
+ * 拒绝待发货前更换SKU请求
+ *
+ * @param orderId 订单ID
+ * @param rejectReason 拒绝原因
+ * @return BaseResponse
+ * @throws WxErrorException 异常
+ */
+ WxChannelBaseResponse rejectPreShipmentChangeSku(String orderId, String rejectReason) throws WxErrorException;
+
+ /**
+ * 申请查看订单真实号码
+ *
+ * @param orderId 订单ID
+ * @return BaseResponse
+ * @throws WxErrorException 异常
+ */
+ WxChannelBaseResponse applyRealNumber(String orderId) throws WxErrorException;
+
+ /**
+ * 查看订单真实号审核状态
+ *
+ * @param orderId 订单ID
+ * @return 审核状态
+ * @throws WxErrorException 异常
+ */
+ RealNumberViewAuditResponse getRealNumberViewAudit(String orderId) throws WxErrorException;
+
+ /**
+ * 订单再次申请虚拟号
+ *
+ * @param orderId 订单ID
+ * @return BaseResponse
+ * @throws WxErrorException 异常
+ */
+ WxChannelBaseResponse applyVirtualNumberAgain(String orderId) throws WxErrorException;
+
+ /**
+ * 订单虚拟号延期
+ *
+ * @param orderId 订单ID
+ * @return BaseResponse
+ * @throws WxErrorException 异常
+ */
+ WxChannelBaseResponse delayVirtualNumber(String orderId) throws WxErrorException;
+
+ /**
+ * 添加待认证的手机号
+ *
+ * @param phone 手机号
+ * @return BaseResponse
+ * @throws WxErrorException 异常
+ */
+ WxChannelBaseResponse addPrivatePhone(String phone) throws WxErrorException;
+
+ /**
+ * 获取短信验证码
+ *
+ * @param phone 手机号
+ * @return BaseResponse
+ * @throws WxErrorException 异常
+ */
+ WxChannelBaseResponse sendPrivatePhoneVerifyCode(String phone) throws WxErrorException;
+
+ /**
+ * 获取小店手机号认证状态
+ *
+ * @return 手机号认证状态
+ * @throws WxErrorException 异常
+ */
+ PrivateNumberGetPhoneResponse getPrivatePhone() throws WxErrorException;
+
+ /**
+ * 订单补发货
+ *
+ * @param param 补发货参数
+ * @return BaseResponse
+ * @throws WxErrorException 异常
+ */
+ WxChannelBaseResponse compensationDelivery(OrderCompensationDeliveryParam param) throws WxErrorException;
}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelProductAssistantService.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelProductAssistantService.java
new file mode 100644
index 0000000000..0bb0af5620
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelProductAssistantService.java
@@ -0,0 +1,79 @@
+package me.chanjar.weixin.channel.api;
+
+import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
+import me.chanjar.weixin.channel.bean.product.assistant.BeginTimingSaleParam;
+import me.chanjar.weixin.channel.bean.product.assistant.CancelTimingSaleParam;
+import me.chanjar.weixin.channel.bean.product.assistant.CategoryPreCheckParam;
+import me.chanjar.weixin.channel.bean.product.assistant.CategoryPreCheckResponse;
+import me.chanjar.weixin.channel.bean.product.assistant.ExternalProductMappingNewParam;
+import me.chanjar.weixin.channel.bean.product.assistant.ExternalProductMappingNewResponse;
+import me.chanjar.weixin.channel.bean.product.assistant.ExternalProductMappingParam;
+import me.chanjar.weixin.channel.bean.product.assistant.ExternalProductMappingResponse;
+import me.chanjar.weixin.channel.bean.product.assistant.ProductBrandRecommendParam;
+import me.chanjar.weixin.channel.bean.product.assistant.ProductBrandRecommendResponse;
+import me.chanjar.weixin.common.error.WxErrorException;
+
+/**
+ * 微信小店商品辅助功能服务。
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.api.WxStoreProductAssistantService}。
+ */
+@Deprecated
+public interface WxChannelProductAssistantService {
+
+ /**
+ * 发品前校验。
+ *
+ * @param param 校验参数
+ * @return 校验结果
+ * @throws WxErrorException 异常
+ */
+ CategoryPreCheckResponse categoryPreCheck(CategoryPreCheckParam param) throws WxErrorException;
+
+ /**
+ * 获取商品品牌推荐。
+ *
+ * @param param 推荐参数
+ * @return 推荐结果
+ * @throws WxErrorException 异常
+ */
+ ProductBrandRecommendResponse getProductBrandRecommend(ProductBrandRecommendParam param)
+ throws WxErrorException;
+
+ /**
+ * 获取站内外商品属性映射。
+ *
+ * @param param 映射参数
+ * @return 映射结果
+ * @throws WxErrorException 异常
+ */
+ ExternalProductMappingResponse externalProductMapping(ExternalProductMappingParam param)
+ throws WxErrorException;
+
+ /**
+ * 获取商品属性映射及推荐。
+ *
+ * @param param 映射参数
+ * @return 映射结果
+ * @throws WxErrorException 异常
+ */
+ ExternalProductMappingNewResponse externalProductMappingNew(ExternalProductMappingNewParam param)
+ throws WxErrorException;
+
+ /**
+ * 将定时开售商品改为立即开售。
+ *
+ * @param param 开售参数
+ * @return 操作结果
+ * @throws WxErrorException 异常
+ */
+ WxChannelBaseResponse beginTimingSale(BeginTimingSaleParam param) throws WxErrorException;
+
+ /**
+ * 取消商品定时开售。
+ *
+ * @param param 取消参数
+ * @return 操作结果
+ * @throws WxErrorException 异常
+ */
+ WxChannelBaseResponse cancelTimingSale(CancelTimingSaleParam param) throws WxErrorException;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelProductService.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelProductService.java
index b962b9ec85..095a7c482e 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelProductService.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelProductService.java
@@ -1,22 +1,59 @@
package me.chanjar.weixin.channel.api;
+import java.util.List;
import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
import me.chanjar.weixin.channel.bean.limit.LimitTaskAddResponse;
import me.chanjar.weixin.channel.bean.limit.LimitTaskListResponse;
import me.chanjar.weixin.channel.bean.limit.LimitTaskParam;
+import me.chanjar.weixin.channel.bean.product.GiftActivityAddResponse;
+import me.chanjar.weixin.channel.bean.product.GiftActivityInfo;
+import me.chanjar.weixin.channel.bean.product.GiftProductAddResponse;
+import me.chanjar.weixin.channel.bean.product.GiftProductGetResponse;
+import me.chanjar.weixin.channel.bean.product.GiftProductInfo;
+import me.chanjar.weixin.channel.bean.product.GiftProductListParam;
+import me.chanjar.weixin.channel.bean.product.GiftProductListResponse;
+import me.chanjar.weixin.channel.bean.product.AddProductThirdPartySourceParam;
+import me.chanjar.weixin.channel.bean.product.AddProductThirdPartySourceResponse;
+import me.chanjar.weixin.channel.bean.product.ExternalProductMappingNewParam;
+import me.chanjar.weixin.channel.bean.product.ExternalProductMappingNewResponse;
+import me.chanjar.weixin.channel.bean.product.ExternalProductMappingParam;
+import me.chanjar.weixin.channel.bean.product.ExternalProductMappingResponse;
+import me.chanjar.weixin.channel.bean.product.ProductAuditQuotaResponse;
+import me.chanjar.weixin.channel.bean.product.ProductAuditStrategyResponse;
+import me.chanjar.weixin.channel.bean.product.ProductAuditStrategySetParam;
+import me.chanjar.weixin.channel.bean.product.ProductBrandRecommendParam;
+import me.chanjar.weixin.channel.bean.product.ProductBrandRecommendResponse;
+import me.chanjar.weixin.channel.bean.product.ProductCategoryClassifyParam;
+import me.chanjar.weixin.channel.bean.product.ProductCategoryClassifyResponse;
+import me.chanjar.weixin.channel.bean.product.ProductCategoryPreCheckParam;
+import me.chanjar.weixin.channel.bean.product.ProductCategoryPreCheckResponse;
+import me.chanjar.weixin.channel.bean.product.ProductSchemeParam;
+import me.chanjar.weixin.channel.bean.product.ProductSchemeResponse;
+import me.chanjar.weixin.channel.bean.product.ProductStockFlowParam;
+import me.chanjar.weixin.channel.bean.product.ProductStockFlowResponse;
+import me.chanjar.weixin.channel.bean.product.ProductTimingSaleParam;
+import me.chanjar.weixin.channel.bean.product.SkuStockBatchResponse;
import me.chanjar.weixin.channel.bean.product.SkuStockResponse;
+import me.chanjar.weixin.channel.bean.product.SpuFastInfo;
import me.chanjar.weixin.channel.bean.product.SpuGetResponse;
import me.chanjar.weixin.channel.bean.product.SpuInfo;
import me.chanjar.weixin.channel.bean.product.SpuListResponse;
+import me.chanjar.weixin.channel.bean.product.SpuUpdateInfo;
import me.chanjar.weixin.channel.bean.product.SpuUpdateResponse;
+import me.chanjar.weixin.channel.bean.product.link.ProductH5UrlResponse;
+import me.chanjar.weixin.channel.bean.product.link.ProductQrCodeResponse;
+import me.chanjar.weixin.channel.bean.product.link.ProductTagLinkResponse;
import me.chanjar.weixin.common.error.WxErrorException;
/**
* 视频号小店 商品服务接口
*
* @author Zeyes
+ * @see 商品状态流转图
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.api.WxStoreProductService}。
*/
+@Deprecated
public interface WxChannelProductService {
/**
@@ -27,6 +64,28 @@ public interface WxChannelProductService {
*
* @throws WxErrorException 异常
*/
+ SpuUpdateResponse addProduct(SpuUpdateInfo info) throws WxErrorException;
+
+ /**
+ * 更新商品
+ *
+ * @param info 商品信息
+ * @return 返回商品的状态和id
+ *
+ * @throws WxErrorException 异常
+ */
+ SpuUpdateResponse updateProduct(SpuUpdateInfo info) throws WxErrorException;
+
+ /**
+ * 添加商品
+ *
+ * @param info 商品信息
+ * @return 返回商品的状态和id
+ *
+ * @throws WxErrorException 异常
+ * @deprecated 请使用 {@link #addProduct(SpuUpdateInfo)}
+ */
+ @Deprecated
SpuUpdateResponse addProduct(SpuInfo info) throws WxErrorException;
/**
@@ -36,15 +95,28 @@ public interface WxChannelProductService {
* @return 返回商品的状态和id
*
* @throws WxErrorException 异常
+ * @deprecated 请使用 {@link #updateProduct(SpuUpdateInfo)}
*/
+ @Deprecated
SpuUpdateResponse updateProduct(SpuInfo info) throws WxErrorException;
+ /**
+ * 免审更新商品
+ *
+ * @param info 商品信息
+ * @return 返回商品的状态和id
+ *
+ * @throws WxErrorException 异常
+ */
+ WxChannelBaseResponse updateProductAuditFree(SpuFastInfo info) throws WxErrorException;
+
/**
* 更新商品库存 (仅对edit_status != 2 的商品适用,其他状态的商品无法通过该接口修改库存)
*
* @param productId 内部商品ID
* @param skuId 内部sku_id
* @param diffType 修改类型 1增加 2减少 3设置
+ * 建议使用1或2,不建议使用3,因为使用3在高并发场景可能会出现预期外表现
* @param num 增加、减少或者设置的库存值
* @return WxChannelBaseResponse
*
@@ -127,6 +199,245 @@ WxChannelBaseResponse updateStock(String productId, String skuId, Integer diffTy
*/
SkuStockResponse getSkuStock(String productId, String skuId) throws WxErrorException;
+ /**
+ * 批量获取库存信息 (单次请求不能超过50个商品ID)
+ *
+ * @param productIds 商品ID列表
+ * @return 库存信息
+ * @throws WxErrorException 异常
+ */
+ SkuStockBatchResponse getSkuStockBatch(List productIds) throws WxErrorException;
+
+ /**
+ * 获取商品H5链接
+ *
+ * @param productId 商品ID
+ * @return 商品H5链接
+ * @throws WxErrorException 异常
+ */
+ ProductH5UrlResponse getProductH5Url(String productId) throws WxErrorException;
+
+ /**
+ * 获取商品二维码
+ *
+ * @param productId 商品ID
+ * @return 商品二维码
+ * @throws WxErrorException 异常
+ */
+ ProductQrCodeResponse getProductQrCode(String productId) throws WxErrorException;
+
+ /**
+ * 获取商品口令
+ *
+ * @param productId 商品ID
+ * @return 商品口令
+ * @throws WxErrorException 异常
+ */
+ ProductTagLinkResponse getProductTagLink(String productId) throws WxErrorException;
+
+ /**
+ * 获取商品的移动应用跳转 scheme 码.
+ *
+ * @param param 商品 ID、来源 appid、过期时间和附加信息
+ * @return 商品跳转 scheme 码
+ * @throws WxErrorException 调用微信接口失败
+ */
+ ProductSchemeResponse getProductScheme(ProductSchemeParam param) throws WxErrorException;
+
+ /**
+ * 商品类目推荐.
+ *
+ * @param param 请求类型、商品标题、主图和可选类目 ID;当请求类型为 2 时必须提供类目 ID
+ * @return 推荐类目及店铺经营权限
+ * @throws WxErrorException 调用微信接口失败
+ */
+ ProductCategoryClassifyResponse classifyProductCategory(ProductCategoryClassifyParam param) throws WxErrorException;
+
+ /**
+ * 将定时开售商品改为立即开售.
+ *
+ * @param param 商品 ID 和定时开售任务 ID
+ * @return 操作结果
+ * @throws WxErrorException 调用微信接口失败
+ */
+ WxChannelBaseResponse beginTimingSale(ProductTimingSaleParam param) throws WxErrorException;
+
+ /**
+ * 取消商品开售.
+ *
+ * @param productId 商品 ID
+ * @return 操作结果
+ * @throws WxErrorException 调用微信接口失败
+ */
+ WxChannelBaseResponse cancelTimingSale(String productId) throws WxErrorException;
+
+ /**
+ * 查询站内外商品属性映射.
+ *
+ * @param param 叶子类目 ID、外部类目和外部属性
+ * @return 对应的站内属性及可选属性值
+ * @throws WxErrorException 调用微信接口失败
+ */
+ ExternalProductMappingResponse externalProductMapping(ExternalProductMappingParam param) throws WxErrorException;
+
+ /**
+ * 发品前校验店铺类目资质.
+ *
+ * @param param 待发布商品的叶子类目 ID
+ * @return 校验结果和未通过原因
+ * @throws WxErrorException 调用微信接口失败
+ */
+ ProductCategoryPreCheckResponse categoryPreCheck(ProductCategoryPreCheckParam param) throws WxErrorException;
+
+ /**
+ * 获取店铺维度的商品上架策略.
+ *
+ * @return 当前上架策略
+ * @throws WxErrorException 调用微信接口失败
+ */
+ ProductAuditStrategyResponse getProductAuditStrategy() throws WxErrorException;
+
+ /**
+ * 设置店铺维度的商品上架策略.
+ *
+ * @param param 要设置的上架策略
+ * @return 操作结果
+ * @throws WxErrorException 调用微信接口失败
+ */
+ WxChannelBaseResponse setProductAuditStrategy(ProductAuditStrategySetParam param) throws WxErrorException;
+
+ /**
+ * 获取当前店铺的商品提审限额.
+ *
+ * @return 提审总额度和新品剩余额度
+ * @throws WxErrorException 调用微信接口失败
+ */
+ ProductAuditQuotaResponse getProductAuditQuota() throws WxErrorException;
+
+ /**
+ * 商品属性映射及推荐.
+ *
+ * @param param 叶子类目、商品标题、主图及可选的外部属性
+ * @return 推荐的站内属性
+ * @throws WxErrorException 调用微信接口失败
+ */
+ ExternalProductMappingNewResponse externalProductMappingNew(ExternalProductMappingNewParam param)
+ throws WxErrorException;
+
+ /**
+ * 根据商品信息推荐店铺已有资质的品牌.
+ *
+ * @param param 商品叶子类目、标题和图片
+ * @return 推荐品牌
+ * @throws WxErrorException 调用微信接口失败
+ */
+ ProductBrandRecommendResponse productBrandRecommend(ProductBrandRecommendParam param) throws WxErrorException;
+
+ /**
+ * 新增第三方货源信息.
+ *
+ * @param param 场景、发布方式、货主及货源商品信息
+ * @return 包含第三方货源 ID 的操作结果
+ * @throws WxErrorException 调用微信接口失败
+ */
+ AddProductThirdPartySourceResponse addProductThirdPartySource(AddProductThirdPartySourceParam param)
+ throws WxErrorException;
+
+ /**
+ * 获取商品库存流水.
+ *
+ * @param param 商品、SKU、库存类型、时间范围和分页参数;pageSize 必填,stockType 为 1 时 finderId 必填,库存类型非 0 和 1 时 stockTypeId 必填
+ * @return 库存流水及下一页标识
+ * @throws WxErrorException 调用微信接口失败
+ */
+ ProductStockFlowResponse getStockFlow(ProductStockFlowParam param) throws WxErrorException;
+
+ /**
+ * 添加非卖商品
+ *
+ * @param info 赠品信息
+ * @return 添加赠品响应
+ * @throws WxErrorException 异常
+ */
+ GiftProductAddResponse addGiftProduct(GiftProductInfo info) throws WxErrorException;
+
+ /**
+ * 更新非卖商品
+ *
+ * @param info 赠品信息
+ * @return 操作响应
+ * @throws WxErrorException 异常
+ */
+ WxChannelBaseResponse updateGiftProduct(GiftProductInfo info) throws WxErrorException;
+
+ /**
+ * 在售商品转赠品
+ *
+ * @param productId 商品ID
+ * @return 操作响应
+ * @throws WxErrorException 异常
+ */
+ WxChannelBaseResponse setProductAsGift(String productId) throws WxErrorException;
+
+ /**
+ * 获取赠品
+ *
+ * @param productId 赠品商品ID
+ * @return 赠品详情响应
+ * @throws WxErrorException 异常
+ */
+ GiftProductGetResponse getGiftProduct(String productId) throws WxErrorException;
+
+ /**
+ * 获取赠品列表
+ *
+ * @param param 查询参数
+ * @return 赠品列表
+ * @throws WxErrorException 异常
+ */
+ GiftProductListResponse listGiftProduct(GiftProductListParam param) throws WxErrorException;
+
+ /**
+ * 更新赠品库存
+ *
+ * @param productId 赠品商品ID
+ * @param skuId 赠品sku_id
+ * @param diffType 修改类型 1增加 2减少 3设置
+ * 建议使用1或2,不建议使用3,因为使用3在高并发场景可能会出现预期外表现
+ * @param num 增加、减少或者设置的库存值
+ * @return 操作响应
+ * @throws WxErrorException 异常
+ */
+ WxChannelBaseResponse updateGiftStock(String productId, String skuId, Integer diffType, Integer num)
+ throws WxErrorException;
+
+ /**
+ * 创建赠品活动
+ *
+ * @param info 活动信息
+ * @return 创建赠品活动响应
+ * @throws WxErrorException 异常
+ */
+ GiftActivityAddResponse addGiftActivity(GiftActivityInfo info) throws WxErrorException;
+
+ /**
+ * 删除赠品活动
+ *
+ * @param activityId 活动ID
+ * @return 操作响应
+ * @throws WxErrorException 异常
+ */
+ WxChannelBaseResponse deleteGiftActivity(String activityId) throws WxErrorException;
+
+ /**
+ * 停止赠品活动
+ *
+ * @param activityId 活动ID
+ * @return 操作响应
+ * @throws WxErrorException 异常
+ */
+ WxChannelBaseResponse stopGiftActivity(String activityId) throws WxErrorException;
+
/**
* 添加限时抢购任务
*
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelProductStockService.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelProductStockService.java
new file mode 100644
index 0000000000..77b012de1f
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelProductStockService.java
@@ -0,0 +1,58 @@
+package me.chanjar.weixin.channel.api;
+
+import java.util.List;
+import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
+import me.chanjar.weixin.channel.bean.product.SkuStockBatchResponse;
+import me.chanjar.weixin.channel.bean.product.SkuStockResponse;
+import me.chanjar.weixin.channel.bean.product.stock.StockFlowParam;
+import me.chanjar.weixin.channel.bean.product.stock.StockFlowResponse;
+import me.chanjar.weixin.common.error.WxErrorException;
+
+/**
+ * 微信小店商品库存服务。
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.api.WxStoreProductStockService}。
+ */
+@Deprecated
+public interface WxChannelProductStockService {
+
+ /**
+ * 更新商品库存。
+ *
+ * @param productId 商品ID
+ * @param skuId 商品sku_id
+ * @param diffType 修改类型 1增加 2减少 3设置
+ * @param num 增加、减少或者设置的库存值
+ * @return 操作响应
+ * @throws WxErrorException 异常
+ */
+ WxChannelBaseResponse updateStock(String productId, String skuId, Integer diffType, Integer num)
+ throws WxErrorException;
+
+ /**
+ * 获取商品实时库存。
+ *
+ * @param productId 商品ID
+ * @param skuId 商品sku_id
+ * @return 库存响应
+ * @throws WxErrorException 异常
+ */
+ SkuStockResponse getSkuStock(String productId, String skuId) throws WxErrorException;
+
+ /**
+ * 批量获取库存信息。
+ *
+ * @param productIds 商品ID列表,单次请求不超过50个
+ * @return 库存信息
+ * @throws WxErrorException 异常
+ */
+ SkuStockBatchResponse getSkuStockBatch(List productIds) throws WxErrorException;
+
+ /**
+ * 获取商品库存流水。
+ *
+ * @param param 库存流水查询参数
+ * @return 库存流水响应
+ * @throws WxErrorException 异常
+ */
+ StockFlowResponse getStockFlow(StockFlowParam param) throws WxErrorException;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelQicService.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelQicService.java
new file mode 100644
index 0000000000..e1e6521614
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelQicService.java
@@ -0,0 +1,69 @@
+package me.chanjar.weixin.channel.api;
+
+import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
+import me.chanjar.weixin.channel.bean.qic.InspectCodeResponse;
+import me.chanjar.weixin.channel.bean.qic.InspectConfigResponse;
+import me.chanjar.weixin.channel.bean.qic.RegisterLogisticsRequest;
+import me.chanjar.weixin.channel.bean.qic.SubmitConfigResponse;
+import me.chanjar.weixin.channel.bean.qic.SubmitInspectRequest;
+import me.chanjar.weixin.common.error.WxErrorException;
+
+/**
+ * 视频号小店 质检管理接口.
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.api.WxStoreQicService}。
+ */
+@Deprecated
+public interface WxChannelQicService {
+
+ /**
+ * 查询质检仓配置.
+ *
+ * @return 质检仓配置
+ * @throws WxErrorException 异常
+ */
+ InspectConfigResponse getInspectConfig() throws WxErrorException;
+
+ /**
+ * 查询送检配置模板信息.
+ *
+ * @param orderId 订单号(可选)
+ * @return 送检配置模板信息
+ * @throws WxErrorException 异常
+ */
+ SubmitConfigResponse getSubmitConfig(String orderId) throws WxErrorException;
+
+ /**
+ * 查询送检配置模板信息.
+ *
+ * @return 送检配置模板信息
+ * @throws WxErrorException 异常
+ */
+ SubmitConfigResponse getSubmitConfig() throws WxErrorException;
+
+ /**
+ * 打印质检码.
+ *
+ * @param orderId 订单号
+ * @return 质检码详情
+ * @throws WxErrorException 异常
+ */
+ InspectCodeResponse printInspectCode(String orderId) throws WxErrorException;
+
+ /**
+ * 绑定送检信息.
+ *
+ * @param request 送检信息请求
+ * @return 基础响应
+ * @throws WxErrorException 异常
+ */
+ WxChannelBaseResponse submitInspectInfo(SubmitInspectRequest request) throws WxErrorException;
+
+ /**
+ * 自寄快递送检.
+ *
+ * @param request 自寄快递请求
+ * @return 基础响应
+ * @throws WxErrorException 异常
+ */
+ WxChannelBaseResponse registerLogistics(RegisterLogisticsRequest request) throws WxErrorException;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelService.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelService.java
index 8f960f4795..7d18e61c57 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelService.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelService.java
@@ -7,90 +7,216 @@
*/
public interface WxChannelService extends BaseWxChannelService {
+ /**
+ * 商家客服服务。
+ *
+ * @return 商家客服服务
+
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.api.WxStoreService#getKfService()}。
+ */
+ @Deprecated
+ default WxChannelKfService getKfService() {
+ throw new UnsupportedOperationException("WxChannelService implementation does not support getKfService()");
+ }
+
/**
* 基础接口服务
*
* @return 基础接口服务
+
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.api.WxStoreService#getBasicService()}。
*/
+ @Deprecated
WxChannelBasicService getBasicService();
/**
* 商品类目服务
*
* @return 商品类目服务
+
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.api.WxStoreService#getCategoryService()}。
*/
+ @Deprecated
WxChannelCategoryService getCategoryService();
/**
* 品牌服务
*
* @return 品牌服务
+
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.api.WxStoreService#getBrandService()}。
*/
+ @Deprecated
WxChannelBrandService getBrandService();
/**
* 商品服务
*
* @return 商品服务
+
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.api.WxStoreService#getProductService()}。
*/
+ @Deprecated
WxChannelProductService getProductService();
+ /**
+ * 赠品与买赠活动服务
+ *
+ * @return 赠品与买赠活动服务
+
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.api.WxStoreService#getGiftService()}。
+ */
+ @Deprecated
+ default WxChannelGiftService getGiftService() {
+ throw new UnsupportedOperationException("Gift service is not supported by this implementation");
+ }
+
+ /**
+ * 限时抢购服务
+ *
+ * @return 限时抢购服务
+
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.api.WxStoreService#getLimitedDiscountService()}。
+ */
+ @Deprecated
+ default WxChannelLimitedDiscountService getLimitedDiscountService() {
+ throw new UnsupportedOperationException("Limited discount service is not supported by this implementation");
+ }
+
+ /**
+ * 商品库存服务
+ *
+ * @return 商品库存服务
+
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.api.WxStoreService#getProductStockService()}。
+ */
+ @Deprecated
+ default WxChannelProductStockService getProductStockService() {
+ throw new UnsupportedOperationException("Product stock service is not supported by this implementation");
+ }
+
+ /**
+ * 商品辅助功能服务
+ *
+ * @return 商品辅助功能服务
+
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.api.WxStoreService#getProductAssistantService()}。
+ */
+ @Deprecated
+ default WxChannelProductAssistantService getProductAssistantService() {
+ throw new UnsupportedOperationException("Product assistant service is not supported by this implementation");
+ }
+
/**
* 仓库服务
*
* @return 仓库服务
+
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.api.WxStoreService#getWarehouseService()}。
*/
+ @Deprecated
WxChannelWarehouseService getWarehouseService();
/**
* 订单服务
*
* @return 订单服务
+
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.api.WxStoreService#getOrderService()}。
*/
+ @Deprecated
WxChannelOrderService getOrderService();
/**
* 售后服务
*
* @return 售后服务
+
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.api.WxStoreService#getAfterSaleService()}。
*/
+ @Deprecated
WxChannelAfterSaleService getAfterSaleService();
/**
* 运费模板服务
*
* @return 运费模板服务
+
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.api.WxStoreService#getFreightTemplateService()}。
*/
+ @Deprecated
WxChannelFreightTemplateService getFreightTemplateService();
/**
* 地址服务
*
* @return 地址服务
+
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.api.WxStoreService#getAddressService()}。
*/
+ @Deprecated
WxChannelAddressService getAddressService();
/**
* 优惠券服务
*
* @return 优惠券服务
+
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.api.WxStoreService#getCouponService()}。
*/
+ @Deprecated
WxChannelCouponService getCouponService();
/**
* 分享员服务
*
* @return 分享员服务
+
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.api.WxStoreService#getSharerService()}。
*/
+ @Deprecated
WxChannelSharerService getSharerService();
/**
* 资金服务
*
* @return 资金服务
+
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.api.WxStoreService#getFundService()}。
*/
+ @Deprecated
WxChannelFundService getFundService();
+ /**
+ * 主页管理服务
+ *
+ * @return 主页管理服务
+
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.api.WxStoreService#getHomePageService()}。
+ */
+ @Deprecated
+ WxStoreHomePageService getHomePageService();
+
+ /**
+ * 合作账号服务
+ *
+ * @return 团长合作服务
+
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.api.WxStoreService#getCooperationService()}。
+ */
+ @Deprecated
+ WxStoreCooperationService getCooperationService();
+
+ /**
+ * 视频号/微信小店 罗盘商家版服务
+ *
+ * @return 罗盘商家版服务
+
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.api.WxStoreService#getCompassShopService()}。
+ */
+ @Deprecated
+ WxChannelCompassShopService getCompassShopService();
+
/**
* 优选联盟-团长合作达人管理服务
*
@@ -98,6 +224,16 @@ public interface WxChannelService extends BaseWxChannelService {
*/
WxLeagueWindowService getLeagueWindowService();
+ /**
+ * 代发管理服务
+ *
+ * @return 代发管理服务
+
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.api.WxStoreService#getSupplierService()}。
+ */
+ @Deprecated
+ WxChannelSupplierService getSupplierService();
+
/**
* 优选联盟-团长服务
*
@@ -119,4 +255,88 @@ public interface WxChannelService extends BaseWxChannelService {
*/
WxLeagueProductService getLeagueProductService();
+ /**
+ * 视频号助手 留资组件管理服务
+ *
+ * @return 留资组件管理服务
+ */
+ WxLeadComponentService getLeadComponentService();
+
+ /**
+ * 视频号助手 留资服务的直播数据服务
+ *
+ * @return 留资服务的直播数据服务
+ */
+ WxFinderLiveService getFinderLiveService();
+
+ /**
+ * 视频号助手 橱窗管理服务
+ *
+ * @return 橱窗管理服务
+ */
+ WxAssistantService getAssistantService();
+
+ /**
+ * 会员功能
+ *
+ * @return 会员服务
+
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.api.WxStoreService#getVipService()}。
+ */
+ @Deprecated
+ WxChannelVipService getVipService();
+
+ /**
+ * 视频号助手-罗盘达人版服务
+ *
+ * @return 罗盘达人版服务
+ */
+ WxChannelCompassFinderService getCompassFinderService();
+
+ /**
+ * 视频号助手-直播大屏数据服务
+ *
+ * @return 直播大屏数据服务
+ */
+ WxChannelLiveDashboardService getLiveDashboardService();
+
+ /**
+ * 质检管理服务.
+ *
+ * @return 质检管理服务
+
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.api.WxStoreService#getQicService()}。
+ */
+ @Deprecated
+ WxChannelQicService getQicService();
+
+ /**
+ * 微信小店-带货助手服务
+ *
+ * @return 带货助手服务
+ */
+ WxTalentService getTalentService();
+
+ /**
+ * 收藏管理服务
+ *
+ * @return 收藏管理服务
+
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.api.WxStoreService#getFavoriteService()}。
+ */
+ @Deprecated
+ WxChannelFavoriteService getFavoriteService();
+
+ /**
+ * 电子面单服务
+ *
+ * @return 电子面单服务
+
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.api.WxStoreService#getEwaybillService()}。
+ */
+ @Deprecated
+ default WxChannelEwaybillService getEwaybillService() {
+ throw new UnsupportedOperationException("当前 WxChannelService 实现不支持电子面单服务");
+ }
+
}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelSharerService.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelSharerService.java
index 300493158b..c802a23071 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelSharerService.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelSharerService.java
@@ -13,7 +13,9 @@
* 视频号小店 分享员服务接口
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.api.WxStoreSharerService}。
*/
+@Deprecated
public interface WxChannelSharerService {
/**
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelSupplierService.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelSupplierService.java
new file mode 100644
index 0000000000..48aa0a97c0
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelSupplierService.java
@@ -0,0 +1,72 @@
+package me.chanjar.weixin.channel.api;
+
+import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
+import me.chanjar.weixin.channel.bean.supplier.DistributeTypeResponse;
+import me.chanjar.weixin.channel.bean.supplier.DropshipAssignRequest;
+import me.chanjar.weixin.channel.bean.supplier.DropshipDetailResponse;
+import me.chanjar.weixin.channel.bean.supplier.DropshipListRequest;
+import me.chanjar.weixin.channel.bean.supplier.DropshipListResponse;
+import me.chanjar.weixin.channel.bean.supplier.DropshipResponse;
+import me.chanjar.weixin.channel.bean.supplier.DropshipSearchRequest;
+import me.chanjar.weixin.channel.bean.supplier.ProductDistributeRequest;
+import me.chanjar.weixin.channel.bean.supplier.ProductListResponse;
+import me.chanjar.weixin.channel.bean.supplier.SupplierInfoResponse;
+import me.chanjar.weixin.channel.bean.supplier.SupplierListResponse;
+import me.chanjar.weixin.common.error.WxErrorException;
+
+/**
+ * 视频号小店代发管理服务。
+ *
+ * @author GitHub Copilot
+ * @see 代发管理接口文档
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.api.WxStoreSupplierService}。
+ */
+@Deprecated
+public interface WxChannelSupplierService {
+
+ /** 获取供货商列表。 */
+ SupplierListResponse getSupplierList() throws WxErrorException;
+
+ /**
+ * 获取供货商列表。
+ *
+ * @param pageSize 每页数量
+ * @param nextKey 由上次请求返回,记录翻页的上下文。传入时会从上次返回的结果往后翻一页
+ * @return 供货商列表响应
+ * @throws WxErrorException 异常
+ */
+ SupplierListResponse getSupplierList(Integer pageSize, String nextKey) throws WxErrorException;
+
+ /** 获取分配方式。 */
+ DistributeTypeResponse getDistribute() throws WxErrorException;
+
+ /** 设置全店订单手动分配。 */
+ WxChannelBaseResponse setManuallyDistribute() throws WxErrorException;
+
+ /** 设置全店订单自动分配。 */
+ WxChannelBaseResponse setAllDistribute(String supplierId) throws WxErrorException;
+
+ /** 设置按商品自动分配。 */
+ WxChannelBaseResponse setProductDistribute(ProductDistributeRequest req) throws WxErrorException;
+
+ /** 获取商品对应的自动分配供货商。 */
+ SupplierInfoResponse getProductDefaultDistribute(String productId) throws WxErrorException;
+
+ /** 获取按商品自动分配的商品列表。 */
+ ProductListResponse getProductList(String supplierId) throws WxErrorException;
+
+ /** 分配订单代发。 */
+ DropshipResponse assignOrder(DropshipAssignRequest req) throws WxErrorException;
+
+ /** 取消分配代发单。 */
+ WxChannelBaseResponse cancelDropship(String orderId) throws WxErrorException;
+
+ /** 查询代发单详情。 */
+ DropshipDetailResponse getDropship(String orderId) throws WxErrorException;
+
+ /** 拉取代发单列表。 */
+ DropshipListResponse listDropship(DropshipListRequest req) throws WxErrorException;
+
+ /** 搜索代发单。 */
+ DropshipListResponse searchDropship(DropshipSearchRequest req) throws WxErrorException;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelVipService.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelVipService.java
new file mode 100644
index 0000000000..1ca08ff69f
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelVipService.java
@@ -0,0 +1,99 @@
+package me.chanjar.weixin.channel.api;
+
+import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
+import me.chanjar.weixin.channel.bean.vip.VipInfoResponse;
+import me.chanjar.weixin.channel.bean.vip.VipListResponse;
+import me.chanjar.weixin.channel.bean.vip.VipScoreResponse;
+import me.chanjar.weixin.common.error.WxErrorException;
+
+/**
+ * 视频号小店 会员功能接口
+ *
+ * @author aushiye
+ * @link 会员功能接口文档
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.api.WxStoreVipService}。
+ */
+@Deprecated
+public interface WxChannelVipService {
+ /** 拉取用户详情 */
+ // String VIP_USER_INFO_URL = "https://api.weixin.qq.com/channels/ec/vip/user/info/get";
+ // /** 拉取用户列表 */
+ // String VIP_USER_LIST_URL = "https://api.weixin.qq.com/channels/ec/vip/user/list/get";
+ //
+ // /** 获取用户积分 */
+ // String VIP_SCORE_URL = "https://api.weixin.qq.com/channels/ec/vip/user/score/get";
+ // /** 增加用户积分 */
+ // String SCORE_INCREASE_URL = "https://api.weixin.qq.com/channels/ec/vip/user/score/increase";
+ // /** 减少用户积分 */
+ // String SCORE_DECREASE_URL = "https://api.weixin.qq.com/channels/ec/vip/user/score/decrease";
+ //
+ // /** 更新用户等级 */
+ // String GRADE_UPDATE_URL = "https://api.weixin.qq.com/channels/ec/vip/user/grade/update";
+
+
+ /**
+ * 获取用户详情
+ *
+ * @param openId the open id
+ * @param needPhoneNumber the need phone number
+ * @return the vip info
+ * @throws WxErrorException the wx error exception
+ */
+ VipInfoResponse getVipInfo(String openId, Boolean needPhoneNumber) throws WxErrorException;
+
+
+ /**
+ * 获取用户积分
+ *
+ * @param needPhoneNumber the need phone number
+ * @param pageNum the page num
+ * @param pageSize the page size
+ * @return the vip list
+ * @throws WxErrorException the wx error exception
+ */
+ VipListResponse getVipList(Boolean needPhoneNumber, Integer pageNum, Integer pageSize) throws WxErrorException;
+
+ /**
+ * 获取用户积分
+ *
+ * @param openId the open id
+ * @return the vip score
+ * @throws WxErrorException the wx error exception
+ */
+ VipScoreResponse getVipScore(String openId) throws WxErrorException;
+
+ /**
+ * 增加用户积分
+ *
+ * @param openId the open id
+ * @param score the score
+ * @param remark the remark
+ * @param requestId the request id
+ * @return the wx channel base response
+ * @throws WxErrorException the wx error exception
+ */
+ WxChannelBaseResponse increaseVipScore(String openId, String score, String remark, String requestId) throws WxErrorException;
+
+ /**
+ * 减少用户积分
+ *
+ * @param openId the open id
+ * @param score the score
+ * @param remark the remark
+ * @param requestId the request id
+ * @return the wx channel base response
+ * @throws WxErrorException the wx error exception
+ */
+ WxChannelBaseResponse decreaseVipScore(String openId, String score, String remark, String requestId) throws WxErrorException;
+
+ /**
+ * 更新用户等级
+ *
+ * @param openId the open id
+ * @param score the score
+ * @return the wx channel base response
+ * @throws WxErrorException the wx error exception
+ */
+ WxChannelBaseResponse updateVipGrade(String openId, Integer score) throws WxErrorException;
+
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelWarehouseService.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelWarehouseService.java
index 1bb00885f5..4d9a60a7d0 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelWarehouseService.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelWarehouseService.java
@@ -18,7 +18,9 @@
* 视频号小店 区域仓库服务
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.api.WxStoreWarehouseService}。
*/
+@Deprecated
public interface WxChannelWarehouseService {
/**
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxFinderLiveService.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxFinderLiveService.java
new file mode 100644
index 0000000000..6e98134bcb
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxFinderLiveService.java
@@ -0,0 +1,41 @@
+package me.chanjar.weixin.channel.api;
+
+import me.chanjar.weixin.channel.bean.lead.component.request.GetFinderLiveDataListRequest;
+import me.chanjar.weixin.channel.bean.lead.component.request.GetFinderLiveLeadsDataRequest;
+import me.chanjar.weixin.channel.bean.lead.component.response.FinderAttrResponse;
+import me.chanjar.weixin.channel.bean.lead.component.response.GetFinderLiveDataListResponse;
+import me.chanjar.weixin.channel.bean.lead.component.response.GetFinderLiveLeadsDataResponse;
+import me.chanjar.weixin.common.error.WxErrorException;
+
+/**
+ * 视频号助手 留资服务的直播数据服务
+ *
+ * @author imyzt
+ */
+public interface WxFinderLiveService {
+
+ /**
+ * 获取视频号账号信息
+ *
+ * @return 视频号账号信息
+ */
+ FinderAttrResponse getFinderAttrByAppid() throws WxErrorException;
+
+ /**
+ * 获取留资直播间数据详情
+ *
+ * @param req 留资组件信息
+ * @return 留资信息详情
+ */
+ GetFinderLiveDataListResponse getFinderLiveDataList(GetFinderLiveDataListRequest req) throws WxErrorException;
+
+ /**
+ * 获取账号收集的留资数量
+ * 说明:该接口只统计2023.9.13号起的数据,所以start_time应大于等于1694534400
+ *
+ * @param req 留资组件信息
+ * @return 留资信息列表
+ */
+ GetFinderLiveLeadsDataResponse getFinderLiveLeadsData(GetFinderLiveLeadsDataRequest req) throws WxErrorException;
+
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxLeadComponentService.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxLeadComponentService.java
new file mode 100644
index 0000000000..36ae14bed3
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxLeadComponentService.java
@@ -0,0 +1,60 @@
+package me.chanjar.weixin.channel.api;
+
+import me.chanjar.weixin.channel.bean.lead.component.request.GetLeadInfoByComponentRequest;
+import me.chanjar.weixin.channel.bean.lead.component.request.GetLeadsComponentIdRequest;
+import me.chanjar.weixin.channel.bean.lead.component.request.GetLeadsComponentPromoteRecordRequest;
+import me.chanjar.weixin.channel.bean.lead.component.request.GetLeadsInfoByRequestIdRequest;
+import me.chanjar.weixin.channel.bean.lead.component.request.GetLeadsRequestIdRequest;
+import me.chanjar.weixin.channel.bean.lead.component.response.GetLeadsComponentIdResponse;
+import me.chanjar.weixin.channel.bean.lead.component.response.GetLeadsComponentPromoteRecordResponse;
+import me.chanjar.weixin.channel.bean.lead.component.response.GetLeadsRequestIdResponse;
+import me.chanjar.weixin.channel.bean.lead.component.response.LeadInfoResponse;
+import me.chanjar.weixin.common.error.WxErrorException;
+
+/**
+ * 视频号助手 留资组件管理服务
+ *
+ * @author imyzt
+ */
+public interface WxLeadComponentService {
+
+ /**
+ * 按时间获取留资信息详情
+ *
+ * @param req 留资组件信息
+ * @return 留资信息详情
+ */
+ LeadInfoResponse getLeadsInfoByComponentId(GetLeadInfoByComponentRequest req) throws WxErrorException;
+
+ /**
+ * 按直播场次获取留资信息详情
+ *
+ * @param req 留资组件信息
+ * @return 留资信息详情
+ */
+ LeadInfoResponse getLeadsInfoByRequestId(GetLeadsInfoByRequestIdRequest req) throws WxErrorException;
+
+ /**
+ * 获取留资request_id列表详情
+ *
+ * @param req 留资组件信息
+ * @return 留资信息列表
+ */
+ GetLeadsRequestIdResponse getLeadsRequestId(GetLeadsRequestIdRequest req) throws WxErrorException;
+
+ /**
+ * 获取留资组件直播推广记录信息详情
+ *
+ * @param req 留资组件信息
+ * @return 留资组件直播推广记录信息详情
+ */
+ GetLeadsComponentPromoteRecordResponse getLeadsComponentPromoteRecord(GetLeadsComponentPromoteRecordRequest req) throws WxErrorException;
+
+ /**
+ * 获取留资组件Id列表详情
+ *
+ * @param req 留资组件信息
+ * @return 留资组件Id列表
+ */
+ GetLeadsComponentIdResponse getLeadsComponentId(GetLeadsComponentIdRequest req) throws WxErrorException;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxLeaguePromoterService.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxLeaguePromoterService.java
index 8a8ffb9acf..60cf112271 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxLeaguePromoterService.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxLeaguePromoterService.java
@@ -15,43 +15,84 @@ public interface WxLeaguePromoterService {
/**
* 新增达人
*
- * @param finderId 视频号finder_id
+ * @param finderId 视频号finder_id,待废除
* @return 结果
+ * @deprecated 使用 {@link #addPromoterV2(String)}
*/
+ @Deprecated
WxChannelBaseResponse addPromoter(String finderId) throws WxErrorException;
/**
* 编辑达人
*
- * @param finderId 视频号finder_id
+ * @param finderId 视频号finder_id,待废除
* @param type 操作 1取消邀请 2结束合作
* @return 结果
+ * @deprecated 使用 {@link #updatePromoterV2(String, int)}
*/
+ @Deprecated
WxChannelBaseResponse updatePromoter(String finderId, int type) throws WxErrorException;
/**
* 删除达人
*
- * @param finderId 视频号finder_id
+ * @param finderId 视频号finder_id,待废除
* @return 结果
+ * @deprecated 使用 {@link #deletePromoterV2(String)}
*/
+ @Deprecated
WxChannelBaseResponse deletePromoter(String finderId) throws WxErrorException;
/**
* 获取达人详情信息
*
- * @param finderId 视频号finder_id
+ * @param finderId 视频号finder_id,待废除
* @return 结果
+ * @deprecated 使用 {@link #getPromoterInfoV2(String)}
*/
+ @Deprecated
PromoterInfoResponse getPromoterInfo(String finderId) throws WxErrorException;
- /**
- * 获取达人列表
- *
- * @param pageIndex 页面下标,下标从1开始,默认为1
- * @param pageSize 单页达人数(不超过200)
- * @param status 拉取该状态下的达人列表
- * @return 结果
- */
- PromoterListResponse listPromoter(Integer pageIndex, Integer pageSize, Integer status) throws WxErrorException;
+ /**
+ * 新增达人
+ *
+ * @param promoterId 达人带货id
+ * @return 结果
+ */
+ WxChannelBaseResponse addPromoterV2(String promoterId) throws WxErrorException;
+
+ /**
+ * 编辑达人
+ *
+ * @param promoterId 达人带货id
+ * @param type 操作 1取消邀请 2结束合作
+ * @return 结果
+ */
+ WxChannelBaseResponse updatePromoterV2(String promoterId, int type) throws WxErrorException;
+
+ /**
+ * 删除达人
+ *
+ * @param promoterId 达人带货id
+ * @return 结果
+ */
+ WxChannelBaseResponse deletePromoterV2(String promoterId) throws WxErrorException;
+
+ /**
+ * 获取达人详情信息
+ *
+ * @param promoterId 达人带货id
+ * @return 结果
+ */
+ PromoterInfoResponse getPromoterInfoV2(String promoterId) throws WxErrorException;
+
+ /**
+ * 获取达人列表
+ *
+ * @param pageIndex 页面下标,下标从1开始,默认为1
+ * @param pageSize 单页达人数(不超过200)
+ * @param status 拉取该状态下的达人列表
+ * @return 结果
+ */
+ PromoterListResponse listPromoter(Integer pageIndex, Integer pageSize, Integer status) throws WxErrorException;
}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxStoreCooperationService.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxStoreCooperationService.java
new file mode 100644
index 0000000000..477dfec384
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxStoreCooperationService.java
@@ -0,0 +1,72 @@
+package me.chanjar.weixin.channel.api;
+
+import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
+import me.chanjar.weixin.channel.bean.cooperation.CooperationListResponse;
+import me.chanjar.weixin.channel.bean.cooperation.CooperationQrCodeResponse;
+import me.chanjar.weixin.channel.bean.cooperation.CooperationStatusResponse;
+import me.chanjar.weixin.common.error.WxErrorException;
+
+/**
+ * 微信小店 合作账号相关接口
+ *
+ * @author Zeyes
+ * @see 合作账号状态机
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.api.WxStoreCooperationService}。
+ */
+@Deprecated
+public interface WxStoreCooperationService {
+
+ /**
+ * 获取合作账号列表
+ *
+ * @param sharerType 合作账号类型 2公众号 3小程序
+ * @return 合作账号列表
+ *
+ * @throws WxErrorException 异常
+ */
+ CooperationListResponse listCooperation(Integer sharerType) throws WxErrorException;
+
+ /**
+ * 获取合作账号状态
+ *
+ * @param sharerId 合作账号id 公众号: gh_开头id 小程序: appid
+ * @param sharerType 合作账号类型 2公众号 3小程序
+ * @return 合作账号状态
+ *
+ * @throws WxErrorException 异常
+ */
+ CooperationStatusResponse getCooperationStatus(String sharerId, Integer sharerType) throws WxErrorException;
+
+ /**
+ * 生成合作账号邀请二维码
+ *
+ * @param sharerId 合作账号id 公众号: gh_开头id 小程序: appid
+ * @param sharerType 合作账号类型 2公众号 3小程序
+ * @return 二维码
+ *
+ * @throws WxErrorException 异常
+ */
+ CooperationQrCodeResponse generateQrCode(String sharerId, Integer sharerType) throws WxErrorException;
+
+ /**
+ * 取消合作账号邀请
+ *
+ * @param sharerId 合作账号id 公众号: gh_开头id 小程序: appid
+ * @param sharerType 合作账号类型 2公众号 3小程序
+ * @return WxChannelBaseResponse
+ *
+ * @throws WxErrorException 异常
+ */
+ WxChannelBaseResponse cancelInvitation(String sharerId, Integer sharerType) throws WxErrorException;
+
+ /**
+ * 解绑合作账号
+ *
+ * @param sharerId 合作账号id 公众号: gh_开头id 小程序: appid
+ * @param sharerType 合作账号类型 2公众号 3小程序
+ * @return WxChannelBaseResponse
+ *
+ * @throws WxErrorException 异常
+ */
+ WxChannelBaseResponse unbind(String sharerId, Integer sharerType) throws WxErrorException;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxStoreHomePageService.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxStoreHomePageService.java
new file mode 100644
index 0000000000..5d6d975105
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxStoreHomePageService.java
@@ -0,0 +1,190 @@
+package me.chanjar.weixin.channel.api;
+
+import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
+import me.chanjar.weixin.channel.bean.home.background.BackgroundApplyResponse;
+import me.chanjar.weixin.channel.bean.home.background.BackgroundGetResponse;
+import me.chanjar.weixin.channel.bean.home.banner.BannerApplyResponse;
+import me.chanjar.weixin.channel.bean.home.banner.BannerGetResponse;
+import me.chanjar.weixin.channel.bean.home.banner.BannerInfo;
+import me.chanjar.weixin.channel.bean.home.tree.TreeProductEditInfo;
+import me.chanjar.weixin.channel.bean.home.tree.TreeProductListInfo;
+import me.chanjar.weixin.channel.bean.home.tree.TreeProductListResponse;
+import me.chanjar.weixin.channel.bean.home.tree.TreeShowGetResponse;
+import me.chanjar.weixin.channel.bean.home.tree.TreeShowInfo;
+import me.chanjar.weixin.channel.bean.home.tree.TreeShowSetResponse;
+import me.chanjar.weixin.channel.bean.home.window.WindowProductSettingResponse;
+import me.chanjar.weixin.common.error.WxErrorException;
+
+/**
+ * 微信小店 主页管理相关接口
+ *
+ * @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.api.WxStoreHomePageService}。
+ */
+@Deprecated
+public interface WxStoreHomePageService {
+
+ /**
+ * 添加分类关联的商品
+ *
+ * @param info 商品分类以及商品id
+ * @return BaseResponse
+ *
+ * @throws WxErrorException 异常
+ */
+ WxChannelBaseResponse addTreeProduct(TreeProductEditInfo info) throws WxErrorException;
+
+ /**
+ * 删除分类关联的商品
+ *
+ * @param info 商品分类以及商品id
+ * @return BaseResponse
+ *
+ * @throws WxErrorException 异常
+ */
+ WxChannelBaseResponse delTreeProduct(TreeProductEditInfo info) throws WxErrorException;
+
+ /**
+ * 获取分类关联的商品ID列表
+ *
+ * @param info 分类id、分页大小、分页上下文
+ * @return 商品id、分页上下文
+ *
+ * @throws WxErrorException 异常
+ */
+ TreeProductListResponse getTreeProductList(TreeProductListInfo info) throws WxErrorException;
+
+ /**
+ * 设置展示在店铺主页的商品分类
+ *
+ * @param info 分类id
+ * @return 商品分类审核结果
+ *
+ * @throws WxErrorException 异常
+ */
+ TreeShowSetResponse setShowTree(TreeShowInfo info) throws WxErrorException;
+
+ /**
+ * 获取展示在店铺主页的商品分类
+ *
+ * @return 商品分类信息
+ *
+ * @throws WxErrorException 异常
+ */
+ TreeShowGetResponse getShowTree() throws WxErrorException;
+
+ /**
+ * 获取主页展示商品列表
+ *
+ * @param pageSize 分页大小
+ * @param nextKey 分页上下文
+ * @return WindowProductSettingResponse
+ *
+ * @throws WxErrorException 异常
+ */
+ WindowProductSettingResponse listWindowProduct(Integer pageSize, String nextKey) throws WxErrorException;
+
+ /**
+ * 删除主页展示商品
+ *
+ * @param productId 商品id
+ * @param indexNum 商品重新排序后的新序号,最大移动步长为500(即新序号与当前序号的距离小于500)
+ * @return BaseResponse
+ *
+ * @throws WxErrorException 异常
+ */
+ WxChannelBaseResponse reorderWindowProduct(String productId, Integer indexNum) throws WxErrorException;
+
+ /**
+ * 隐藏小店主页商品
+ *
+ * @param productId 商品id
+ * @param setHide 是否隐藏。1-隐藏,0-取消隐藏
+ * @return BaseResponse
+ *
+ * @throws WxErrorException 异常
+ */
+ WxChannelBaseResponse hideWindowProduct(String productId, Integer setHide) throws WxErrorException;
+
+ /**
+ * 置顶小店主页商品
+ *
+ * @param productId 商品id
+ * @param setTop 是否顶置。1-置顶,0-取消置顶
+ * @return BaseResponse
+ *
+ * @throws WxErrorException 异常
+ */
+ WxChannelBaseResponse topWindowProduct(String productId, Integer setTop) throws WxErrorException;
+
+ /**
+ * 提交背景图申请
+ *
+ * @param imgUrl 图片链接。请务必使用接口上传图片(参数resp_type=1),并将返回的img_url填入此处,不接受其他任何格式的图片url。
+ * 若url曾经做过转换(url前缀为mmecimage.cn/p/),则可以直接提交。
+ * @return 申请编号
+ *
+ * @throws WxErrorException 异常
+ * @see WxChannelBasicService#uploadImg(int, String)
+ */
+ BackgroundApplyResponse applyBackground(String imgUrl) throws WxErrorException;
+
+ /**
+ * 查询背景图
+ *
+ * @return 背景图信息
+ * @throws WxErrorException 异常
+ */
+ BackgroundGetResponse getBackground() throws WxErrorException;
+
+ /**
+ * 撤销主页背景图申请
+ *
+ * @param applyId 申请编号
+ * @return BaseResponse
+ * @throws WxErrorException 异常
+ */
+ WxChannelBaseResponse cancelBackground(Integer applyId) throws WxErrorException;
+
+ /**
+ * 清空主页背景图并撤销流程中的申请
+ *
+ * @return BaseResponse
+ * @throws WxErrorException 异常
+ */
+ WxChannelBaseResponse removeBackground() throws WxErrorException;
+
+ /**
+ * 提交精选展示位申请
+ *
+ * @param info 展示位信息
+ * @return 申请编号
+ * @throws WxErrorException 异常
+ */
+ BannerApplyResponse applyBanner(BannerInfo info) throws WxErrorException;
+
+ /**
+ * 查询精选展示位
+ *
+ * @return 展示位信息
+ * @throws WxErrorException 异常
+ */
+ BannerGetResponse getBanner() throws WxErrorException;
+
+ /**
+ * 撤销精选展示位申请
+ *
+ * @param applyId 申请编号
+ * @return BaseResponse
+ * @throws WxErrorException 异常
+ */
+ WxChannelBaseResponse cancelBanner(Integer applyId) throws WxErrorException;
+
+ /**
+ * 清空精选展示位并撤销流程中的申请
+ *
+ * @return BaseResponse
+ * @throws WxErrorException 异常
+ */
+ WxChannelBaseResponse removeBanner() throws WxErrorException;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxTalentService.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxTalentService.java
new file mode 100644
index 0000000000..c5737443ad
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxTalentService.java
@@ -0,0 +1,58 @@
+package me.chanjar.weixin.channel.api;
+
+import me.chanjar.weixin.channel.bean.talent.TalentOrderDetailParam;
+import me.chanjar.weixin.channel.bean.talent.TalentOrderDetailResponse;
+import me.chanjar.weixin.channel.bean.talent.TalentOrderListParam;
+import me.chanjar.weixin.channel.bean.talent.TalentOrderListResponse;
+import me.chanjar.weixin.channel.bean.talent.TalentWindowProductDetailParam;
+import me.chanjar.weixin.channel.bean.talent.TalentWindowProductDetailResponse;
+import me.chanjar.weixin.channel.bean.talent.TalentWindowProductListParam;
+import me.chanjar.weixin.channel.bean.talent.TalentWindowProductListResponse;
+import me.chanjar.weixin.common.error.WxErrorException;
+
+/**
+ * 微信小店-带货助手服务接口
+ *
+ * @author GitHub Copilot
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.api.WxTalentService}。
+ */
+@Deprecated
+public interface WxTalentService {
+
+ /**
+ * 获取佣金单列表
+ *
+ * @param param 查询参数
+ * @return 佣金单列表
+ * @throws WxErrorException 接口调用异常
+ */
+ TalentOrderListResponse getOrderList(TalentOrderListParam param) throws WxErrorException;
+
+ /**
+ * 获取佣金单详情
+ *
+ * @param param 查询参数
+ * @return 佣金单详情
+ * @throws WxErrorException 接口调用异常
+ */
+ TalentOrderDetailResponse getOrderDetail(TalentOrderDetailParam param) throws WxErrorException;
+
+ /**
+ * 获取达人橱窗商品列表
+ *
+ * @param param 查询参数
+ * @return 橱窗商品列表
+ * @throws WxErrorException 接口调用异常
+ */
+ TalentWindowProductListResponse getWindowProductList(TalentWindowProductListParam param) throws WxErrorException;
+
+ /**
+ * 获取达人橱窗商品详情
+ *
+ * @param param 查询参数
+ * @return 橱窗商品详情
+ * @throws WxErrorException 接口调用异常
+ */
+ TalentWindowProductDetailResponse getWindowProductDetail(TalentWindowProductDetailParam param)
+ throws WxErrorException;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/BaseWxChannelMessageServiceImpl.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/BaseWxChannelMessageServiceImpl.java
index 008da958a9..0aeabdd7c6 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/BaseWxChannelMessageServiceImpl.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/BaseWxChannelMessageServiceImpl.java
@@ -1,34 +1,5 @@
package me.chanjar.weixin.channel.api.impl;
-import static me.chanjar.weixin.channel.constant.MessageEventConstants.ACCOUNT_NOTIFY;
-import static me.chanjar.weixin.channel.constant.MessageEventConstants.AFTER_SALE_UPDATE;
-import static me.chanjar.weixin.channel.constant.MessageEventConstants.BRAND;
-import static me.chanjar.weixin.channel.constant.MessageEventConstants.COMPLAINT_NOTIFY;
-import static me.chanjar.weixin.channel.constant.MessageEventConstants.CREATE_COUPON;
-import static me.chanjar.weixin.channel.constant.MessageEventConstants.DELETE_COUPON;
-import static me.chanjar.weixin.channel.constant.MessageEventConstants.EXPIRE_COUPON;
-import static me.chanjar.weixin.channel.constant.MessageEventConstants.INVALID_COUPON;
-import static me.chanjar.weixin.channel.constant.MessageEventConstants.ORDER_CANCEL;
-import static me.chanjar.weixin.channel.constant.MessageEventConstants.ORDER_CONFIRM;
-import static me.chanjar.weixin.channel.constant.MessageEventConstants.ORDER_DELIVER;
-import static me.chanjar.weixin.channel.constant.MessageEventConstants.ORDER_EXT_INFO_UPDATE;
-import static me.chanjar.weixin.channel.constant.MessageEventConstants.ORDER_NEW;
-import static me.chanjar.weixin.channel.constant.MessageEventConstants.ORDER_PAY;
-import static me.chanjar.weixin.channel.constant.MessageEventConstants.ORDER_SETTLE;
-import static me.chanjar.weixin.channel.constant.MessageEventConstants.ORDER_STATUS_UPDATE;
-import static me.chanjar.weixin.channel.constant.MessageEventConstants.PRODUCT_CATEGORY_AUDIT;
-import static me.chanjar.weixin.channel.constant.MessageEventConstants.PRODUCT_SPU_AUDIT;
-import static me.chanjar.weixin.channel.constant.MessageEventConstants.PRODUCT_SPU_STATUS_UPDATE;
-import static me.chanjar.weixin.channel.constant.MessageEventConstants.PRODUCT_SPU_UPDATE;
-import static me.chanjar.weixin.channel.constant.MessageEventConstants.QRCODE_STATUS;
-import static me.chanjar.weixin.channel.constant.MessageEventConstants.RECEIVE_COUPON;
-import static me.chanjar.weixin.channel.constant.MessageEventConstants.SUPPLIER_ITEM_UPDATE;
-import static me.chanjar.weixin.channel.constant.MessageEventConstants.UPDATE_COUPON_INFO;
-import static me.chanjar.weixin.channel.constant.MessageEventConstants.USER_COUPON_EXPIRE;
-import static me.chanjar.weixin.channel.constant.MessageEventConstants.USER_COUPON_UNUSE;
-import static me.chanjar.weixin.channel.constant.MessageEventConstants.USER_COUPON_USE;
-import static me.chanjar.weixin.channel.constant.MessageEventConstants.WITHDRAW_NOTIFY;
-
import java.util.Map;
import lombok.extern.slf4j.Slf4j;
import me.chanjar.weixin.channel.api.BaseWxChannelMessageService;
@@ -52,7 +23,14 @@
import me.chanjar.weixin.channel.bean.message.product.BrandMessage;
import me.chanjar.weixin.channel.bean.message.product.CategoryAuditMessage;
import me.chanjar.weixin.channel.bean.message.product.SpuAuditMessage;
+import me.chanjar.weixin.channel.bean.message.product.SpuStockMessage;
+import me.chanjar.weixin.channel.bean.message.sharer.SharerChangeMessage;
+import me.chanjar.weixin.channel.bean.message.store.CloseStoreMessage;
+import me.chanjar.weixin.channel.bean.message.store.NicknameUpdateMessage;
import me.chanjar.weixin.channel.bean.message.supplier.SupplierItemMessage;
+import me.chanjar.weixin.channel.bean.message.vip.ExchangeInfoMessage;
+import me.chanjar.weixin.channel.bean.message.vip.UserInfoMessage;
+import me.chanjar.weixin.channel.bean.message.voucher.VoucherMessage;
import me.chanjar.weixin.channel.message.WxChannelMessage;
import me.chanjar.weixin.channel.message.WxChannelMessageRouter;
import me.chanjar.weixin.channel.message.WxChannelMessageRouterRule;
@@ -60,11 +38,13 @@
import me.chanjar.weixin.channel.util.JsonUtils;
import me.chanjar.weixin.common.session.WxSessionManager;
+import static me.chanjar.weixin.channel.constant.MessageEventConstants.*;
+
/**
* @author Zeyes
*/
@Slf4j
-public class BaseWxChannelMessageServiceImpl implements BaseWxChannelMessageService {
+public abstract class BaseWxChannelMessageServiceImpl implements BaseWxChannelMessageService {
/** 消息路由器 */
protected WxChannelMessageRouter router;
@@ -86,6 +66,8 @@ protected void addDefaultRule() {
this.addRule(SpuAuditMessage.class, PRODUCT_SPU_STATUS_UPDATE, this::spuStatusUpdate);
/* 商品更新 */
this.addRule(SpuAuditMessage.class, PRODUCT_SPU_UPDATE, this::spuUpdate);
+ /* 商品库存不足 */
+ this.addRule(SpuStockMessage.class, PRODUCT_STOCK_NO_ENOUGH, this::stockNoEnough);
/* 类目审核结果 */
this.addRule(CategoryAuditMessage.class, PRODUCT_CATEGORY_AUDIT, this::categoryAudit);
/* 订单下单 */
@@ -94,6 +76,8 @@ protected void addDefaultRule() {
this.addRule(OrderCancelMessage.class, ORDER_CANCEL, this::orderCancel);
/* 订单支付成功 */
this.addRule(OrderPayMessage.class, ORDER_PAY, this::orderPay);
+ /* 订单待发货 */
+ this.addRule(OrderIdMessage.class, ORDER_WAIT_SHIPPING, this::orderWaitShipping);
/* 订单发货 */
this.addRule(OrderDeliveryMessage.class, ORDER_DELIVER, this::orderDelivery);
/* 订单确认收货 */
@@ -126,6 +110,8 @@ protected void addDefaultRule() {
this.addRule(UserCouponExpireMessage.class, USER_COUPON_UNUSE, this::userCouponUnuse);
/* 优惠券返还通知 */
this.addRule(UserCouponExpireMessage.class, USER_COUPON_USE, this::userCouponUse);
+ /* 发放团购优惠成功通知 */
+ this.addRule(VoucherMessage.class, VOUCHER_SEND_SUCC, this::voucherSendSucc);
/* 结算账户变更回调 */
this.addRule(AccountNotifyMessage.class, ACCOUNT_NOTIFY, this::accountNotify);
/* 提现回调 */
@@ -134,6 +120,25 @@ protected void addDefaultRule() {
this.addRule(QrNotifyMessage.class, QRCODE_STATUS, this::qrNotify);
/* 团长 */
this.addRule(SupplierItemMessage.class, SUPPLIER_ITEM_UPDATE, this::supplierItemUpdate);
+
+ /* 用户加入会员 */
+ this.addRule(UserInfoMessage.class, USER_VIP_JOIN, false, this::vipJoin);
+ /* 用户注销会员 */
+ this.addRule(UserInfoMessage.class, USER_VIP_CLOSE,false, this::vipClose);
+ /* 用户等级信息更新 */
+ this.addRule(UserInfoMessage.class, USER_VIP_GRADE_INFO_UPDATE, false, this::vipGradeUpdate);
+ /* 用户积分更新 */
+ this.addRule(UserInfoMessage.class, USER_VIP_SCORE_UPDATE, false, this::vipScoreUpdate);
+ /* 用户积分兑换 */
+ this.addRule(ExchangeInfoMessage.class, USER_VIP_SCORE_EXCHANGE, false, this::vipScoreExchange);
+
+ /* 分享员变更 */
+ this.addRule(SharerChangeMessage.class,SHARER_CHANGE,false,this::sharerChange);
+
+ /* 小店注销 */
+ this.addRule(CloseStoreMessage.class, CLOSE_STORE, this::closeStore);
+ /* 小店修改名称 */
+ this.addRule(NicknameUpdateMessage.class, SET_SHOP_NICKNAME, this::updateNickname);
}
/**
@@ -144,17 +149,23 @@ protected void addDefaultRule() {
* @param consumer 处理器
* @param 消息类型
*/
- protected void addRule(Class clazz, String event,
- HandlerConsumer, WxSessionManager> consumer) {
+ protected void addRule(Class clazz, String event, Boolean async,
+ HandlerConsumer, WxSessionManager> consumer) {
WxChannelMessageRouterRule rule = new WxChannelMessageRouterRule<>();
- rule.setMessageClass(clazz).setEvent(event).setAsync(true);
+ rule.setMessageClass(clazz).setEvent(event).setAsync(async);
rule.getHandlers().add((message, content, appId, context, sessionManager) -> {
consumer.accept(message, content, appId, context, sessionManager);
return "success";
});
+ rule.setNext(true);
this.addRule(rule);
}
+ protected void addRule(Class clazz, String event,
+ HandlerConsumer, WxSessionManager> consumer) {
+ this.addRule(clazz, event, true, consumer);
+ }
+
@Override
public void addRule(WxChannelMessageRouterRule extends WxChannelMessage> rule) {
router.getRules().add(rule);
@@ -184,6 +195,12 @@ public void orderPay(OrderPayMessage message, String content, String appId,
log.info("订单支付成功:{}", JsonUtils.encode(message));
}
+ @Override
+ public void orderWaitShipping(OrderIdMessage message, String content, String appId,
+ Map context, WxSessionManager sessionManager) {
+ log.info("订单待发货:{}", JsonUtils.encode(message));
+ }
+
@Override
public void orderDelivery(OrderDeliveryMessage message, String content, String appId,
Map context, WxSessionManager sessionManager) {
@@ -232,6 +249,12 @@ public void spuUpdate(SpuAuditMessage message, String content, String appId,
log.info("商品更新:{}", JsonUtils.encode(message));
}
+ @Override
+ public void stockNoEnough(SpuStockMessage message, String content, String appId,
+ Map context, WxSessionManager sessionManager) {
+ log.info("商品库存不足:{}", JsonUtils.encode(message));
+ }
+
@Override
public void categoryAudit(CategoryAuditMessage message, String content, String appId,
Map context, WxSessionManager sessionManager) {
@@ -310,6 +333,12 @@ public void userCouponUnuse(UserCouponExpireMessage message, String content, Str
log.info("用户优惠券取消使用:{}", JsonUtils.encode(message));
}
+ @Override
+ public void voucherSendSucc(VoucherMessage message, String content, String appId,
+ Map context, WxSessionManager sessionManager) {
+ log.info("发放团购优惠成功:{}", JsonUtils.encode(message));
+ }
+
@Override
public void accountNotify(AccountNotifyMessage message, String content, String appId,
Map context, WxSessionManager sessionManager) {
@@ -340,4 +369,51 @@ public Object defaultMessageHandler(WxChannelMessage message, String content, St
log.info("默认消息处理:{}", JsonUtils.encode(message));
return null;
}
+
+ @Override
+ public void sharerChange(WxChannelMessage message, String content, String appId, Map context, WxSessionManager sessionManager) {
+ log.info("分享员变更:{}", JsonUtils.encode(message));
+ }
+
+ @Override
+ public void vipJoin(UserInfoMessage message, String content, String appId,
+ Map context, WxSessionManager sessionManager) {
+ log.info("用户加入会员:{}", JsonUtils.encode(message));
+ }
+
+ @Override
+ public void vipClose(UserInfoMessage message, String content, String appId,
+ Map context, WxSessionManager sessionManager) {
+ log.info("用户注销会员:{}", JsonUtils.encode(message));
+ }
+
+ @Override
+ public void vipGradeUpdate(UserInfoMessage message, String content, String appId,
+ Map context, WxSessionManager sessionManager) {
+ log.info("用户等级信息更新:{}", JsonUtils.encode(message));
+ }
+
+ @Override
+ public void vipScoreUpdate(UserInfoMessage message, String content, String appId,
+ Map context, WxSessionManager sessionManager) {
+ log.info("用户积分更新:{}", JsonUtils.encode(message));
+ }
+
+ @Override
+ public void vipScoreExchange(ExchangeInfoMessage message, String content, String appId,
+ Map context, WxSessionManager sessionManager) {
+ log.info("用户积分兑换:{}", JsonUtils.encode(message));
+ }
+
+ @Override
+ public void closeStore(CloseStoreMessage message, String content, String appId,
+ Map context, WxSessionManager sessionManager) {
+ log.info("小店注销:{}", JsonUtils.encode(message));
+ }
+
+ @Override
+ public void updateNickname(NicknameUpdateMessage message, String content, String appId,
+ Map context, WxSessionManager sessionManager) {
+ log.info("小店修改名称:{}", JsonUtils.encode(message));
+ }
}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/BaseWxChannelServiceImpl.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/BaseWxChannelServiceImpl.java
index 6dd12a5b51..427a24d3b7 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/BaseWxChannelServiceImpl.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/BaseWxChannelServiceImpl.java
@@ -2,36 +2,19 @@
import com.google.gson.JsonObject;
-import java.io.IOException;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.locks.Lock;
import lombok.extern.slf4j.Slf4j;
-import me.chanjar.weixin.channel.api.WxChannelAddressService;
-import me.chanjar.weixin.channel.api.WxChannelAfterSaleService;
-import me.chanjar.weixin.channel.api.WxChannelBasicService;
-import me.chanjar.weixin.channel.api.WxChannelBrandService;
-import me.chanjar.weixin.channel.api.WxChannelCategoryService;
-import me.chanjar.weixin.channel.api.WxChannelCouponService;
-import me.chanjar.weixin.channel.api.WxChannelFreightTemplateService;
-import me.chanjar.weixin.channel.api.WxChannelFundService;
-import me.chanjar.weixin.channel.api.WxChannelOrderService;
-import me.chanjar.weixin.channel.api.WxChannelProductService;
-import me.chanjar.weixin.channel.api.WxChannelService;
-import me.chanjar.weixin.channel.api.WxChannelSharerService;
-import me.chanjar.weixin.channel.api.WxChannelWarehouseService;
-import me.chanjar.weixin.channel.api.WxLeagueProductService;
-import me.chanjar.weixin.channel.api.WxLeaguePromoterService;
-import me.chanjar.weixin.channel.api.WxLeagueSupplierService;
-import me.chanjar.weixin.channel.api.WxLeagueWindowService;
+import me.chanjar.weixin.channel.api.*;
import me.chanjar.weixin.channel.config.WxChannelConfig;
import me.chanjar.weixin.channel.util.JsonUtils;
import me.chanjar.weixin.common.api.WxConsts;
+import me.chanjar.weixin.common.bean.CommonUploadParam;
import me.chanjar.weixin.common.bean.ToJson;
import me.chanjar.weixin.common.bean.WxAccessToken;
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.error.WxRuntimeException;
+import me.chanjar.weixin.common.executor.CommonUploadRequestExecutor;
import me.chanjar.weixin.common.util.DataUtils;
import me.chanjar.weixin.common.util.crypto.SHA1;
import me.chanjar.weixin.common.util.http.RequestExecutor;
@@ -40,6 +23,10 @@
import me.chanjar.weixin.common.util.http.SimplePostRequestExecutor;
import org.apache.commons.lang3.StringUtils;
+import java.io.IOException;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.locks.Lock;
+
/**
* @author Zeyes
* @see #doGetAccessTokenRequest
@@ -50,7 +37,14 @@ public abstract class BaseWxChannelServiceImpl implements WxChannelService
private final WxChannelBasicService basicService = new WxChannelBasicServiceImpl(this);
private final WxChannelCategoryService categoryService = new WxChannelCategoryServiceImpl(this);
private final WxChannelBrandService brandService = new WxChannelBrandServiceImpl(this);
- private final WxChannelProductService productService = new WxChannelProductServiceImpl(this);
+ private final WxChannelGiftService giftService = new WxChannelGiftServiceImpl(this);
+ private final WxChannelLimitedDiscountService limitedDiscountService =
+ new WxChannelLimitedDiscountServiceImpl(this);
+ private final WxChannelProductStockService productStockService = new WxChannelProductStockServiceImpl(this);
+ private final WxChannelProductAssistantService productAssistantService =
+ new WxChannelProductAssistantServiceImpl(this);
+ private final WxChannelProductService productService = new WxChannelProductServiceImpl(
+ this, giftService, limitedDiscountService, productStockService);
private final WxChannelWarehouseService warehouseService = new WxChannelWarehouseServiceImpl(this);
private final WxChannelOrderService orderService = new WxChannelOrderServiceImpl(this);
private final WxChannelAfterSaleService afterSaleService = new WxChannelAfterSaleServiceImpl(this);
@@ -60,17 +54,32 @@ public abstract class BaseWxChannelServiceImpl implements WxChannelService
private final WxChannelCouponService couponService = new WxChannelCouponServiceImpl(this);
private final WxChannelSharerService sharerService = new WxChannelSharerServiceImpl(this);
private final WxChannelFundService fundService = new WxChannelFundServiceImpl(this);
+ private WxStoreHomePageService homePageService = null;
+ private WxStoreCooperationService cooperationService = null;
+ private WxChannelCompassShopService compassShopService = null;
+ private WxChannelSupplierService supplierService = null;
private WxLeagueWindowService leagueWindowService = null;
private WxLeagueSupplierService leagueSupplierService = null;
private WxLeaguePromoterService leaguePromoterService = null;
private WxLeagueProductService leagueProductService = null;
+ private WxLeadComponentService leadComponentService = null;
+ private WxFinderLiveService finderLiveService = null;
+ private WxAssistantService assistantService = null;
+ private WxChannelVipService vipService = null;
+ private WxChannelCompassFinderService compassFinderService = null;
+ private WxChannelLiveDashboardService liveDashboardService = null;
+ private WxChannelQicService qicService = null;
+ private WxTalentService talentService = null;
+ private WxChannelFavoriteService favoriteService = null;
+ private WxChannelEwaybillService ewaybillService = null;
+ private WxChannelKfService kfService = null;
protected WxChannelConfig config;
private int retrySleepMillis = 1000;
private int maxRetryTimes = 5;
@Override
- public RequestHttp getRequestHttp() {
+ public RequestHttp getRequestHttp() {
return this;
}
@@ -79,7 +88,7 @@ public boolean checkSignature(String timestamp, String nonce, String signature)
try {
return SHA1.gen(this.getConfig().getToken(), timestamp, nonce).equals(signature);
} catch (Exception e) {
- log.error("Checking signature failed, and the reason is :" + e.getMessage());
+ log.error("Checking signature failed, and the reason is :{}", e.getMessage());
return false;
}
}
@@ -104,7 +113,12 @@ public String getAccessToken(boolean forceRefresh) throws WxErrorException {
return this.getConfig().getAccessToken();
}
} while (!locked);
- String response = doGetAccessTokenRequest();
+ String response;
+ if (getConfig().isStableAccessToken()) {
+ response = doGetStableAccessTokenRequest(forceRefresh);
+ } else {
+ response = doGetAccessTokenRequest();
+ }
return extractAccessToken(response);
} catch (IOException | InterruptedException e) {
throw new WxRuntimeException(e);
@@ -118,12 +132,19 @@ public String getAccessToken(boolean forceRefresh) throws WxErrorException {
/**
* 通过网络请求获取AccessToken
*
- * @return .
- *
- * @throws IOException .
+ * @return AccessToken
+ * @throws IOException IOException
*/
protected abstract String doGetAccessTokenRequest() throws IOException;
+ /**
+ * 通过网络请求获取稳定版AccessToken
+ *
+ * @return Stable AccessToken
+ * @throws IOException IOException
+ */
+ protected abstract String doGetStableAccessTokenRequest(boolean forceRefresh) throws IOException;
+
@Override
public String get(String url, String queryParam) throws WxErrorException {
return execute(SimpleGetRequestExecutor.create(this), url, queryParam);
@@ -145,6 +166,12 @@ public String post(String url, ToJson obj) throws WxErrorException {
return this.post(url, obj.toJson());
}
+ @Override
+ public String upload(String url, CommonUploadParam param) throws WxErrorException {
+ RequestExecutor executor = CommonUploadRequestExecutor.create(getRequestHttp());
+ return this.execute(executor, url, param);
+ }
+
@Override
public String post(String url, JsonObject jsonObject) throws WxErrorException {
return this.post(url, jsonObject.toString());
@@ -200,7 +227,7 @@ protected T execute0(RequestExecutor executor, String uri, E data,
}
protected T executeInternal(RequestExecutor executor, String uri, E data, boolean doNotAutoRefreshToken,
- boolean printResult) throws WxErrorException {
+ boolean printResult) throws WxErrorException {
E dataForLog = DataUtils.handleDataWithSecret(data);
if (uri.contains("access_token=")) {
@@ -217,7 +244,8 @@ protected T executeInternal(RequestExecutor executor, String uri, E
try {
T result = executor.execute(uriWithAccessToken, data, WxType.Channel);
- log.debug("\n【请求地址】: {}\n【请求参数】:{}\n【响应数据】:{}", uriWithAccessToken, dataForLog,
+ log.debug("\n【请求地址】: {}\n【请求参数】:{}\n【响应数据】:{}", uriWithAccessToken,
+ printResult ? dataForLog : "...",
printResult ? result : "...");
return result;
} catch (WxErrorException e) {
@@ -244,12 +272,14 @@ protected T executeInternal(RequestExecutor executor, String uri, E
}
if (error.getErrorCode() != 0) {
- log.warn("\n【请求地址】: {}\n【请求参数】:{}\n【错误信息】:{}", uriWithAccessToken, dataForLog, error);
+ log.warn("\n【请求地址】: {}\n【请求参数】:{}\n【错误信息】:{}", uriWithAccessToken,
+ printResult ? dataForLog : "...", error);
throw new WxErrorException(error, e);
}
return null;
} catch (IOException e) {
- log.warn("\n【请求地址】: {}\n【请求参数】:{}\n【异常信息】:{}", uriWithAccessToken, dataForLog, e.getMessage());
+ log.warn("\n【请求地址】: {}\n【请求参数】:{}\n【异常信息】:{}", uriWithAccessToken,
+ printResult ? dataForLog : "...", e.getMessage());
throw new WxRuntimeException(e);
}
}
@@ -259,13 +289,12 @@ protected T executeInternal(RequestExecutor executor, String uri, E
*
* @param resultContent 响应内容
* @return access token
- *
* @throws WxErrorException 异常
*/
protected String extractAccessToken(String resultContent) throws WxErrorException {
- log.info("resultContent: " + resultContent);
+ log.debug("access-token response: {}", resultContent);
WxChannelConfig config = this.getConfig();
- WxError error = WxError.fromJson(resultContent, WxType.MiniApp);
+ WxError error = WxError.fromJson(resultContent, WxType.Channel);
if (error.getErrorCode() != 0) {
throw new WxErrorException(error);
}
@@ -315,6 +344,26 @@ public WxChannelProductService getProductService() {
return productService;
}
+ @Override
+ public WxChannelGiftService getGiftService() {
+ return giftService;
+ }
+
+ @Override
+ public WxChannelLimitedDiscountService getLimitedDiscountService() {
+ return limitedDiscountService;
+ }
+
+ @Override
+ public WxChannelProductStockService getProductStockService() {
+ return productStockService;
+ }
+
+ @Override
+ public WxChannelProductAssistantService getProductAssistantService() {
+ return productAssistantService;
+ }
+
@Override
public WxChannelWarehouseService getWarehouseService() {
return warehouseService;
@@ -355,6 +404,38 @@ public WxChannelFundService getFundService() {
return fundService;
}
+ @Override
+ public synchronized WxStoreHomePageService getHomePageService() {
+ if (homePageService == null) {
+ homePageService = new WxStoreHomePageServiceImpl(this);
+ }
+ return homePageService;
+ }
+
+ @Override
+ public synchronized WxStoreCooperationService getCooperationService() {
+ if (cooperationService == null) {
+ cooperationService = new WxStoreCooperationServiceImpl(this);
+ }
+ return cooperationService;
+ }
+
+ @Override
+ public synchronized WxChannelCompassShopService getCompassShopService() {
+ if (compassShopService == null) {
+ compassShopService = new WxChannelCompassShopServiceImpl(this);
+ }
+ return compassShopService;
+ }
+
+ @Override
+ public synchronized WxChannelSupplierService getSupplierService() {
+ if (supplierService == null) {
+ supplierService = new WxChannelSupplierServiceImpl(this);
+ }
+ return supplierService;
+ }
+
@Override
public synchronized WxLeagueWindowService getLeagueWindowService() {
if (leagueWindowService == null) {
@@ -372,7 +453,7 @@ public synchronized WxLeagueSupplierService getLeagueSupplierService() {
}
@Override
- public synchronized WxLeaguePromoterService getLeaguePromoterService() {
+ public synchronized WxLeaguePromoterService getLeaguePromoterService() {
if (leaguePromoterService == null) {
leaguePromoterService = new WxLeaguePromoterServiceImpl(this);
}
@@ -386,4 +467,94 @@ public synchronized WxLeagueProductService getLeagueProductService() {
}
return leagueProductService;
}
+
+ @Override
+ public synchronized WxLeadComponentService getLeadComponentService() {
+ if (leadComponentService == null) {
+ leadComponentService = new WxLeadComponentServiceImpl(this);
+ }
+ return leadComponentService;
+ }
+
+ @Override
+ public synchronized WxFinderLiveService getFinderLiveService() {
+ if (finderLiveService == null) {
+ finderLiveService = new WxFinderLiveServiceImpl(this);
+ }
+ return finderLiveService;
+ }
+
+ @Override
+ public synchronized WxAssistantService getAssistantService() {
+ if (assistantService == null) {
+ assistantService = new WxAssistantServiceImpl(this) {
+ };
+ }
+ return assistantService;
+ }
+
+ @Override
+ public synchronized WxChannelVipService getVipService() {
+ if (vipService == null) {
+ vipService = new WxChannelVipServiceImpl(this);
+ }
+ return vipService;
+ }
+
+ @Override
+ public synchronized WxChannelCompassFinderService getCompassFinderService() {
+ if (compassFinderService == null) {
+ compassFinderService = new WxChannelCompassFinderServiceImpl(this);
+ }
+ return compassFinderService;
+ }
+
+ @Override
+ public synchronized WxChannelLiveDashboardService getLiveDashboardService() {
+ if (liveDashboardService == null) {
+ liveDashboardService = new WxChannelLiveDashboardServiceImpl(this);
+ }
+ return liveDashboardService;
+ }
+
+ @Override
+ public synchronized WxChannelQicService getQicService() {
+ if (qicService == null) {
+ qicService = new WxChannelQicServiceImpl(this);
+ }
+ return qicService;
+ }
+
+ @Override
+ public synchronized WxTalentService getTalentService() {
+ if (talentService == null) {
+ talentService = new WxTalentServiceImpl(this);
+ }
+ return talentService;
+ }
+
+ @Override
+ public synchronized WxChannelFavoriteService getFavoriteService() {
+ if (favoriteService == null) {
+ favoriteService = new WxChannelFavoriteServiceImpl(this);
+ }
+ return favoriteService;
+ }
+
+ @Override
+ public synchronized WxChannelEwaybillService getEwaybillService() {
+ if (ewaybillService == null) {
+ ewaybillService = new WxChannelEwaybillServiceImpl(this);
+ }
+ return ewaybillService;
+ }
+
+ @Override
+ public synchronized WxChannelKfService getKfService() {
+ if (kfService == null) {
+ kfService = new WxChannelKfServiceImpl(this);
+ }
+ return kfService;
+ }
+
}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxAssistantServiceImpl.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxAssistantServiceImpl.java
new file mode 100644
index 0000000000..58d6d45269
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxAssistantServiceImpl.java
@@ -0,0 +1,55 @@
+package me.chanjar.weixin.channel.api.impl;
+
+
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import me.chanjar.weixin.channel.api.WxAssistantService;
+import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
+import me.chanjar.weixin.channel.bean.window.request.AddWindowProductRequest;
+import me.chanjar.weixin.channel.bean.window.request.GetWindowProductListRequest;
+import me.chanjar.weixin.channel.bean.window.request.WindowProductRequest;
+import me.chanjar.weixin.channel.bean.window.response.GetWindowProductListResponse;
+import me.chanjar.weixin.channel.bean.window.response.GetWindowProductResponse;
+import me.chanjar.weixin.channel.util.ResponseUtils;
+import me.chanjar.weixin.common.error.WxErrorException;
+
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Assistant.ADD_WINDOW_PRODUCT_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Assistant.GET_WINDOW_PRODUCT_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Assistant.LIST_WINDOW_PRODUCT_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Assistant.OFF_WINDOW_PRODUCT_URL;
+
+/**
+ * 视频号助手 橱窗管理服务
+ *
+ * @author imyzt
+ */
+@RequiredArgsConstructor
+@Slf4j
+public class WxAssistantServiceImpl implements WxAssistantService {
+
+ /** 微信商店服务 */
+ private final BaseWxChannelServiceImpl, ?> shopService;
+ @Override
+ public WxChannelBaseResponse addWindowProduct(AddWindowProductRequest req) throws WxErrorException {
+ String resJson = shopService.post(ADD_WINDOW_PRODUCT_URL, req);
+ return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
+ }
+
+ @Override
+ public GetWindowProductResponse getWindowProduct(WindowProductRequest req) throws WxErrorException {
+ String resJson = shopService.post(GET_WINDOW_PRODUCT_URL, req);
+ return ResponseUtils.decode(resJson, GetWindowProductResponse.class);
+ }
+
+ @Override
+ public GetWindowProductListResponse getWindowProductList(GetWindowProductListRequest req) throws WxErrorException {
+ String resJson = shopService.post(LIST_WINDOW_PRODUCT_URL, req);
+ return ResponseUtils.decode(resJson, GetWindowProductListResponse.class);
+ }
+
+ @Override
+ public WxChannelBaseResponse offWindowProduct(WindowProductRequest req) throws WxErrorException {
+ String resJson = shopService.post(OFF_WINDOW_PRODUCT_URL, req);
+ return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
+ }
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelAddressServiceImpl.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelAddressServiceImpl.java
index 53b9eb4d7a..20cf128559 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelAddressServiceImpl.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelAddressServiceImpl.java
@@ -29,9 +29,9 @@
public class WxChannelAddressServiceImpl implements WxChannelAddressService {
/** 微信商店服务 */
- private final BaseWxChannelServiceImpl shopService;
+ private final BaseWxChannelServiceImpl, ?> shopService;
- public WxChannelAddressServiceImpl(BaseWxChannelServiceImpl shopService) {
+ public WxChannelAddressServiceImpl(BaseWxChannelServiceImpl, ?> shopService) {
this.shopService = shopService;
}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelAfterSaleServiceImpl.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelAfterSaleServiceImpl.java
index c29ea49b34..5f8c738741 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelAfterSaleServiceImpl.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelAfterSaleServiceImpl.java
@@ -1,30 +1,19 @@
package me.chanjar.weixin.channel.api.impl;
-import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.AfterSale.AFTER_SALE_ACCEPT_URL;
-import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.AfterSale.AFTER_SALE_GET_URL;
-import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.AfterSale.AFTER_SALE_LIST_URL;
-import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.AfterSale.AFTER_SALE_REJECT_URL;
-import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.AfterSale.AFTER_SALE_UPLOAD_URL;
-import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Complaint.ADD_COMPLAINT_MATERIAL_URL;
-import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Complaint.ADD_COMPLAINT_PROOF_URL;
-import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Complaint.GET_COMPLAINT_ORDER_URL;
-
-import java.util.List;
import lombok.extern.slf4j.Slf4j;
import me.chanjar.weixin.channel.api.WxChannelAfterSaleService;
-import me.chanjar.weixin.channel.bean.after.AfterSaleAcceptParam;
-import me.chanjar.weixin.channel.bean.after.AfterSaleIdParam;
-import me.chanjar.weixin.channel.bean.after.AfterSaleInfoResponse;
-import me.chanjar.weixin.channel.bean.after.AfterSaleListParam;
-import me.chanjar.weixin.channel.bean.after.AfterSaleListResponse;
-import me.chanjar.weixin.channel.bean.after.AfterSaleRejectParam;
-import me.chanjar.weixin.channel.bean.after.RefundEvidenceParam;
+import me.chanjar.weixin.channel.bean.after.*;
import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
import me.chanjar.weixin.channel.bean.complaint.ComplaintOrderResponse;
import me.chanjar.weixin.channel.bean.complaint.ComplaintParam;
import me.chanjar.weixin.channel.util.ResponseUtils;
import me.chanjar.weixin.common.error.WxErrorException;
+import java.util.List;
+
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.AfterSale.*;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Complaint.*;
+
/**
* 视频号小店 售后服务实现
*
@@ -33,17 +22,25 @@
@Slf4j
public class WxChannelAfterSaleServiceImpl implements WxChannelAfterSaleService {
- /** 微信商店服务 */
- private final BaseWxChannelServiceImpl shopService;
+ /**
+ * 微信商店服务
+ */
+ private final BaseWxChannelServiceImpl, ?> shopService;
- public WxChannelAfterSaleServiceImpl(BaseWxChannelServiceImpl shopService) {
+ public WxChannelAfterSaleServiceImpl(BaseWxChannelServiceImpl, ?> shopService) {
this.shopService = shopService;
}
@Override
public AfterSaleListResponse listIds(Long beginCreateTime, Long endCreateTime, String nextKey)
throws WxErrorException {
- AfterSaleListParam param = new AfterSaleListParam(beginCreateTime, endCreateTime, nextKey);
+ AfterSaleListParam param = new AfterSaleListParam(beginCreateTime, endCreateTime, null, null, nextKey);
+ String resJson = shopService.post(AFTER_SALE_LIST_URL, param);
+ return ResponseUtils.decode(resJson, AfterSaleListResponse.class);
+ }
+
+ @Override
+ public AfterSaleListResponse listIds(AfterSaleListParam param) throws WxErrorException {
String resJson = shopService.post(AFTER_SALE_LIST_URL, param);
return ResponseUtils.decode(resJson, AfterSaleListResponse.class);
}
@@ -56,15 +53,21 @@ public AfterSaleInfoResponse get(String afterSaleOrderId) throws WxErrorExceptio
}
@Override
- public WxChannelBaseResponse accept(String afterSaleOrderId, String addressId) throws WxErrorException {
- AfterSaleAcceptParam param = new AfterSaleAcceptParam(afterSaleOrderId, addressId);
+ public WxChannelBaseResponse accept(String afterSaleOrderId, String addressId, Integer acceptType) throws WxErrorException {
+ AfterSaleAcceptParam param = new AfterSaleAcceptParam(afterSaleOrderId, addressId, acceptType);
String resJson = shopService.post(AFTER_SALE_ACCEPT_URL, param);
return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
}
@Override
- public WxChannelBaseResponse reject(String afterSaleOrderId, String rejectReason) throws WxErrorException {
- AfterSaleRejectParam param = new AfterSaleRejectParam(afterSaleOrderId, rejectReason);
+ public WxChannelBaseResponse reject(String afterSaleOrderId, String rejectReason, Integer rejectReasonType) throws WxErrorException {
+ return reject(afterSaleOrderId, rejectReason, rejectReasonType, null);
+ }
+
+ @Override
+ public WxChannelBaseResponse reject(String afterSaleOrderId, String rejectReason, Integer rejectReasonType,
+ List rejectCertificates) throws WxErrorException {
+ AfterSaleRejectParam param = new AfterSaleRejectParam(afterSaleOrderId, rejectReason, rejectReasonType, rejectCertificates);
String resJson = shopService.post(AFTER_SALE_REJECT_URL, param);
return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
}
@@ -100,4 +103,75 @@ public ComplaintOrderResponse getComplaint(String complaintId) throws WxErrorExc
String resJson = shopService.post(GET_COMPLAINT_ORDER_URL, reqJson);
return ResponseUtils.decode(resJson, ComplaintOrderResponse.class);
}
+
+ @Override
+ public AfterSaleReasonResponse getAllReason() throws WxErrorException {
+ String resJson = shopService.post(AFTER_SALE_REASON_GET_URL, "{}");
+ return ResponseUtils.decode(resJson, AfterSaleReasonResponse.class);
+ }
+
+ @Override
+ public AfterSaleRejectReasonResponse getRejectReason() throws WxErrorException {
+ String resJson = shopService.post(AFTER_SALE_REJECT_REASON_GET_URL, "{}");
+ return ResponseUtils.decode(resJson, AfterSaleRejectReasonResponse.class);
+ }
+
+ @Override
+ public WxChannelBaseResponse acceptExchangeReship(String afterSaleOrderId, String waybillId, String deliveryId) throws WxErrorException {
+ AfterSaleAcceptExchangeReshipParam param = new AfterSaleAcceptExchangeReshipParam(afterSaleOrderId, waybillId, deliveryId);
+ String resJson = shopService.post(AFTER_SALE_ACCEPT_EXCHANGE_RESHIP_URL, param);
+ return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
+ }
+
+ @Override
+ public WxChannelBaseResponse rejectExchangeReship(String afterSaleOrderId, String rejectReason, Integer rejectReasonType, List rejectCertificates) throws WxErrorException {
+ AfterSaleRejectExchangeReshipParam param = new AfterSaleRejectExchangeReshipParam(afterSaleOrderId, rejectReason, rejectReasonType, rejectCertificates);
+ String resJson = shopService.post(AFTER_SALE_REJECT_EXCHANGE_RESHIP_URL, param);
+ return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
+ }
+
+ @Override
+ public WxChannelBaseResponse merchantUpdateAfterSale(AfterSaleMerchantUpdateParam param) throws WxErrorException {
+ String resJson = shopService.post(AFTER_SALE_MERCHANT_UPDATE_URL, param);
+ return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
+ }
+
+ @Override
+ public GuaranteeOrderListResponse listGuaranteeOrder(GuaranteeOrderListParam param) throws WxErrorException {
+ String resJson = shopService.post(GUARANTEE_ORDER_LIST_URL, param);
+ return ResponseUtils.decode(resJson, GuaranteeOrderListResponse.class);
+ }
+
+ @Override
+ public GuaranteeOrderInfoResponse getGuaranteeOrder(String guaranteeOrderId) throws WxErrorException {
+ GuaranteeOrderIdParam param = new GuaranteeOrderIdParam(guaranteeOrderId);
+ String resJson = shopService.post(GUARANTEE_ORDER_GET_URL, param);
+ return ResponseUtils.decode(resJson, GuaranteeOrderInfoResponse.class);
+ }
+
+ @Override
+ public WxChannelBaseResponse acceptGuarantee(String guaranteeOrderId) throws WxErrorException {
+ GuaranteeOrderIdParam param = new GuaranteeOrderIdParam(guaranteeOrderId);
+ String resJson = shopService.post(GUARANTEE_ORDER_ACCEPT_URL, param);
+ return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
+ }
+
+ @Override
+ public WxChannelBaseResponse modifyGuarantee(GuaranteeModifyRequest request) throws WxErrorException {
+ String resJson = shopService.post(GUARANTEE_ORDER_MODIFY_URL, request);
+ return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
+ }
+
+ @Override
+ public WxChannelBaseResponse proofGuarantee(GuaranteeProofRequest request) throws WxErrorException {
+ String resJson = shopService.post(GUARANTEE_ORDER_PROOF_URL, request);
+ return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
+ }
+
+ @Override
+ public WxChannelBaseResponse refuseGuarantee(GuaranteeRefuseRequest request) throws WxErrorException {
+ String resJson = shopService.post(GUARANTEE_ORDER_REFUSE_URL, request);
+ return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
+ }
+
}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelBasicServiceImpl.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelBasicServiceImpl.java
index cac5e9e513..45a869216e 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelBasicServiceImpl.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelBasicServiceImpl.java
@@ -2,7 +2,10 @@
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Basics.GET_ADDRESS_CODE;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Basics.GET_IMG_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Basics.GET_SHOP_H5URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Basics.GET_SHOP_INFO;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Basics.GET_SHOP_QRCODE;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Basics.GET_SHOP_TAGLINK;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Basics.IMG_UPLOAD_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Basics.UPLOAD_QUALIFICATION_FILE;
@@ -16,7 +19,10 @@
import me.chanjar.weixin.channel.bean.image.ChannelImageResponse;
import me.chanjar.weixin.channel.bean.image.QualificationFileResponse;
import me.chanjar.weixin.channel.bean.image.UploadImageResponse;
+import me.chanjar.weixin.channel.bean.shop.ShopH5UrlResponse;
import me.chanjar.weixin.channel.bean.shop.ShopInfoResponse;
+import me.chanjar.weixin.channel.bean.shop.ShopQrCodeResponse;
+import me.chanjar.weixin.channel.bean.shop.ShopTagLinkResponse;
import me.chanjar.weixin.channel.executor.ChannelFileUploadRequestExecutor;
import me.chanjar.weixin.channel.executor.ChannelMediaDownloadRequestExecutor;
import me.chanjar.weixin.channel.util.ResponseUtils;
@@ -31,9 +37,9 @@
public class WxChannelBasicServiceImpl implements WxChannelBasicService {
/** 微信商店服务 */
- private final BaseWxChannelServiceImpl shopService;
+ private final BaseWxChannelServiceImpl, ?> shopService;
- public WxChannelBasicServiceImpl(BaseWxChannelServiceImpl shopService) {
+ public WxChannelBasicServiceImpl(BaseWxChannelServiceImpl, ?> shopService) {
this.shopService = shopService;
}
@@ -56,7 +62,7 @@ public ChannelImageInfo uploadImg(int respType, String imgUrl) throws WxErrorExc
public ChannelImageInfo uploadImg(int respType, File file, int height, int width) throws WxErrorException {
String url = IMG_UPLOAD_URL + "?upload_type=0&resp_type=" + respType + "&height=" + height + "&width=" + width;
RequestExecutor executor = ChannelFileUploadRequestExecutor.create(shopService);
- String resJson = (String) shopService.execute(executor, url, file);
+ String resJson = shopService.execute(executor, url, file);
UploadImageResponse response = ResponseUtils.decode(resJson, UploadImageResponse.class);
return response.getImgInfo();
}
@@ -64,19 +70,19 @@ public ChannelImageInfo uploadImg(int respType, File file, int height, int width
@Override
public QualificationFileResponse uploadQualificationFile(File file) throws WxErrorException {
RequestExecutor executor = ChannelFileUploadRequestExecutor.create(shopService);
- String resJson = (String) shopService.execute(executor, UPLOAD_QUALIFICATION_FILE, file);
+ String resJson = shopService.execute(executor, UPLOAD_QUALIFICATION_FILE, file);
return ResponseUtils.decode(resJson, QualificationFileResponse.class);
}
@Override
public ChannelImageResponse getImg(String mediaId) throws WxErrorException {
String appId = shopService.getConfig().getAppid();
- ChannelImageResponse rs = null;
+ ChannelImageResponse rs;
try {
String url = GET_IMG_URL + "?media_id=" + mediaId;
RequestExecutor executor = ChannelMediaDownloadRequestExecutor.create(shopService,
Files.createTempDirectory("wxjava-channel-" + appId).toFile());
- rs = (ChannelImageResponse) shopService.execute(executor, url, null);
+ rs = shopService.execute(executor, url, null);
} catch (IOException e) {
throw new WxErrorException(WxError.builder().errorMsg(e.getMessage()).build(), e);
}
@@ -93,4 +99,23 @@ public AddressCodeResponse getAddressCode(Integer code) throws WxErrorException
return ResponseUtils.decode(resJson, AddressCodeResponse.class);
}
+ @Override
+ public ShopH5UrlResponse getShopH5Url() throws WxErrorException {
+ String resJson = shopService.post(GET_SHOP_H5URL, "{}");
+ return ResponseUtils.decode(resJson, ShopH5UrlResponse.class);
+ }
+
+ @Override
+ public ShopQrCodeResponse getShopQrCode(int qrcodeType) throws WxErrorException {
+ String reqJson = "{\"qrcode_type\":" + qrcodeType + "}";
+ String resJson = shopService.post(GET_SHOP_QRCODE, reqJson);
+ return ResponseUtils.decode(resJson, ShopQrCodeResponse.class);
+ }
+
+ @Override
+ public ShopTagLinkResponse getShopTagLink() throws WxErrorException {
+ String resJson = shopService.post(GET_SHOP_TAGLINK, "{}");
+ return ResponseUtils.decode(resJson, ShopTagLinkResponse.class);
+ }
+
}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelBrandServiceImpl.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelBrandServiceImpl.java
index 19aadcc06e..c6c476b116 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelBrandServiceImpl.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelBrandServiceImpl.java
@@ -33,9 +33,9 @@
public class WxChannelBrandServiceImpl implements WxChannelBrandService {
/** 微信商店服务 */
- private final BaseWxChannelServiceImpl shopService;
+ private final BaseWxChannelServiceImpl, ?> shopService;
- public WxChannelBrandServiceImpl(BaseWxChannelServiceImpl shopService) {
+ public WxChannelBrandServiceImpl(BaseWxChannelServiceImpl, ?> shopService) {
this.shopService = shopService;
}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelCategoryServiceImpl.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelCategoryServiceImpl.java
index 52fdf3cdf8..7070ab9298 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelCategoryServiceImpl.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelCategoryServiceImpl.java
@@ -1,13 +1,5 @@
package me.chanjar.weixin.channel.api.impl;
-import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Category.ADD_CATEGORY_URL;
-import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Category.AVAILABLE_CATEGORY_URL;
-import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Category.CANCEL_CATEGORY_AUDIT_URL;
-import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Category.GET_CATEGORY_AUDIT_URL;
-import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Category.GET_CATEGORY_DETAIL_URL;
-import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Category.LIST_ALL_CATEGORY_URL;
-import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Category.LIST_PASS_CATEGORY_URL;
-
import java.util.Collections;
import java.util.List;
import lombok.extern.slf4j.Slf4j;
@@ -17,17 +9,15 @@
import me.chanjar.weixin.channel.bean.audit.CategoryAuditInfo;
import me.chanjar.weixin.channel.bean.audit.CategoryAuditRequest;
import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
-import me.chanjar.weixin.channel.bean.category.CategoryDetailResult;
-import me.chanjar.weixin.channel.bean.category.CategoryQualificationResponse;
-import me.chanjar.weixin.channel.bean.category.PassCategoryResponse;
-import me.chanjar.weixin.channel.bean.category.ShopCategory;
-import me.chanjar.weixin.channel.bean.category.ShopCategoryResponse;
+import me.chanjar.weixin.channel.bean.category.*;
import me.chanjar.weixin.channel.util.JsonUtils;
import me.chanjar.weixin.channel.util.ResponseUtils;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.common.util.http.SimpleGetRequestExecutor;
import me.chanjar.weixin.common.util.http.SimplePostRequestExecutor;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Category.*;
+
/**
* 视频号小店 商品类目相关接口
*
@@ -37,9 +27,9 @@
public class WxChannelCategoryServiceImpl implements WxChannelCategoryService {
/** 微信商店服务 */
- private final BaseWxChannelServiceImpl shopService;
+ private final BaseWxChannelServiceImpl, ?> shopService;
- public WxChannelCategoryServiceImpl(BaseWxChannelServiceImpl shopService) {
+ public WxChannelCategoryServiceImpl(BaseWxChannelServiceImpl, ?> shopService) {
this.shopService = shopService;
}
@@ -56,7 +46,7 @@ public List listAvailableCategory(String parentId) throws WxErrorE
try {
pid = Long.parseLong(parentId);
} catch (Throwable e) {
- log.error("parentId必须为数字, " + parentId, e);
+ log.error("parentId必须为数字, {}", parentId, e);
return Collections.emptyList();
}
String reqJson = "{\"f_cat_id\": " + pid + "}";
@@ -66,13 +56,21 @@ public List listAvailableCategory(String parentId) throws WxErrorE
return response.getCategories();
}
+ @Override
+ public ShopCategoryResponse listAvailableCategories(String fCatId) throws WxErrorException {
+ String reqJson = "{\"f_cat_id\": " + fCatId + "}";
+ String resJson = (String) shopService.executeWithoutLog(SimplePostRequestExecutor.create(shopService),
+ AVAILABLE_CATEGORY_URL, reqJson);
+ return ResponseUtils.decode(resJson, ShopCategoryResponse.class);
+ }
+
@Override
public CategoryDetailResult getCategoryDetail(String id) throws WxErrorException {
Long catId = null;
try {
catId = Long.parseLong(id);
} catch (Throwable e) {
- log.error("id必须为数字, " + id, e);
+ log.error("id必须为数字, {}", id, e);
return ResponseUtils.internalError(CategoryDetailResult.class);
}
String reqJson = "{\"cat_id\": " + catId + "}";
@@ -89,7 +87,11 @@ public AuditApplyResponse addCategory(String level1, String level2, String level
Long l1 = Long.parseLong(level1);
Long l2 = Long.parseLong(level2);
Long l3 = Long.parseLong(level3);
- CategoryAuditInfo categoryInfo = new CategoryAuditInfo(l1, l2, l3, certificate);
+ CategoryAuditInfo categoryInfo = new CategoryAuditInfo();
+ categoryInfo.setLevel1(l1);
+ categoryInfo.setLevel2(l2);
+ categoryInfo.setLevel3(l3);
+ categoryInfo.setCertificates(certificate);
reqJson = JsonUtils.encode(new CategoryAuditRequest(categoryInfo));
} catch (Throwable e) {
log.error("微信请求异常", e);
@@ -98,6 +100,13 @@ public AuditApplyResponse addCategory(String level1, String level2, String level
return ResponseUtils.decode(resJson, AuditApplyResponse.class);
}
+ @Override
+ public AuditApplyResponse addCategory(CategoryAuditInfo info) throws WxErrorException {
+ String reqJson = JsonUtils.encode(new CategoryAuditRequest(info));
+ String resJson = shopService.post(ADD_CATEGORY_URL, reqJson);
+ return ResponseUtils.decode(resJson, AuditApplyResponse.class);
+ }
+
@Override
public WxChannelBaseResponse cancelCategoryAudit(String auditId) throws WxErrorException {
String resJson = shopService.post(CANCEL_CATEGORY_AUDIT_URL, "{\"audit_id\": \"" + auditId + "\"}");
@@ -116,4 +125,15 @@ public PassCategoryResponse listPassCategory() throws WxErrorException {
return ResponseUtils.decode(resJson, PassCategoryResponse.class);
}
+ @Override
+ public RelationCategoryResponse listRelationCategory(Boolean isFilterStatus, Integer status) throws WxErrorException {
+ RelationCategoryRequest request = new RelationCategoryRequest(
+ isFilterStatus != null ? isFilterStatus : false,
+ status != null ? status : 0
+ );
+ String reqJson = JsonUtils.encode(request);
+ String resJson = shopService.post(LIST_RELATION_CATEGORY_URL, reqJson);
+ return ResponseUtils.decode(resJson, RelationCategoryResponse.class);
+ }
+
}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelCompassFinderServiceImpl.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelCompassFinderServiceImpl.java
new file mode 100644
index 0000000000..c80345aef2
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelCompassFinderServiceImpl.java
@@ -0,0 +1,55 @@
+package me.chanjar.weixin.channel.api.impl;
+
+import lombok.extern.slf4j.Slf4j;
+import me.chanjar.weixin.channel.api.WxChannelCompassFinderService;
+import me.chanjar.weixin.channel.bean.compass.CompassFinderBaseParam;
+import me.chanjar.weixin.channel.bean.compass.finder.*;
+import me.chanjar.weixin.channel.util.ResponseUtils;
+import me.chanjar.weixin.common.error.WxErrorException;
+
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.CompassFinder.*;
+
+/**
+ * 视频号助手 罗盘达人版服务实现
+ *
+ * @author Winnie
+ */
+@Slf4j
+public class WxChannelCompassFinderServiceImpl implements WxChannelCompassFinderService {
+
+ /**
+ * 微信商店服务
+ */
+ private final BaseWxChannelServiceImpl, ?> shopService;
+
+ public WxChannelCompassFinderServiceImpl(BaseWxChannelServiceImpl, ?> shopService) {this.shopService = shopService;}
+
+ @Override
+ public OverallResponse getOverall(String ds) throws WxErrorException {
+ CompassFinderBaseParam param = new CompassFinderBaseParam(ds);
+ String resJson = shopService.post(GET_OVERALL_URL, param);
+ return ResponseUtils.decode(resJson, OverallResponse.class);
+ }
+
+ @Override
+ public ProductDataResponse getProductData(String ds, String productId) throws WxErrorException {
+ ProductDataParam param = new ProductDataParam(ds, productId);
+ String resJson = shopService.post(GET_PRODUCT_DATA_URL, param);
+ return ResponseUtils.decode(resJson, ProductDataResponse.class);
+ }
+
+ @Override
+ public ProductListResponse getProductList(String ds) throws WxErrorException {
+ CompassFinderBaseParam param = new CompassFinderBaseParam(ds);
+ String resJson = shopService.post(GET_PRODUCT_LIST_URL, param);
+ return ResponseUtils.decode(resJson, ProductListResponse.class);
+ }
+
+ @Override
+ public SaleProfileDataResponse getSaleProfileData(String ds, Integer type) throws WxErrorException {
+ SaleProfileDataParam param = new SaleProfileDataParam(ds, type);
+ String resJson = shopService.post(GET_SALE_PROFILE_DATA_URL, param);
+ return ResponseUtils.decode(resJson, SaleProfileDataResponse.class);
+ }
+
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelCompassShopServiceImpl.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelCompassShopServiceImpl.java
new file mode 100644
index 0000000000..3a593a691f
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelCompassShopServiceImpl.java
@@ -0,0 +1,116 @@
+package me.chanjar.weixin.channel.api.impl;
+
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.CompassShop.FINDER_AUTH_LIST_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.CompassShop.FINDER_LIST_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.CompassShop.GET_FINDER_OVERALL_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.CompassShop.GET_FINDER_PRODUCT_LIST_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.CompassShop.GET_FINDER_PRODUCT_OVERALL_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.CompassShop.GET_LIVE_LIST_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.CompassShop.GET_SHOP_OVERALL_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.CompassShop.GET_SHOP_PRODUCT_DATA_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.CompassShop.GET_SHOP_PRODUCT_LIST_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.CompassShop.GET_SHOP_SALE_PROFILE_DATA_URL;
+
+import lombok.extern.slf4j.Slf4j;
+import me.chanjar.weixin.channel.api.WxChannelCompassShopService;
+import me.chanjar.weixin.channel.bean.compass.CompassFinderBaseParam;
+import me.chanjar.weixin.channel.bean.compass.shop.CompassFinderIdParam;
+import me.chanjar.weixin.channel.bean.compass.shop.FinderAuthListResponse;
+import me.chanjar.weixin.channel.bean.compass.shop.FinderListResponse;
+import me.chanjar.weixin.channel.bean.compass.shop.FinderOverallResponse;
+import me.chanjar.weixin.channel.bean.compass.shop.FinderProductListResponse;
+import me.chanjar.weixin.channel.bean.compass.shop.FinderProductOverallResponse;
+import me.chanjar.weixin.channel.bean.compass.shop.ShopLiveListResponse;
+import me.chanjar.weixin.channel.bean.compass.shop.ShopOverallResponse;
+import me.chanjar.weixin.channel.bean.compass.shop.ShopProductDataParam;
+import me.chanjar.weixin.channel.bean.compass.shop.ShopProductDataResponse;
+import me.chanjar.weixin.channel.bean.compass.shop.ShopProductListResponse;
+import me.chanjar.weixin.channel.bean.compass.shop.ShopSaleProfileDataParam;
+import me.chanjar.weixin.channel.bean.compass.shop.ShopSaleProfileDataResponse;
+import me.chanjar.weixin.channel.util.ResponseUtils;
+import me.chanjar.weixin.common.error.WxErrorException;
+
+/**
+ * 视频号/微信小店 罗盘商家版 服务实现
+ *
+ * @author Zeyes
+ */
+@Slf4j
+public class WxChannelCompassShopServiceImpl implements WxChannelCompassShopService {
+
+ /**
+ * 微信商店服务
+ */
+ private final BaseWxChannelServiceImpl, ?> shopService;
+
+ public WxChannelCompassShopServiceImpl(BaseWxChannelServiceImpl, ?> shopService) {this.shopService = shopService;}
+
+ @Override
+ public ShopOverallResponse getShopOverall(String ds) throws WxErrorException {
+ CompassFinderBaseParam param = new CompassFinderBaseParam(ds);
+ String resJson = shopService.post(GET_SHOP_OVERALL_URL, param);
+ return ResponseUtils.decode(resJson, ShopOverallResponse.class);
+ }
+
+ @Override
+ public FinderAuthListResponse getFinderAuthorizationList() throws WxErrorException {
+ String resJson = shopService.post(FINDER_AUTH_LIST_URL, "{}");
+ return ResponseUtils.decode(resJson, FinderAuthListResponse.class);
+ }
+
+ @Override
+ public FinderListResponse getFinderList(String ds) throws WxErrorException {
+ CompassFinderBaseParam param = new CompassFinderBaseParam(ds);
+ String resJson = shopService.post(FINDER_LIST_URL, param);
+ return ResponseUtils.decode(resJson, FinderListResponse.class);
+ }
+
+ @Override
+ public FinderOverallResponse getFinderOverall(String ds) throws WxErrorException {
+ CompassFinderBaseParam param = new CompassFinderBaseParam(ds);
+ String resJson = shopService.post(GET_FINDER_OVERALL_URL, param);
+ return ResponseUtils.decode(resJson, FinderOverallResponse.class);
+ }
+
+ @Override
+ public FinderProductListResponse getFinderProductList(String ds, String finderId) throws WxErrorException {
+ CompassFinderIdParam param = new CompassFinderIdParam(ds, finderId);
+ String resJson = shopService.post(GET_FINDER_PRODUCT_LIST_URL, param);
+ return ResponseUtils.decode(resJson, FinderProductListResponse.class);
+ }
+
+ @Override
+ public FinderProductOverallResponse getFinderProductOverall(String ds, String finderId) throws WxErrorException {
+ CompassFinderIdParam param = new CompassFinderIdParam(ds, finderId);
+ String resJson = shopService.post(GET_FINDER_PRODUCT_OVERALL_URL, param);
+ return ResponseUtils.decode(resJson, FinderProductOverallResponse.class);
+ }
+
+ @Override
+ public ShopLiveListResponse getShopLiveList(String ds, String finderId) throws WxErrorException {
+ CompassFinderIdParam param = new CompassFinderIdParam(ds, finderId);
+ String resJson = shopService.post(GET_LIVE_LIST_URL, param);
+ return ResponseUtils.decode(resJson, ShopLiveListResponse.class);
+ }
+
+ @Override
+ public ShopProductDataResponse getShopProductData(String ds, String productId) throws WxErrorException {
+ ShopProductDataParam param = new ShopProductDataParam(ds, productId);
+ String resJson = shopService.post(GET_SHOP_PRODUCT_DATA_URL, param);
+ return ResponseUtils.decode(resJson, ShopProductDataResponse.class);
+ }
+
+ @Override
+ public ShopProductListResponse getShopProductList(String ds) throws WxErrorException {
+ CompassFinderBaseParam param = new CompassFinderBaseParam(ds);
+ String resJson = shopService.post(GET_SHOP_PRODUCT_LIST_URL, param);
+ return ResponseUtils.decode(resJson, ShopProductListResponse.class);
+ }
+
+ @Override
+ public ShopSaleProfileDataResponse getShopSaleProfileData(String ds, Integer type) throws WxErrorException {
+ ShopSaleProfileDataParam param = new ShopSaleProfileDataParam(ds, type);
+ String resJson = shopService.post(GET_SHOP_SALE_PROFILE_DATA_URL, param);
+ return ResponseUtils.decode(resJson, ShopSaleProfileDataResponse.class);
+ }
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelCouponServiceImpl.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelCouponServiceImpl.java
index 174626f4a9..22abf25fb0 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelCouponServiceImpl.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelCouponServiceImpl.java
@@ -35,9 +35,9 @@
public class WxChannelCouponServiceImpl implements WxChannelCouponService {
/** 微信商店服务 */
- private final BaseWxChannelServiceImpl shopService;
+ private final BaseWxChannelServiceImpl, ?> shopService;
- public WxChannelCouponServiceImpl(BaseWxChannelServiceImpl shopService) {
+ public WxChannelCouponServiceImpl(BaseWxChannelServiceImpl, ?> shopService) {
this.shopService = shopService;
}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelEwaybillServiceImpl.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelEwaybillServiceImpl.java
new file mode 100644
index 0000000000..293230585f
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelEwaybillServiceImpl.java
@@ -0,0 +1,165 @@
+package me.chanjar.weixin.channel.api.impl;
+
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Ewaybill.ADD_SUB_ORDER_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Ewaybill.BATCH_PRINT_ORDER_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Ewaybill.CANCEL_ORDER_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Ewaybill.CREATE_ORDER_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Ewaybill.CREATE_TEMPLATE_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Ewaybill.DELETE_TEMPLATE_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Ewaybill.GET_ACCOUNT_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Ewaybill.GET_DELIVERY_LIST_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Ewaybill.GET_ORDER_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Ewaybill.GET_PRINT_CONTENT_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Ewaybill.GET_TEMPLATE_BY_ID_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Ewaybill.GET_TEMPLATE_CONFIG_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Ewaybill.GET_TEMPLATE_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Ewaybill.PRE_CREATE_ORDER_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Ewaybill.PRINT_ORDER_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Ewaybill.UPDATE_TEMPLATE_URL;
+
+import java.util.List;
+import me.chanjar.weixin.channel.api.WxChannelEwaybillService;
+import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
+import me.chanjar.weixin.channel.bean.ewaybill.AccountInfoResponse;
+import me.chanjar.weixin.channel.bean.ewaybill.AddSubOrderRequest;
+import me.chanjar.weixin.channel.bean.ewaybill.CreateOrderRequest;
+import me.chanjar.weixin.channel.bean.ewaybill.CreateOrderResponse;
+import me.chanjar.weixin.channel.bean.ewaybill.DeliveryListResponse;
+import me.chanjar.weixin.channel.bean.ewaybill.EwaybillOrderIdParam;
+import me.chanjar.weixin.channel.bean.ewaybill.PrintOrderRequest;
+import me.chanjar.weixin.channel.bean.ewaybill.BatchPrintOrderRequest;
+import me.chanjar.weixin.channel.bean.ewaybill.OrderDetailResponse;
+import me.chanjar.weixin.channel.bean.ewaybill.PreCreateRequest;
+import me.chanjar.weixin.channel.bean.ewaybill.PreCreateResponse;
+import me.chanjar.weixin.channel.bean.ewaybill.PrintContentResponse;
+import me.chanjar.weixin.channel.bean.ewaybill.PrintContentParam;
+import me.chanjar.weixin.channel.bean.ewaybill.TemplateCodeParam;
+import me.chanjar.weixin.channel.bean.ewaybill.TemplateConfigResponse;
+import me.chanjar.weixin.channel.bean.ewaybill.TemplateCreateRequest;
+import me.chanjar.weixin.channel.bean.ewaybill.TemplateIdParam;
+import me.chanjar.weixin.channel.bean.ewaybill.TemplateIdResponse;
+import me.chanjar.weixin.channel.bean.ewaybill.TemplateInfoResponse;
+import me.chanjar.weixin.channel.bean.ewaybill.TemplateUpdateRequest;
+import me.chanjar.weixin.channel.bean.ewaybill.WaybillIdParam;
+import me.chanjar.weixin.channel.bean.ewaybill.WaybillIdsParam;
+import me.chanjar.weixin.channel.util.JsonUtils;
+import me.chanjar.weixin.channel.util.ResponseUtils;
+import me.chanjar.weixin.common.error.WxErrorException;
+import me.chanjar.weixin.common.util.http.SimplePostRequestExecutor;
+
+/**
+ * 视频号小店电子面单服务实现。
+ *
+ * @author GitHub Copilot
+ */
+public class WxChannelEwaybillServiceImpl implements WxChannelEwaybillService {
+
+ /** 微信商店服务 */
+ private final BaseWxChannelServiceImpl, ?> shopService;
+
+ public WxChannelEwaybillServiceImpl(BaseWxChannelServiceImpl, ?> shopService) {
+ this.shopService = shopService;
+ }
+
+ @Override
+ public TemplateConfigResponse getTemplateConfig() throws WxErrorException {
+ String resJson = post(GET_TEMPLATE_CONFIG_URL, "{}");
+ return ResponseUtils.decode(resJson, TemplateConfigResponse.class);
+ }
+
+ @Override
+ public TemplateIdResponse createTemplate(TemplateCreateRequest req) throws WxErrorException {
+ String resJson = post(CREATE_TEMPLATE_URL, req);
+ return ResponseUtils.decode(resJson, TemplateIdResponse.class);
+ }
+
+ @Override
+ public WxChannelBaseResponse deleteTemplate(String templateId) throws WxErrorException {
+ String resJson = post(DELETE_TEMPLATE_URL, new TemplateIdParam(templateId));
+ return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
+ }
+
+ @Override
+ public WxChannelBaseResponse updateTemplate(TemplateUpdateRequest req) throws WxErrorException {
+ String resJson = post(UPDATE_TEMPLATE_URL, req);
+ return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
+ }
+
+ @Override
+ public TemplateInfoResponse getTemplate(String templateCode) throws WxErrorException {
+ String resJson = post(GET_TEMPLATE_URL, new TemplateCodeParam(templateCode));
+ return ResponseUtils.decode(resJson, TemplateInfoResponse.class);
+ }
+
+ @Override
+ public TemplateInfoResponse getTemplateById(String templateId) throws WxErrorException {
+ String resJson = post(GET_TEMPLATE_BY_ID_URL, new TemplateIdParam(templateId));
+ return ResponseUtils.decode(resJson, TemplateInfoResponse.class);
+ }
+
+ @Override
+ public AccountInfoResponse getAccount() throws WxErrorException {
+ String resJson = post(GET_ACCOUNT_URL, "{}");
+ return ResponseUtils.decode(resJson, AccountInfoResponse.class);
+ }
+
+ @Override
+ public DeliveryListResponse getDeliveryList() throws WxErrorException {
+ String resJson = post(GET_DELIVERY_LIST_URL, "{}");
+ return ResponseUtils.decode(resJson, DeliveryListResponse.class);
+ }
+
+ @Override
+ public PreCreateResponse preCreateOrder(PreCreateRequest req) throws WxErrorException {
+ String resJson = post(PRE_CREATE_ORDER_URL, req);
+ return ResponseUtils.decode(resJson, PreCreateResponse.class);
+ }
+
+ @Override
+ public CreateOrderResponse createOrder(CreateOrderRequest req) throws WxErrorException {
+ String resJson = post(CREATE_ORDER_URL, req);
+ return ResponseUtils.decode(resJson, CreateOrderResponse.class);
+ }
+
+ @Override
+ public WxChannelBaseResponse addSubOrder(AddSubOrderRequest req) throws WxErrorException {
+ String resJson = post(ADD_SUB_ORDER_URL, req);
+ return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
+ }
+
+ @Override
+ public WxChannelBaseResponse cancelOrder(PrintOrderRequest req) throws WxErrorException {
+ String resJson = post(CANCEL_ORDER_URL, req);
+ return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
+ }
+
+ @Override
+ public OrderDetailResponse getOrder(String ewaybillOrderId) throws WxErrorException {
+ String resJson = post(GET_ORDER_URL, new EwaybillOrderIdParam(ewaybillOrderId));
+ return ResponseUtils.decode(resJson, OrderDetailResponse.class);
+ }
+
+ @Override
+ public PrintContentResponse getPrintContent(String ewaybillOrderId, String templateId)
+ throws WxErrorException {
+ String resJson = post(GET_PRINT_CONTENT_URL, new PrintContentParam(ewaybillOrderId, templateId));
+ return ResponseUtils.decode(resJson, PrintContentResponse.class);
+ }
+
+ @Override
+ public WxChannelBaseResponse printOrder(PrintOrderRequest req) throws WxErrorException {
+ String resJson = post(PRINT_ORDER_URL, req);
+ return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
+ }
+
+ @Override
+ public WxChannelBaseResponse batchPrintOrder(BatchPrintOrderRequest req) throws WxErrorException {
+ String resJson = post(BATCH_PRINT_ORDER_URL, req);
+ return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
+ }
+
+ private String post(String url, Object request) throws WxErrorException {
+ return shopService.executeWithoutLog(
+ SimplePostRequestExecutor.create(shopService), url, JsonUtils.encode(request));
+ }
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelFavoriteServiceImpl.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelFavoriteServiceImpl.java
new file mode 100644
index 0000000000..8165f47987
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelFavoriteServiceImpl.java
@@ -0,0 +1,29 @@
+package me.chanjar.weixin.channel.api.impl;
+
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Favorite.GET_FAVORITE_COUNT;
+
+import me.chanjar.weixin.channel.api.WxChannelFavoriteService;
+import me.chanjar.weixin.channel.bean.favorite.FavoriteCountResponse;
+import me.chanjar.weixin.channel.util.ResponseUtils;
+import me.chanjar.weixin.common.error.WxErrorException;
+
+/**
+ * 视频号小店 收藏管理接口实现
+ *
+ * @author GitHub Copilot
+ */
+public class WxChannelFavoriteServiceImpl implements WxChannelFavoriteService {
+
+ /** 微信商店服务 */
+ private final BaseWxChannelServiceImpl, ?> shopService;
+
+ public WxChannelFavoriteServiceImpl(BaseWxChannelServiceImpl, ?> shopService) {
+ this.shopService = shopService;
+ }
+
+ @Override
+ public FavoriteCountResponse getFavoriteCount() throws WxErrorException {
+ String resJson = shopService.post(GET_FAVORITE_COUNT, "{}");
+ return ResponseUtils.decode(resJson, FavoriteCountResponse.class);
+ }
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelFreightTemplateServiceImpl.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelFreightTemplateServiceImpl.java
index 8fbfbd09c3..b8f00a4f84 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelFreightTemplateServiceImpl.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelFreightTemplateServiceImpl.java
@@ -24,9 +24,9 @@
@Slf4j
public class WxChannelFreightTemplateServiceImpl implements WxChannelFreightTemplateService {
/** 微信商店服务 */
- private final BaseWxChannelServiceImpl shopService;
+ private final BaseWxChannelServiceImpl, ?> shopService;
- public WxChannelFreightTemplateServiceImpl(BaseWxChannelServiceImpl shopService) {
+ public WxChannelFreightTemplateServiceImpl(BaseWxChannelServiceImpl, ?> shopService) {
this.shopService = shopService;
}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelFundServiceImpl.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelFundServiceImpl.java
index 050a19f44d..7cf30905ec 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelFundServiceImpl.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelFundServiceImpl.java
@@ -54,9 +54,9 @@ public class WxChannelFundServiceImpl implements WxChannelFundService {
/** 微信商店服务 */
- private final BaseWxChannelServiceImpl shopService;
+ private final BaseWxChannelServiceImpl, ?> shopService;
- public WxChannelFundServiceImpl(BaseWxChannelServiceImpl shopService) {
+ public WxChannelFundServiceImpl(BaseWxChannelServiceImpl, ?> shopService) {
this.shopService = shopService;
}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelGiftServiceImpl.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelGiftServiceImpl.java
new file mode 100644
index 0000000000..5d6a16bdc1
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelGiftServiceImpl.java
@@ -0,0 +1,104 @@
+package me.chanjar.weixin.channel.api.impl;
+
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.GIFT_ACTIVITY_ADD_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.GIFT_ACTIVITY_DELETE_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.GIFT_ACTIVITY_STOP_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.GIFT_PRODUCT_ADD_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.GIFT_PRODUCT_GET_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.GIFT_PRODUCT_LIST_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.GIFT_PRODUCT_ON_SALE_SET_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.GIFT_PRODUCT_STOCK_UPDATE_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.GIFT_PRODUCT_UPDATE_URL;
+
+import me.chanjar.weixin.channel.api.WxChannelGiftService;
+import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
+import me.chanjar.weixin.channel.bean.product.GiftActivityAddParam;
+import me.chanjar.weixin.channel.bean.product.GiftActivityAddResponse;
+import me.chanjar.weixin.channel.bean.product.GiftActivityInfo;
+import me.chanjar.weixin.channel.bean.product.GiftProductAddResponse;
+import me.chanjar.weixin.channel.bean.product.GiftProductGetResponse;
+import me.chanjar.weixin.channel.bean.product.GiftProductInfo;
+import me.chanjar.weixin.channel.bean.product.GiftProductListParam;
+import me.chanjar.weixin.channel.bean.product.GiftProductListResponse;
+import me.chanjar.weixin.channel.bean.product.SkuStockParam;
+import me.chanjar.weixin.channel.util.JsonUtils;
+import me.chanjar.weixin.channel.util.ResponseUtils;
+import me.chanjar.weixin.common.error.WxErrorException;
+
+/**
+ * 微信小店赠品与买赠活动服务实现。
+ */
+public class WxChannelGiftServiceImpl implements WxChannelGiftService {
+
+ private final BaseWxChannelServiceImpl, ?> shopService;
+
+ public WxChannelGiftServiceImpl(BaseWxChannelServiceImpl, ?> shopService) {
+ this.shopService = shopService;
+ }
+
+ @Override
+ public GiftProductAddResponse addGiftProduct(GiftProductInfo info) throws WxErrorException {
+ String reqJson = JsonUtils.encode(info);
+ String resJson = shopService.post(GIFT_PRODUCT_ADD_URL, reqJson);
+ return ResponseUtils.decode(resJson, GiftProductAddResponse.class);
+ }
+
+ @Override
+ public WxChannelBaseResponse updateGiftProduct(GiftProductInfo info) throws WxErrorException {
+ String reqJson = JsonUtils.encode(info);
+ String resJson = shopService.post(GIFT_PRODUCT_UPDATE_URL, reqJson);
+ return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
+ }
+
+ @Override
+ public WxChannelBaseResponse setProductAsGift(String productId) throws WxErrorException {
+ String reqJson = "{\"product_id\":\"" + productId + "\"}";
+ String resJson = shopService.post(GIFT_PRODUCT_ON_SALE_SET_URL, reqJson);
+ return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
+ }
+
+ @Override
+ public GiftProductGetResponse getGiftProduct(String productId) throws WxErrorException {
+ String reqJson = "{\"product_id\":\"" + productId + "\"}";
+ String resJson = shopService.post(GIFT_PRODUCT_GET_URL, reqJson);
+ return ResponseUtils.decode(resJson, GiftProductGetResponse.class);
+ }
+
+ @Override
+ public GiftProductListResponse listGiftProduct(GiftProductListParam param) throws WxErrorException {
+ String reqJson = JsonUtils.encode(param);
+ String resJson = shopService.post(GIFT_PRODUCT_LIST_URL, reqJson);
+ return ResponseUtils.decode(resJson, GiftProductListResponse.class);
+ }
+
+ @Override
+ public WxChannelBaseResponse updateGiftStock(String productId, String skuId, Integer diffType, Integer num)
+ throws WxErrorException {
+ SkuStockParam param = new SkuStockParam(productId, skuId, diffType, num);
+ String reqJson = JsonUtils.encode(param);
+ String resJson = shopService.post(GIFT_PRODUCT_STOCK_UPDATE_URL, reqJson);
+ return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
+ }
+
+ @Override
+ public GiftActivityAddResponse addGiftActivity(GiftActivityInfo info) throws WxErrorException {
+ GiftActivityAddParam param = new GiftActivityAddParam(info);
+ String reqJson = JsonUtils.encode(param);
+ String resJson = shopService.post(GIFT_ACTIVITY_ADD_URL, reqJson);
+ return ResponseUtils.decode(resJson, GiftActivityAddResponse.class);
+ }
+
+ @Override
+ public WxChannelBaseResponse deleteGiftActivity(String activityId) throws WxErrorException {
+ String reqJson = "{\"activity_id\":\"" + activityId + "\"}";
+ String resJson = shopService.post(GIFT_ACTIVITY_DELETE_URL, reqJson);
+ return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
+ }
+
+ @Override
+ public WxChannelBaseResponse stopGiftActivity(String activityId) throws WxErrorException {
+ String reqJson = "{\"activity_id\":\"" + activityId + "\"}";
+ String resJson = shopService.post(GIFT_ACTIVITY_STOP_URL, reqJson);
+ return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
+ }
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelKfServiceImpl.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelKfServiceImpl.java
new file mode 100644
index 0000000000..21bef92e1e
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelKfServiceImpl.java
@@ -0,0 +1,45 @@
+package me.chanjar.weixin.channel.api.impl;
+
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Kf.COS_UPLOAD_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Kf.SEND_MSG_URL;
+
+import me.chanjar.weixin.channel.api.WxChannelKfService;
+import me.chanjar.weixin.channel.bean.kf.WxChannelKfCosUploadResponse;
+import me.chanjar.weixin.channel.bean.kf.WxChannelKfSendMsgParam;
+import me.chanjar.weixin.channel.bean.kf.WxChannelKfSendMsgResponse;
+import me.chanjar.weixin.channel.util.JsonUtils;
+import me.chanjar.weixin.channel.util.ResponseUtils;
+import me.chanjar.weixin.common.bean.CommonUploadParam;
+import me.chanjar.weixin.common.error.WxErrorException;
+import me.chanjar.weixin.common.util.http.SimplePostRequestExecutor;
+
+/** 视频号小店商家客服服务实现。 */
+public class WxChannelKfServiceImpl implements WxChannelKfService {
+
+ private final BaseWxChannelServiceImpl, ?> channelService;
+
+ public WxChannelKfServiceImpl(BaseWxChannelServiceImpl, ?> channelService) {
+ this.channelService = channelService;
+ }
+
+ @Override
+ public String uploadMedia(String openId, String msgType, byte[] file) throws WxErrorException {
+ return uploadMedia(openId, msgType, null, file);
+ }
+
+ @Override
+ public String uploadMedia(String openId, String msgType, String fileName, byte[] file) throws WxErrorException {
+ CommonUploadParam uploadParam = CommonUploadParam.fromBytes("file", fileName, file)
+ .addFormField("open_id", openId)
+ .addFormField("msg_type", msgType);
+ String responseJson = channelService.upload(COS_UPLOAD_URL, uploadParam);
+ return ResponseUtils.decode(responseJson, WxChannelKfCosUploadResponse.class).getCosUrl();
+ }
+
+ @Override
+ public WxChannelKfSendMsgResponse sendMessage(WxChannelKfSendMsgParam param) throws WxErrorException {
+ String responseJson = channelService.executeWithoutLog(SimplePostRequestExecutor.create(channelService), SEND_MSG_URL,
+ JsonUtils.encode(param));
+ return ResponseUtils.decode(responseJson, WxChannelKfSendMsgResponse.class);
+ }
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelLimitedDiscountServiceImpl.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelLimitedDiscountServiceImpl.java
new file mode 100644
index 0000000000..26cca4d400
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelLimitedDiscountServiceImpl.java
@@ -0,0 +1,68 @@
+package me.chanjar.weixin.channel.api.impl;
+
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.ADD_LIMIT_TASK_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.DELETE_LIMIT_TASK_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.LIST_LIMIT_TASK_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.STOP_LIMIT_TASK_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.UPDATE_LIMIT_TASK_URL;
+
+import me.chanjar.weixin.channel.api.WxChannelLimitedDiscountService;
+import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
+import me.chanjar.weixin.channel.bean.limit.LimitTaskAddResponse;
+import me.chanjar.weixin.channel.bean.limit.LimitTaskListParam;
+import me.chanjar.weixin.channel.bean.limit.LimitTaskListResponse;
+import me.chanjar.weixin.channel.bean.limit.LimitTaskParam;
+import me.chanjar.weixin.channel.bean.limit.LimitTaskUpdateParam;
+import me.chanjar.weixin.channel.bean.limit.LimitTaskUpdateResponse;
+import me.chanjar.weixin.channel.util.JsonUtils;
+import me.chanjar.weixin.channel.util.ResponseUtils;
+import me.chanjar.weixin.common.error.WxErrorException;
+
+/**
+ * 微信小店限时抢购服务实现。
+ */
+public class WxChannelLimitedDiscountServiceImpl implements WxChannelLimitedDiscountService {
+
+ private final BaseWxChannelServiceImpl, ?> shopService;
+
+ public WxChannelLimitedDiscountServiceImpl(BaseWxChannelServiceImpl, ?> shopService) {
+ this.shopService = shopService;
+ }
+
+ @Override
+ public LimitTaskAddResponse addLimitTask(LimitTaskParam param) throws WxErrorException {
+ String reqJson = JsonUtils.encode(param);
+ String resJson = shopService.post(ADD_LIMIT_TASK_URL, reqJson);
+ return ResponseUtils.decode(resJson, LimitTaskAddResponse.class);
+ }
+
+ @Override
+ public LimitTaskListResponse listLimitTask(Integer pageSize, String nextKey, Integer status)
+ throws WxErrorException {
+ LimitTaskListParam param = new LimitTaskListParam(pageSize, nextKey, status);
+ String reqJson = JsonUtils.encode(param);
+ String resJson = shopService.post(LIST_LIMIT_TASK_URL, reqJson);
+ return ResponseUtils.decode(resJson, LimitTaskListResponse.class);
+ }
+
+ @Override
+ public WxChannelBaseResponse stopLimitTask(String taskId) throws WxErrorException {
+ String reqJson = "{\"task_id\": \"" + taskId + "\"}";
+ String resJson = shopService.post(STOP_LIMIT_TASK_URL, reqJson);
+ return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
+ }
+
+ @Override
+ public WxChannelBaseResponse deleteLimitTask(String taskId) throws WxErrorException {
+ String reqJson = "{\"task_id\": \"" + taskId + "\"}";
+ String resJson = shopService.post(DELETE_LIMIT_TASK_URL, reqJson);
+ return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
+ }
+
+ @Override
+ public LimitTaskUpdateResponse updateLimitTask(LimitTaskUpdateParam param) throws WxErrorException {
+ String reqJson = JsonUtils.encode(param);
+ String resJson = shopService.post(UPDATE_LIMIT_TASK_URL, reqJson);
+ return ResponseUtils.decode(resJson, LimitTaskUpdateResponse.class);
+ }
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelLiveDashboardServiceImpl.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelLiveDashboardServiceImpl.java
new file mode 100644
index 0000000000..7eace4377b
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelLiveDashboardServiceImpl.java
@@ -0,0 +1,81 @@
+package me.chanjar.weixin.channel.api.impl;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import lombok.extern.slf4j.Slf4j;
+import me.chanjar.weixin.channel.api.WxChannelLiveDashboardService;
+import me.chanjar.weixin.channel.bean.live.dashboard.LiveDataParam;
+import me.chanjar.weixin.channel.bean.live.dashboard.LiveDataResponse;
+import me.chanjar.weixin.channel.bean.live.dashboard.LiveListParam;
+import me.chanjar.weixin.channel.bean.live.dashboard.LiveListResponse;
+import me.chanjar.weixin.channel.util.ResponseUtils;
+import me.chanjar.weixin.common.error.WxErrorException;
+import org.apache.commons.lang3.ObjectUtils;
+
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.LiveDashboard.*;
+
+/**
+ * 视频号助手 直播大屏数据服务实现
+ *
+ * @author Winnie
+ */
+@Slf4j
+public class WxChannelLiveDashboardServiceImpl implements WxChannelLiveDashboardService {
+
+ /**
+ * 微信商店服务
+ */
+ private final BaseWxChannelServiceImpl, ?> shopService;
+ private final ObjectMapper objectMapper = new ObjectMapper();
+
+ public WxChannelLiveDashboardServiceImpl(BaseWxChannelServiceImpl, ?> shopService) {this.shopService = shopService;}
+
+ @Override
+ public LiveListResponse getLiveList(Long ds) throws WxErrorException {
+ LiveListParam param = new LiveListParam(ds);
+ String resJson = shopService.post(GET_LIVE_LIST_URL, param);
+ return ResponseUtils.decode(resJson, LiveListResponse.class);
+ }
+
+ @Override
+ public LiveDataResponse getLiveData(String exportId) throws WxErrorException {
+ LiveDataParam param = new LiveDataParam(exportId);
+ String resJson = shopService.post(GET_LIVE_DATA_URL, param);
+ return this.convertLiveDataResponse(resJson);
+ }
+
+ /**
+ * 微信接口获取直播数据中存在非标准JSON,方便业务处理返回前做好解析
+ * 处理参数:
+ * live_dashboard_data,live_comparison_index,live_ec_data_summary,live_ec_conversion_metric,
+ * live_ec_profile,live_distribution_channel,single_live_ec_spu_data_page_v2
+ *
+ * @param resJson 直播数据返回JSON
+ * @return LiveDataResponse
+ *
+ * @throws WxErrorException 异常
+ */
+ private LiveDataResponse convertLiveDataResponse(String resJson) throws WxErrorException {
+ try {
+ ObjectNode rootNode = (ObjectNode) objectMapper.readTree(resJson);
+ String[] dataKeyArray = new String[] {
+ "live_dashboard_data", "live_comparison_index", "live_ec_data_summary", "live_ec_conversion_metric",
+ "live_ec_profile", "live_distribution_channel", "single_live_ec_spu_data_page_v2"
+ };
+ for(String dataKey : dataKeyArray) {
+ JsonNode jsonNode = rootNode.get(dataKey);
+ if (ObjectUtils.isNotEmpty(jsonNode)) {
+ JsonNode dataJsonNode = objectMapper.readTree(jsonNode.asText());
+ rootNode.set(dataKey, dataJsonNode);
+ }
+ }
+ String json = objectMapper.writeValueAsString(rootNode);
+ return ResponseUtils.decode(json, LiveDataResponse.class);
+ } catch (JsonProcessingException e) {
+ throw new WxErrorException(e);
+ }
+ }
+
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelOrderServiceImpl.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelOrderServiceImpl.java
index acd14a2876..eff93082d7 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelOrderServiceImpl.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelOrderServiceImpl.java
@@ -1,14 +1,33 @@
package me.chanjar.weixin.channel.api.impl;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Delivery.DELIVERY_SEND_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Delivery.GET_DELIVERY_COMPANY_NEW_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Delivery.GET_DELIVERY_COMPANY_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.ACCEPT_ADDRESS_MODIFY_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.DECODE_SENSITIVE_INFO_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.DELIVERY_COMPENSATION_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.ORDER_GET_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.ORDER_LIST_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.ORDER_SEARCH_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.PRE_SHIPMENT_CHANGE_SKU_APPROVE_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.PRE_SHIPMENT_CHANGE_SKU_GET_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.PRE_SHIPMENT_CHANGE_SKU_REJECT_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.PRESENT_NOTE_ADD_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.PRESENT_SUB_ORDER_GET_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.REAL_NUMBER_APPLY_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.REAL_NUMBER_VIEW_AUDIT_GET_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.REJECT_ADDRESS_MODIFY_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.UPDATE_ADDRESS_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.UPDATE_EXPRESS_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.UPDATE_PRICE_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.UPDATE_REMARK_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.UPLOAD_FRESH_INSPECT_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.VIRTUAL_NUMBER_APPLY_AGAIN_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.VIRTUAL_NUMBER_DELAY_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.VIRTUAL_TEL_NUMBER_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.PrivateNumber.ADD_PHONE_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.PrivateNumber.GET_PHONE_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.PrivateNumber.SEND_VERIFY_CODE_URL;
import java.util.List;
import lombok.extern.slf4j.Slf4j;
@@ -18,16 +37,30 @@
import me.chanjar.weixin.channel.bean.delivery.DeliveryCompanyResponse;
import me.chanjar.weixin.channel.bean.delivery.DeliveryInfo;
import me.chanjar.weixin.channel.bean.delivery.DeliverySendParam;
+import me.chanjar.weixin.channel.bean.delivery.FreshInspectParam;
+import me.chanjar.weixin.channel.bean.delivery.PackageAuditInfo;
import me.chanjar.weixin.channel.bean.order.ChangeOrderInfo;
+import me.chanjar.weixin.channel.bean.order.DecodeSensitiveInfoResponse;
import me.chanjar.weixin.channel.bean.order.DeliveryUpdateParam;
import me.chanjar.weixin.channel.bean.order.OrderAddressParam;
+import me.chanjar.weixin.channel.bean.order.OrderCompensationDeliveryParam;
import me.chanjar.weixin.channel.bean.order.OrderIdParam;
+import me.chanjar.weixin.channel.bean.order.OrderInfoParam;
import me.chanjar.weixin.channel.bean.order.OrderInfoResponse;
import me.chanjar.weixin.channel.bean.order.OrderListParam;
import me.chanjar.weixin.channel.bean.order.OrderListResponse;
import me.chanjar.weixin.channel.bean.order.OrderPriceParam;
import me.chanjar.weixin.channel.bean.order.OrderRemarkParam;
import me.chanjar.weixin.channel.bean.order.OrderSearchParam;
+import me.chanjar.weixin.channel.bean.order.PreShipmentChangeSkuRejectParam;
+import me.chanjar.weixin.channel.bean.order.PreShipmentChangeSkuResponse;
+import me.chanjar.weixin.channel.bean.order.PresentNoteAddParam;
+import me.chanjar.weixin.channel.bean.order.PresentSubOrderResponse;
+import me.chanjar.weixin.channel.bean.order.PrivateNumberAddPhoneParam;
+import me.chanjar.weixin.channel.bean.order.PrivateNumberGetPhoneResponse;
+import me.chanjar.weixin.channel.bean.order.PrivateNumberSendVerifyCodeParam;
+import me.chanjar.weixin.channel.bean.order.RealNumberViewAuditResponse;
+import me.chanjar.weixin.channel.bean.order.VirtualTelNumberResponse;
import me.chanjar.weixin.channel.util.ResponseUtils;
import me.chanjar.weixin.common.error.WxErrorException;
@@ -41,15 +74,22 @@
public class WxChannelOrderServiceImpl implements WxChannelOrderService {
/** 微信商店服务 */
- private final BaseWxChannelServiceImpl shopService;
+ private final BaseWxChannelServiceImpl, ?> shopService;
- public WxChannelOrderServiceImpl(BaseWxChannelServiceImpl shopService) {
+ public WxChannelOrderServiceImpl(BaseWxChannelServiceImpl, ?> shopService) {
this.shopService = shopService;
}
@Override
public OrderInfoResponse getOrder(String orderId) throws WxErrorException {
- OrderIdParam param = new OrderIdParam(orderId);
+ OrderInfoParam param = new OrderInfoParam(orderId, null);
+ String resJson = shopService.post(ORDER_GET_URL, param);
+ return ResponseUtils.decode(resJson, OrderInfoResponse.class);
+ }
+
+ @Override
+ public OrderInfoResponse getOrder(String orderId, Boolean encodeSensitiveInfo) throws WxErrorException {
+ OrderInfoParam param = new OrderInfoParam(orderId, encodeSensitiveInfo);
String resJson = shopService.post(ORDER_GET_URL, param);
return ResponseUtils.decode(resJson, OrderInfoResponse.class);
}
@@ -95,6 +135,20 @@ public WxChannelBaseResponse updateDelivery(DeliveryUpdateParam param) throws Wx
return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
}
+ @Override
+ public WxChannelBaseResponse acceptAddressModify(String orderId) throws WxErrorException {
+ OrderIdParam param = new OrderIdParam(orderId);
+ String resJson = shopService.post(ACCEPT_ADDRESS_MODIFY_URL, param);
+ return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
+ }
+
+ @Override
+ public WxChannelBaseResponse rejectAddressModify(String orderId) throws WxErrorException {
+ OrderIdParam param = new OrderIdParam(orderId);
+ String resJson = shopService.post(REJECT_ADDRESS_MODIFY_URL, param);
+ return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
+ }
+
@Override
public WxChannelBaseResponse closeOrder(String orderId) {
// 暂不支持
@@ -107,6 +161,16 @@ public DeliveryCompanyResponse listDeliveryCompany() throws WxErrorException {
return ResponseUtils.decode(resJson, DeliveryCompanyResponse.class);
}
+ @Override
+ public DeliveryCompanyResponse listDeliveryCompany(Boolean ewaybillOnly) throws WxErrorException {
+ String reqJson = "{}";
+ if (ewaybillOnly != null) {
+ reqJson = "{\"ewaybill_only\":" + ewaybillOnly + "}";
+ }
+ String resJson = shopService.post(GET_DELIVERY_COMPANY_NEW_URL, reqJson);
+ return ResponseUtils.decode(resJson, DeliveryCompanyResponse.class);
+ }
+
@Override
public WxChannelBaseResponse deliveryOrder(String orderId, List deliveryList)
throws WxErrorException {
@@ -114,4 +178,117 @@ public WxChannelBaseResponse deliveryOrder(String orderId, List de
String resJson = shopService.post(DELIVERY_SEND_URL, param);
return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
}
+
+ @Override
+ public WxChannelBaseResponse uploadFreshInspect(String orderId, List items)
+ throws WxErrorException {
+ FreshInspectParam param = new FreshInspectParam(orderId, items);
+ String resJson = shopService.post(UPLOAD_FRESH_INSPECT_URL, param);
+ return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
+ }
+
+ @Override
+ public VirtualTelNumberResponse getVirtualTelNumber(String orderId) throws WxErrorException {
+ String reqJson = "{\"order_id\":\"" + orderId + "\"}";
+ String resJson = shopService.post(VIRTUAL_TEL_NUMBER_URL, reqJson);
+ return ResponseUtils.decode(resJson, VirtualTelNumberResponse.class);
+ }
+
+ @Override
+ public DecodeSensitiveInfoResponse decodeSensitiveInfo(String orderId) throws WxErrorException {
+ String reqJson = "{\"order_id\":\"" + orderId + "\"}";
+ String resJson = shopService.post(DECODE_SENSITIVE_INFO_URL, reqJson);
+ return ResponseUtils.decode(resJson, DecodeSensitiveInfoResponse.class);
+ }
+
+ @Override
+ public WxChannelBaseResponse addPresentNote(String orderId, String note) throws WxErrorException {
+ PresentNoteAddParam param = new PresentNoteAddParam(orderId, note);
+ String resJson = shopService.post(PRESENT_NOTE_ADD_URL, param);
+ return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
+ }
+
+ @Override
+ public PresentSubOrderResponse getPresentSubOrders(String orderId) throws WxErrorException {
+ OrderIdParam param = new OrderIdParam(orderId);
+ String resJson = shopService.post(PRESENT_SUB_ORDER_GET_URL, param);
+ return ResponseUtils.decode(resJson, PresentSubOrderResponse.class);
+ }
+
+ @Override
+ public PreShipmentChangeSkuResponse getPreShipmentChangeSku(String orderId) throws WxErrorException {
+ OrderIdParam param = new OrderIdParam(orderId);
+ String resJson = shopService.post(PRE_SHIPMENT_CHANGE_SKU_GET_URL, param);
+ return ResponseUtils.decode(resJson, PreShipmentChangeSkuResponse.class);
+ }
+
+ @Override
+ public WxChannelBaseResponse approvePreShipmentChangeSku(String orderId) throws WxErrorException {
+ OrderIdParam param = new OrderIdParam(orderId);
+ String resJson = shopService.post(PRE_SHIPMENT_CHANGE_SKU_APPROVE_URL, param);
+ return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
+ }
+
+ @Override
+ public WxChannelBaseResponse rejectPreShipmentChangeSku(String orderId, String rejectReason)
+ throws WxErrorException {
+ PreShipmentChangeSkuRejectParam param = new PreShipmentChangeSkuRejectParam(orderId, rejectReason);
+ String resJson = shopService.post(PRE_SHIPMENT_CHANGE_SKU_REJECT_URL, param);
+ return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
+ }
+
+ @Override
+ public WxChannelBaseResponse applyRealNumber(String orderId) throws WxErrorException {
+ OrderIdParam param = new OrderIdParam(orderId);
+ String resJson = shopService.post(REAL_NUMBER_APPLY_URL, param);
+ return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
+ }
+
+ @Override
+ public RealNumberViewAuditResponse getRealNumberViewAudit(String orderId) throws WxErrorException {
+ OrderIdParam param = new OrderIdParam(orderId);
+ String resJson = shopService.post(REAL_NUMBER_VIEW_AUDIT_GET_URL, param);
+ return ResponseUtils.decode(resJson, RealNumberViewAuditResponse.class);
+ }
+
+ @Override
+ public WxChannelBaseResponse applyVirtualNumberAgain(String orderId) throws WxErrorException {
+ OrderIdParam param = new OrderIdParam(orderId);
+ String resJson = shopService.post(VIRTUAL_NUMBER_APPLY_AGAIN_URL, param);
+ return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
+ }
+
+ @Override
+ public WxChannelBaseResponse delayVirtualNumber(String orderId) throws WxErrorException {
+ OrderIdParam param = new OrderIdParam(orderId);
+ String resJson = shopService.post(VIRTUAL_NUMBER_DELAY_URL, param);
+ return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
+ }
+
+ @Override
+ public WxChannelBaseResponse addPrivatePhone(String phone) throws WxErrorException {
+ PrivateNumberAddPhoneParam param = new PrivateNumberAddPhoneParam(phone);
+ String resJson = shopService.post(ADD_PHONE_URL, param);
+ return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
+ }
+
+ @Override
+ public WxChannelBaseResponse sendPrivatePhoneVerifyCode(String phone) throws WxErrorException {
+ PrivateNumberSendVerifyCodeParam param = new PrivateNumberSendVerifyCodeParam(phone);
+ String resJson = shopService.post(SEND_VERIFY_CODE_URL, param);
+ return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
+ }
+
+ @Override
+ public PrivateNumberGetPhoneResponse getPrivatePhone() throws WxErrorException {
+ String resJson = shopService.post(GET_PHONE_URL, "{}");
+ return ResponseUtils.decode(resJson, PrivateNumberGetPhoneResponse.class);
+ }
+
+ @Override
+ public WxChannelBaseResponse compensationDelivery(OrderCompensationDeliveryParam param)
+ throws WxErrorException {
+ String resJson = shopService.post(DELIVERY_COMPENSATION_URL, param);
+ return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
+ }
}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelProductAssistantServiceImpl.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelProductAssistantServiceImpl.java
new file mode 100644
index 0000000000..7f1de84d02
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelProductAssistantServiceImpl.java
@@ -0,0 +1,77 @@
+package me.chanjar.weixin.channel.api.impl;
+
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.BEGIN_TIMING_SALE_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.CANCEL_TIMING_SALE_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.CATEGORY_PRE_CHECK_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.EXTERNAL_PRODUCT_MAPPING_NEW_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.EXTERNAL_PRODUCT_MAPPING_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.PRODUCT_BRAND_RECOMMEND_URL;
+
+import me.chanjar.weixin.channel.api.WxChannelProductAssistantService;
+import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
+import me.chanjar.weixin.channel.bean.product.assistant.BeginTimingSaleParam;
+import me.chanjar.weixin.channel.bean.product.assistant.CancelTimingSaleParam;
+import me.chanjar.weixin.channel.bean.product.assistant.CategoryPreCheckParam;
+import me.chanjar.weixin.channel.bean.product.assistant.CategoryPreCheckResponse;
+import me.chanjar.weixin.channel.bean.product.assistant.ExternalProductMappingNewParam;
+import me.chanjar.weixin.channel.bean.product.assistant.ExternalProductMappingNewResponse;
+import me.chanjar.weixin.channel.bean.product.assistant.ExternalProductMappingParam;
+import me.chanjar.weixin.channel.bean.product.assistant.ExternalProductMappingResponse;
+import me.chanjar.weixin.channel.bean.product.assistant.ProductBrandRecommendParam;
+import me.chanjar.weixin.channel.bean.product.assistant.ProductBrandRecommendResponse;
+import me.chanjar.weixin.channel.util.JsonUtils;
+import me.chanjar.weixin.channel.util.ResponseUtils;
+import me.chanjar.weixin.common.error.WxErrorException;
+
+/**
+ * 微信小店商品辅助功能服务实现。
+ */
+public class WxChannelProductAssistantServiceImpl implements WxChannelProductAssistantService {
+
+ /** 微信商店服务 */
+ private final BaseWxChannelServiceImpl, ?> shopService;
+
+ public WxChannelProductAssistantServiceImpl(BaseWxChannelServiceImpl, ?> shopService) {
+ this.shopService = shopService;
+ }
+
+ @Override
+ public CategoryPreCheckResponse categoryPreCheck(CategoryPreCheckParam param) throws WxErrorException {
+ return post(CATEGORY_PRE_CHECK_URL, param, CategoryPreCheckResponse.class);
+ }
+
+ @Override
+ public ProductBrandRecommendResponse getProductBrandRecommend(ProductBrandRecommendParam param)
+ throws WxErrorException {
+ return post(PRODUCT_BRAND_RECOMMEND_URL, param, ProductBrandRecommendResponse.class);
+ }
+
+ @Override
+ public ExternalProductMappingResponse externalProductMapping(ExternalProductMappingParam param)
+ throws WxErrorException {
+ return post(EXTERNAL_PRODUCT_MAPPING_URL, param, ExternalProductMappingResponse.class);
+ }
+
+ @Override
+ public ExternalProductMappingNewResponse externalProductMappingNew(ExternalProductMappingNewParam param)
+ throws WxErrorException {
+ return post(EXTERNAL_PRODUCT_MAPPING_NEW_URL, param, ExternalProductMappingNewResponse.class);
+ }
+
+ @Override
+ public WxChannelBaseResponse beginTimingSale(BeginTimingSaleParam param) throws WxErrorException {
+ return post(BEGIN_TIMING_SALE_URL, param, WxChannelBaseResponse.class);
+ }
+
+ @Override
+ public WxChannelBaseResponse cancelTimingSale(CancelTimingSaleParam param) throws WxErrorException {
+ return post(CANCEL_TIMING_SALE_URL, param, WxChannelBaseResponse.class);
+ }
+
+ private T post(String url, Object param, Class responseType)
+ throws WxErrorException {
+ String reqJson = JsonUtils.encode(param);
+ String resJson = shopService.post(url, reqJson);
+ return ResponseUtils.decode(resJson, responseType);
+ }
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelProductServiceImpl.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelProductServiceImpl.java
index eb168a09e3..fb00f1874d 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelProductServiceImpl.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelProductServiceImpl.java
@@ -1,35 +1,97 @@
package me.chanjar.weixin.channel.api.impl;
-import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.ADD_LIMIT_TASK_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.CANCEL_AUDIT_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.DELETE_LIMIT_TASK_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.GIFT_ACTIVITY_ADD_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.GIFT_ACTIVITY_DELETE_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.GIFT_ACTIVITY_STOP_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.GIFT_PRODUCT_ADD_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.GIFT_PRODUCT_GET_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.GIFT_PRODUCT_LIST_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.GIFT_PRODUCT_ON_SALE_SET_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.GIFT_PRODUCT_STOCK_UPDATE_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.GIFT_PRODUCT_UPDATE_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.LIST_LIMIT_TASK_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.SPU_ADD_PRODUCT_THIRD_PARTY_SOURCE_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.SPU_ADD_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.SPU_AUDIT_FREE_UPDATE_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.SPU_AUDIT_STRATEGY_GET_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.SPU_AUDIT_STRATEGY_SET_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.SPU_BEGIN_TIMING_SALE_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.SPU_CANCEL_TIMING_SALE_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.SPU_CATEGORY_CLASSIFY_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.SPU_CATEGORY_PRE_CHECK_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.SPU_DELISTING_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.SPU_DEL_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.SPU_EXTERNAL_PRODUCT_MAPPING_NEW_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.SPU_EXTERNAL_PRODUCT_MAPPING_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.SPU_GET_AUDIT_QUOTA_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.SPU_GET_STOCK_BATCH_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.SPU_GET_STOCK_FLOW_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.SPU_GET_STOCK_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.SPU_GET_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.SPU_H5URL_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.SPU_LISTING_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.SPU_LIST_URL;
-import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.SPU_UPDATE_STOCK_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.SPU_PRODUCT_BRAND_RECOMMEND_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.SPU_QRCODE_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.SPU_SCHEME_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.SPU_TAGLINK_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.SPU_UPDATE_URL;
-import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.STOP_LIMIT_TASK_URL;
+import java.util.Collections;
+import java.util.List;
import lombok.extern.slf4j.Slf4j;
+import me.chanjar.weixin.channel.api.WxChannelGiftService;
+import me.chanjar.weixin.channel.api.WxChannelLimitedDiscountService;
import me.chanjar.weixin.channel.api.WxChannelProductService;
+import me.chanjar.weixin.channel.api.WxChannelProductStockService;
import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
import me.chanjar.weixin.channel.bean.limit.LimitTaskAddResponse;
-import me.chanjar.weixin.channel.bean.limit.LimitTaskListParam;
import me.chanjar.weixin.channel.bean.limit.LimitTaskListResponse;
import me.chanjar.weixin.channel.bean.limit.LimitTaskParam;
-import me.chanjar.weixin.channel.bean.product.SkuStockParam;
+import me.chanjar.weixin.channel.bean.product.AddProductThirdPartySourceParam;
+import me.chanjar.weixin.channel.bean.product.AddProductThirdPartySourceResponse;
+import me.chanjar.weixin.channel.bean.product.ExternalProductMappingNewParam;
+import me.chanjar.weixin.channel.bean.product.ExternalProductMappingNewResponse;
+import me.chanjar.weixin.channel.bean.product.ExternalProductMappingParam;
+import me.chanjar.weixin.channel.bean.product.ExternalProductMappingResponse;
+import me.chanjar.weixin.channel.bean.product.GiftActivityAddParam;
+import me.chanjar.weixin.channel.bean.product.GiftActivityAddResponse;
+import me.chanjar.weixin.channel.bean.product.GiftActivityInfo;
+import me.chanjar.weixin.channel.bean.product.GiftProductAddResponse;
+import me.chanjar.weixin.channel.bean.product.GiftProductGetResponse;
+import me.chanjar.weixin.channel.bean.product.GiftProductInfo;
+import me.chanjar.weixin.channel.bean.product.GiftProductListParam;
+import me.chanjar.weixin.channel.bean.product.GiftProductListResponse;
+import me.chanjar.weixin.channel.bean.product.ProductAuditQuotaResponse;
+import me.chanjar.weixin.channel.bean.product.ProductAuditStrategyResponse;
+import me.chanjar.weixin.channel.bean.product.ProductAuditStrategySetParam;
+import me.chanjar.weixin.channel.bean.product.ProductBrandRecommendParam;
+import me.chanjar.weixin.channel.bean.product.ProductBrandRecommendResponse;
+import me.chanjar.weixin.channel.bean.product.ProductCategoryClassifyParam;
+import me.chanjar.weixin.channel.bean.product.ProductCategoryClassifyResponse;
+import me.chanjar.weixin.channel.bean.product.ProductCategoryPreCheckParam;
+import me.chanjar.weixin.channel.bean.product.ProductCategoryPreCheckResponse;
+import me.chanjar.weixin.channel.bean.product.ProductSchemeParam;
+import me.chanjar.weixin.channel.bean.product.ProductSchemeResponse;
+import me.chanjar.weixin.channel.bean.product.ProductStockFlowParam;
+import me.chanjar.weixin.channel.bean.product.ProductStockFlowResponse;
+import me.chanjar.weixin.channel.bean.product.ProductTimingSaleParam;
+import me.chanjar.weixin.channel.bean.product.SkuStockBatchParam;
+import me.chanjar.weixin.channel.bean.product.SkuStockBatchResponse;
import me.chanjar.weixin.channel.bean.product.SkuStockResponse;
+import me.chanjar.weixin.channel.bean.product.SpuFastInfo;
import me.chanjar.weixin.channel.bean.product.SpuGetResponse;
import me.chanjar.weixin.channel.bean.product.SpuInfo;
import me.chanjar.weixin.channel.bean.product.SpuListParam;
import me.chanjar.weixin.channel.bean.product.SpuListResponse;
+import me.chanjar.weixin.channel.bean.product.SpuUpdateInfo;
import me.chanjar.weixin.channel.bean.product.SpuUpdateResponse;
+import me.chanjar.weixin.channel.bean.product.link.ProductH5UrlResponse;
+import me.chanjar.weixin.channel.bean.product.link.ProductQrCodeResponse;
+import me.chanjar.weixin.channel.bean.product.link.ProductTagLinkResponse;
import me.chanjar.weixin.channel.util.JsonUtils;
import me.chanjar.weixin.channel.util.ResponseUtils;
import me.chanjar.weixin.common.error.WxErrorException;
@@ -43,10 +105,37 @@
public class WxChannelProductServiceImpl implements WxChannelProductService {
/** 微信商店服务 */
- private final BaseWxChannelServiceImpl shopService;
+ private final BaseWxChannelServiceImpl, ?> shopService;
+ private final WxChannelGiftService giftService;
+ private final WxChannelLimitedDiscountService limitedDiscountService;
+ private final WxChannelProductStockService productStockService;
- public WxChannelProductServiceImpl(BaseWxChannelServiceImpl shopService) {
+ public WxChannelProductServiceImpl(BaseWxChannelServiceImpl, ?> shopService) {
+ this(shopService, new WxChannelGiftServiceImpl(shopService),
+ new WxChannelLimitedDiscountServiceImpl(shopService), new WxChannelProductStockServiceImpl(shopService));
+ }
+
+ WxChannelProductServiceImpl(BaseWxChannelServiceImpl, ?> shopService, WxChannelGiftService giftService,
+ WxChannelLimitedDiscountService limitedDiscountService,
+ WxChannelProductStockService productStockService) {
this.shopService = shopService;
+ this.giftService = giftService;
+ this.limitedDiscountService = limitedDiscountService;
+ this.productStockService = productStockService;
+ }
+
+ @Override
+ public SpuUpdateResponse addProduct(SpuUpdateInfo info) throws WxErrorException {
+ String reqJson = JsonUtils.encode(info);
+ String resJson = shopService.post(SPU_ADD_URL, reqJson);
+ return ResponseUtils.decode(resJson, SpuUpdateResponse.class);
+ }
+
+ @Override
+ public SpuUpdateResponse updateProduct(SpuUpdateInfo info) throws WxErrorException {
+ String reqJson = JsonUtils.encode(info);
+ String resJson = shopService.post(SPU_UPDATE_URL, reqJson);
+ return ResponseUtils.decode(resJson, SpuUpdateResponse.class);
}
@Override
@@ -63,13 +152,17 @@ public SpuUpdateResponse updateProduct(SpuInfo info) throws WxErrorException {
return ResponseUtils.decode(resJson, SpuUpdateResponse.class);
}
+ @Override
+ public WxChannelBaseResponse updateProductAuditFree(SpuFastInfo info) throws WxErrorException {
+ String reqJson = JsonUtils.encode(info);
+ String resJson = shopService.post(SPU_AUDIT_FREE_UPDATE_URL, reqJson);
+ return ResponseUtils.decode(resJson, SpuUpdateResponse.class);
+ }
+
@Override
public WxChannelBaseResponse updateStock(String productId, String skuId, Integer diffType, Integer num)
throws WxErrorException {
- SkuStockParam param = new SkuStockParam(productId, skuId, diffType, num);
- String reqJson = JsonUtils.encode(param);
- String resJson = shopService.post(SPU_UPDATE_STOCK_URL, reqJson);
- return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
+ return productStockService.updateStock(productId, skuId, diffType, num);
}
/**
@@ -143,38 +236,178 @@ public WxChannelBaseResponse downProduct(String productId) throws WxErrorExcepti
@Override
public SkuStockResponse getSkuStock(String productId, String skuId) throws WxErrorException {
- String reqJson = "{\"product_id\":\"" + productId + "\",\"sku_id\":\"" + skuId + "\"}";
- String resJson = shopService.post(SPU_GET_STOCK_URL, reqJson);
- return ResponseUtils.decode(resJson, SkuStockResponse.class);
+ return productStockService.getSkuStock(productId, skuId);
+ }
+
+ @Override
+ public SkuStockBatchResponse getSkuStockBatch(List productIds) throws WxErrorException {
+ return productStockService.getSkuStockBatch(productIds);
+ }
+
+ @Override
+ public ProductH5UrlResponse getProductH5Url(String productId) throws WxErrorException {
+ String reqJson = "{\"product_id\":\"" + productId + "\"}";
+ String resJson = shopService.post(SPU_H5URL_URL, reqJson);
+ return ResponseUtils.decode(resJson, ProductH5UrlResponse.class);
+ }
+
+ @Override
+ public ProductQrCodeResponse getProductQrCode(String productId) throws WxErrorException {
+ String reqJson = "{\"product_id\":\"" + productId + "\"}";
+ String resJson = shopService.post(SPU_QRCODE_URL, reqJson);
+ return ResponseUtils.decode(resJson, ProductQrCodeResponse.class);
+ }
+
+ @Override
+ public ProductTagLinkResponse getProductTagLink(String productId) throws WxErrorException {
+ String reqJson = "{\"product_id\":\"" + productId + "\"}";
+ String resJson = shopService.post(SPU_TAGLINK_URL, reqJson);
+ return ResponseUtils.decode(resJson, ProductTagLinkResponse.class);
+ }
+
+ @Override
+ public ProductSchemeResponse getProductScheme(ProductSchemeParam param) throws WxErrorException {
+ return postAndDecode(SPU_SCHEME_URL, param, ProductSchemeResponse.class);
+ }
+
+ @Override
+ public ProductCategoryClassifyResponse classifyProductCategory(ProductCategoryClassifyParam param)
+ throws WxErrorException {
+ return postAndDecode(SPU_CATEGORY_CLASSIFY_URL, param, ProductCategoryClassifyResponse.class);
+ }
+
+ @Override
+ public WxChannelBaseResponse beginTimingSale(ProductTimingSaleParam param) throws WxErrorException {
+ return postAndDecode(SPU_BEGIN_TIMING_SALE_URL, param, WxChannelBaseResponse.class);
+ }
+
+ @Override
+ public WxChannelBaseResponse cancelTimingSale(String productId) throws WxErrorException {
+ return postAndDecode(SPU_CANCEL_TIMING_SALE_URL, Collections.singletonMap("product_id", productId),
+ WxChannelBaseResponse.class);
+ }
+
+ @Override
+ public ExternalProductMappingResponse externalProductMapping(ExternalProductMappingParam param)
+ throws WxErrorException {
+ return postAndDecode(SPU_EXTERNAL_PRODUCT_MAPPING_URL, param, ExternalProductMappingResponse.class);
+ }
+
+ @Override
+ public ProductCategoryPreCheckResponse categoryPreCheck(ProductCategoryPreCheckParam param)
+ throws WxErrorException {
+ return postAndDecode(SPU_CATEGORY_PRE_CHECK_URL, param, ProductCategoryPreCheckResponse.class);
+ }
+
+ @Override
+ public ProductAuditStrategyResponse getProductAuditStrategy() throws WxErrorException {
+ return postAndDecode(SPU_AUDIT_STRATEGY_GET_URL, "{}", ProductAuditStrategyResponse.class);
+ }
+
+ @Override
+ public WxChannelBaseResponse setProductAuditStrategy(ProductAuditStrategySetParam param) throws WxErrorException {
+ return postAndDecode(SPU_AUDIT_STRATEGY_SET_URL, param, WxChannelBaseResponse.class);
+ }
+
+ @Override
+ public ProductAuditQuotaResponse getProductAuditQuota() throws WxErrorException {
+ return postAndDecode(SPU_GET_AUDIT_QUOTA_URL, "{}", ProductAuditQuotaResponse.class);
+ }
+
+ @Override
+ public ExternalProductMappingNewResponse externalProductMappingNew(ExternalProductMappingNewParam param)
+ throws WxErrorException {
+ return postAndDecode(SPU_EXTERNAL_PRODUCT_MAPPING_NEW_URL, param, ExternalProductMappingNewResponse.class);
+ }
+
+ @Override
+ public ProductBrandRecommendResponse productBrandRecommend(ProductBrandRecommendParam param)
+ throws WxErrorException {
+ return postAndDecode(SPU_PRODUCT_BRAND_RECOMMEND_URL, param, ProductBrandRecommendResponse.class);
+ }
+
+ @Override
+ public AddProductThirdPartySourceResponse addProductThirdPartySource(AddProductThirdPartySourceParam param)
+ throws WxErrorException {
+ return postAndDecode(SPU_ADD_PRODUCT_THIRD_PARTY_SOURCE_URL, param, AddProductThirdPartySourceResponse.class);
+ }
+
+ @Override
+ public ProductStockFlowResponse getStockFlow(ProductStockFlowParam param) throws WxErrorException {
+ return postAndDecode(SPU_GET_STOCK_FLOW_URL, param, ProductStockFlowResponse.class);
+ }
+
+ private T postAndDecode(String url, Object param, Class responseType)
+ throws WxErrorException {
+ String reqJson = param instanceof String ? (String) param : JsonUtils.encode(param);
+ String resJson = shopService.post(url, reqJson);
+ return ResponseUtils.decode(resJson, responseType);
+ }
+
+ @Override
+ public GiftProductAddResponse addGiftProduct(GiftProductInfo info) throws WxErrorException {
+ return giftService.addGiftProduct(info);
+ }
+
+ @Override
+ public WxChannelBaseResponse updateGiftProduct(GiftProductInfo info) throws WxErrorException {
+ return giftService.updateGiftProduct(info);
+ }
+
+ @Override
+ public WxChannelBaseResponse setProductAsGift(String productId) throws WxErrorException {
+ return giftService.setProductAsGift(productId);
+ }
+
+ @Override
+ public GiftProductGetResponse getGiftProduct(String productId) throws WxErrorException {
+ return giftService.getGiftProduct(productId);
+ }
+
+ @Override
+ public GiftProductListResponse listGiftProduct(GiftProductListParam param) throws WxErrorException {
+ return giftService.listGiftProduct(param);
+ }
+
+ @Override
+ public WxChannelBaseResponse updateGiftStock(String productId, String skuId, Integer diffType, Integer num)
+ throws WxErrorException {
+ return giftService.updateGiftStock(productId, skuId, diffType, num);
+ }
+
+ @Override
+ public GiftActivityAddResponse addGiftActivity(GiftActivityInfo info) throws WxErrorException {
+ return giftService.addGiftActivity(info);
+ }
+
+ @Override
+ public WxChannelBaseResponse deleteGiftActivity(String activityId) throws WxErrorException {
+ return giftService.deleteGiftActivity(activityId);
+ }
+
+ @Override
+ public WxChannelBaseResponse stopGiftActivity(String activityId) throws WxErrorException {
+ return giftService.stopGiftActivity(activityId);
}
@Override
public LimitTaskAddResponse addLimitTask(LimitTaskParam param) throws WxErrorException {
- String reqJson = JsonUtils.encode(param);
- String resJson = shopService.post(ADD_LIMIT_TASK_URL, reqJson);
- return ResponseUtils.decode(resJson, LimitTaskAddResponse.class);
+ return limitedDiscountService.addLimitTask(param);
}
@Override
public LimitTaskListResponse listLimitTask(Integer pageSize, String nextKey, Integer status)
throws WxErrorException {
- LimitTaskListParam param = new LimitTaskListParam(pageSize, nextKey, status);
- String reqJson = JsonUtils.encode(param);
- String resJson = shopService.post(LIST_LIMIT_TASK_URL, reqJson);
- return ResponseUtils.decode(resJson, LimitTaskListResponse.class);
+ return limitedDiscountService.listLimitTask(pageSize, nextKey, status);
}
@Override
public WxChannelBaseResponse stopLimitTask(String taskId) throws WxErrorException {
- String reqJson = "{\"task_id\": \"" + taskId + "\"}";
- String resJson = shopService.post(STOP_LIMIT_TASK_URL, reqJson);
- return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
+ return limitedDiscountService.stopLimitTask(taskId);
}
@Override
public WxChannelBaseResponse deleteLimitTask(String taskId) throws WxErrorException {
- String reqJson = "{\"task_id\": \"" + taskId + "\"}";
- String resJson = shopService.post(DELETE_LIMIT_TASK_URL, reqJson);
- return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
+ return limitedDiscountService.deleteLimitTask(taskId);
}
}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelProductStockServiceImpl.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelProductStockServiceImpl.java
new file mode 100644
index 0000000000..1b3b371420
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelProductStockServiceImpl.java
@@ -0,0 +1,62 @@
+package me.chanjar.weixin.channel.api.impl;
+
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.SPU_GET_STOCK_BATCH_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.SPU_GET_STOCK_FLOW_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.SPU_GET_STOCK_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.SPU_UPDATE_STOCK_URL;
+
+import java.util.List;
+import me.chanjar.weixin.channel.api.WxChannelProductStockService;
+import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
+import me.chanjar.weixin.channel.bean.product.SkuStockBatchParam;
+import me.chanjar.weixin.channel.bean.product.SkuStockBatchResponse;
+import me.chanjar.weixin.channel.bean.product.SkuStockParam;
+import me.chanjar.weixin.channel.bean.product.SkuStockResponse;
+import me.chanjar.weixin.channel.bean.product.stock.StockFlowParam;
+import me.chanjar.weixin.channel.bean.product.stock.StockFlowResponse;
+import me.chanjar.weixin.channel.util.JsonUtils;
+import me.chanjar.weixin.channel.util.ResponseUtils;
+import me.chanjar.weixin.common.error.WxErrorException;
+
+/**
+ * 微信小店商品库存服务实现。
+ */
+public class WxChannelProductStockServiceImpl implements WxChannelProductStockService {
+
+ private final BaseWxChannelServiceImpl, ?> shopService;
+
+ public WxChannelProductStockServiceImpl(BaseWxChannelServiceImpl, ?> shopService) {
+ this.shopService = shopService;
+ }
+
+ @Override
+ public WxChannelBaseResponse updateStock(String productId, String skuId, Integer diffType, Integer num)
+ throws WxErrorException {
+ SkuStockParam param = new SkuStockParam(productId, skuId, diffType, num);
+ String reqJson = JsonUtils.encode(param);
+ String resJson = shopService.post(SPU_UPDATE_STOCK_URL, reqJson);
+ return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
+ }
+
+ @Override
+ public SkuStockResponse getSkuStock(String productId, String skuId) throws WxErrorException {
+ String reqJson = "{\"product_id\":\"" + productId + "\",\"sku_id\":\"" + skuId + "\"}";
+ String resJson = shopService.post(SPU_GET_STOCK_URL, reqJson);
+ return ResponseUtils.decode(resJson, SkuStockResponse.class);
+ }
+
+ @Override
+ public SkuStockBatchResponse getSkuStockBatch(List productIds) throws WxErrorException {
+ SkuStockBatchParam param = new SkuStockBatchParam(productIds);
+ String reqJson = JsonUtils.encode(param);
+ String resJson = shopService.post(SPU_GET_STOCK_BATCH_URL, reqJson);
+ return ResponseUtils.decode(resJson, SkuStockBatchResponse.class);
+ }
+
+ @Override
+ public StockFlowResponse getStockFlow(StockFlowParam param) throws WxErrorException {
+ String reqJson = JsonUtils.encode(param);
+ String resJson = shopService.post(SPU_GET_STOCK_FLOW_URL, reqJson);
+ return ResponseUtils.decode(resJson, StockFlowResponse.class);
+ }
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelQicServiceImpl.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelQicServiceImpl.java
new file mode 100644
index 0000000000..a23532b6fd
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelQicServiceImpl.java
@@ -0,0 +1,75 @@
+package me.chanjar.weixin.channel.api.impl;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import me.chanjar.weixin.channel.api.WxChannelQicService;
+import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
+import me.chanjar.weixin.channel.bean.qic.InspectCodeResponse;
+import me.chanjar.weixin.channel.bean.qic.InspectConfigResponse;
+import me.chanjar.weixin.channel.bean.qic.RegisterLogisticsRequest;
+import me.chanjar.weixin.channel.bean.qic.SubmitConfigResponse;
+import me.chanjar.weixin.channel.bean.qic.SubmitInspectRequest;
+import me.chanjar.weixin.channel.util.ResponseUtils;
+import me.chanjar.weixin.common.error.WxErrorException;
+import org.apache.commons.lang3.StringUtils;
+
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Qic.GET_INSPECT_CONFIG_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Qic.GET_SUBMIT_CONFIG_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Qic.PRINT_INSPECT_CODE_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Qic.REGISTER_LOGISTICS_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Qic.SUBMIT_INSPECT_INFO_URL;
+
+/**
+ * 视频号小店 质检管理服务实现.
+ */
+public class WxChannelQicServiceImpl implements WxChannelQicService {
+ private final BaseWxChannelServiceImpl, ?> shopService;
+
+ public WxChannelQicServiceImpl(BaseWxChannelServiceImpl, ?> shopService) {
+ this.shopService = shopService;
+ }
+
+ @Override
+ public InspectConfigResponse getInspectConfig() throws WxErrorException {
+ String respJson = shopService.get(GET_INSPECT_CONFIG_URL, null);
+ return ResponseUtils.decode(respJson, InspectConfigResponse.class);
+ }
+
+ @Override
+ public SubmitConfigResponse getSubmitConfig(String orderId) throws WxErrorException {
+ String queryParam = StringUtils.isBlank(orderId) ? null : "order_id=" + orderId;
+ String respJson = shopService.get(GET_SUBMIT_CONFIG_URL, queryParam);
+ return ResponseUtils.decode(respJson, SubmitConfigResponse.class);
+ }
+
+ @Override
+ public SubmitConfigResponse getSubmitConfig() throws WxErrorException {
+ return getSubmitConfig(null);
+ }
+
+ @Override
+ public InspectCodeResponse printInspectCode(String orderId) throws WxErrorException {
+ String respJson = shopService.post(PRINT_INSPECT_CODE_URL, new PrintInspectCodeRequest(orderId));
+ return ResponseUtils.decode(respJson, InspectCodeResponse.class);
+ }
+
+ @Override
+ public WxChannelBaseResponse submitInspectInfo(SubmitInspectRequest request) throws WxErrorException {
+ String respJson = shopService.post(SUBMIT_INSPECT_INFO_URL, request);
+ return ResponseUtils.decode(respJson, WxChannelBaseResponse.class);
+ }
+
+ @Override
+ public WxChannelBaseResponse registerLogistics(RegisterLogisticsRequest request) throws WxErrorException {
+ String respJson = shopService.post(REGISTER_LOGISTICS_URL, request);
+ return ResponseUtils.decode(respJson, WxChannelBaseResponse.class);
+ }
+
+ @Data
+ @AllArgsConstructor
+ private static class PrintInspectCodeRequest {
+ @JsonProperty("order_id")
+ private String orderId;
+ }
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelServiceHttpClientImpl.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelServiceHttpClientImpl.java
index bbe8865269..6f380f80fb 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelServiceHttpClientImpl.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelServiceHttpClientImpl.java
@@ -1,22 +1,28 @@
package me.chanjar.weixin.channel.api.impl;
-import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.GET_ACCESS_TOKEN_URL;
-
-import java.io.IOException;
import lombok.extern.slf4j.Slf4j;
+import me.chanjar.weixin.channel.bean.token.StableTokenParam;
import me.chanjar.weixin.channel.config.WxChannelConfig;
-import me.chanjar.weixin.common.util.http.HttpType;
+import me.chanjar.weixin.channel.util.JsonUtils;
+import me.chanjar.weixin.common.util.http.HttpClientType;
+import me.chanjar.weixin.common.util.http.apache.ApacheBasicResponseHandler;
import me.chanjar.weixin.common.util.http.apache.ApacheHttpClientBuilder;
import me.chanjar.weixin.common.util.http.apache.DefaultApacheHttpClientBuilder;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.HttpHost;
import org.apache.http.client.HttpClient;
import org.apache.http.client.config.RequestConfig;
-import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
-import org.apache.http.impl.client.BasicResponseHandler;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.entity.ContentType;
+import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
+import java.io.IOException;
+
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.GET_ACCESS_TOKEN_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.GET_STABLE_ACCESS_TOKEN_URL;
+
/**
* @author Zeyes
*/
@@ -26,10 +32,6 @@ public class WxChannelServiceHttpClientImpl extends BaseWxChannelServiceImpl {
+
+ private CloseableHttpClient httpClient;
+ private HttpHost httpProxy;
+
+ @Override
+ public void initHttp() {
+ WxChannelConfig config = this.getConfig();
+ HttpComponentsClientBuilder apacheHttpClientBuilder = DefaultHttpComponentsClientBuilder.get();
+
+ apacheHttpClientBuilder.httpProxyHost(config.getHttpProxyHost())
+ .httpProxyPort(config.getHttpProxyPort())
+ .httpProxyUsername(config.getHttpProxyUsername())
+ .httpProxyPassword(config.getHttpProxyPassword() == null ? null : config.getHttpProxyPassword().toCharArray());
+
+ if (config.getHttpProxyHost() != null && config.getHttpProxyPort() > 0) {
+ this.httpProxy = new HttpHost(config.getHttpProxyHost(), config.getHttpProxyPort());
+ }
+
+ this.httpClient = apacheHttpClientBuilder.build();
+ }
+
+ @Override
+ public CloseableHttpClient getRequestHttpClient() {
+ return httpClient;
+ }
+
+ @Override
+ public HttpHost getRequestHttpProxy() {
+ return httpProxy;
+ }
+
+ @Override
+ public HttpClientType getRequestType() {
+ return HttpClientType.HTTP_COMPONENTS;
+ }
+
+ @Override
+ protected String doGetAccessTokenRequest() throws IOException {
+ WxChannelConfig config = this.getConfig();
+ String url = StringUtils.isNotEmpty(config.getAccessTokenUrl()) ? config.getAccessTokenUrl() :
+ StringUtils.isNotEmpty(config.getApiHostUrl()) ?
+ GET_ACCESS_TOKEN_URL.replace("https://api.weixin.qq.com", config.getApiHostUrl()) : GET_ACCESS_TOKEN_URL;
+
+ url = String.format(url, config.getAppid(), config.getSecret());
+
+ HttpGet httpGet = new HttpGet(url);
+ if (this.getRequestHttpProxy() != null) {
+ RequestConfig requestConfig = RequestConfig.custom().setProxy(this.getRequestHttpProxy()).build();
+ httpGet.setConfig(requestConfig);
+ }
+ return getRequestHttpClient().execute(httpGet, BasicResponseHandler.INSTANCE);
+ }
+
+ /**
+ * 获取稳定版接口调用凭据
+ *
+ * @param forceRefresh false 为普通模式, true为强制刷新模式
+ * @return 返回json的字符串
+ * @throws IOException the io exception
+ */
+ @Override
+ protected String doGetStableAccessTokenRequest(boolean forceRefresh) throws IOException {
+ WxChannelConfig config = this.getConfig();
+ String url = GET_STABLE_ACCESS_TOKEN_URL;
+
+ HttpPost httpPost = new HttpPost(url);
+ if (this.getRequestHttpProxy() != null) {
+ RequestConfig requestConfig = RequestConfig.custom().setProxy(this.getRequestHttpProxy()).build();
+ httpPost.setConfig(requestConfig);
+ }
+ StableTokenParam requestParam = new StableTokenParam();
+ requestParam.setAppId(config.getAppid());
+ requestParam.setSecret(config.getSecret());
+ requestParam.setGrantType("client_credential");
+ requestParam.setForceRefresh(forceRefresh);
+ String requestJson = JsonUtils.encode(requestParam);
+ assert requestJson != null;
+
+ httpPost.setEntity(new StringEntity(requestJson, ContentType.APPLICATION_JSON));
+ return getRequestHttpClient().execute(httpPost, BasicResponseHandler.INSTANCE);
+ }
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelServiceImpl.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelServiceImpl.java
index e3e749dca5..6f2c349f3f 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelServiceImpl.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelServiceImpl.java
@@ -10,4 +10,17 @@
@Slf4j
public class WxChannelServiceImpl extends WxChannelServiceHttpClientImpl {
+ public WxChannelServiceImpl() {
+ }
+
+// /**
+// * 设置获取access_token接口参数.
+// *
+// * @param stabled false 表示调用普通模式AccessToken接口, true调用稳定模式接口
+// * @param forceRefresh stabled=true使用, true表示强制刷新模式
+// * @deprecated 请使用 {@link BaseWxChannelServiceImpl#setConfig(WxChannelConfig) } 替代
+// */
+// @Deprecated
+// public WxChannelServiceImpl(Boolean stabled, Boolean forceRefresh) {
+// }
}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelServiceOkHttpImpl.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelServiceOkHttpImpl.java
new file mode 100644
index 0000000000..f7b0ccc65b
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelServiceOkHttpImpl.java
@@ -0,0 +1,109 @@
+package me.chanjar.weixin.channel.api.impl;
+
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.GET_ACCESS_TOKEN_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.GET_STABLE_ACCESS_TOKEN_URL;
+
+import java.io.IOException;
+import java.util.Objects;
+import lombok.extern.slf4j.Slf4j;
+import me.chanjar.weixin.channel.bean.token.StableTokenParam;
+import me.chanjar.weixin.channel.config.WxChannelConfig;
+import me.chanjar.weixin.channel.util.JsonUtils;
+import me.chanjar.weixin.common.util.http.HttpClientType;
+import me.chanjar.weixin.common.util.http.okhttp.DefaultOkHttpClientBuilder;
+import me.chanjar.weixin.common.util.http.okhttp.OkHttpProxyInfo;
+import okhttp3.Authenticator;
+import okhttp3.Credentials;
+import okhttp3.MediaType;
+import okhttp3.OkHttpClient;
+import okhttp3.Request;
+import okhttp3.RequestBody;
+import okhttp3.Response;
+import okhttp3.Route;
+import org.apache.commons.lang3.StringUtils;
+
+/**
+ * @author : zhenyun.su
+ * @since : 2024/2/27
+ */
+@Slf4j
+public class WxChannelServiceOkHttpImpl extends BaseWxChannelServiceImpl {
+ private OkHttpClient httpClient;
+ private OkHttpProxyInfo httpProxy;
+
+ public WxChannelServiceOkHttpImpl() {
+ }
+
+ @Override
+ public void initHttp() {
+ log.debug("WxChannelServiceOkHttpImpl initHttp");
+ if (this.config.getHttpProxyHost() != null && this.config.getHttpProxyPort() > 0) {
+ this.httpProxy = OkHttpProxyInfo.httpProxy(this.config.getHttpProxyHost(), this.config.getHttpProxyPort(), this.config.getHttpProxyUsername(), this.config.getHttpProxyPassword());
+ okhttp3.OkHttpClient.Builder clientBuilder = new okhttp3.OkHttpClient.Builder();
+ clientBuilder.proxy(this.getRequestHttpProxy().getProxy());
+ clientBuilder.proxyAuthenticator(new Authenticator() {
+ @Override
+ public Request authenticate(Route route, Response response) throws IOException {
+ String credential = Credentials.basic(WxChannelServiceOkHttpImpl.this.httpProxy.getProxyUsername(), WxChannelServiceOkHttpImpl.this.httpProxy.getProxyPassword());
+ return response.request().newBuilder().header("Proxy-Authorization", credential).build();
+ }
+ });
+ this.httpClient = clientBuilder.build();
+ } else {
+ this.httpClient = DefaultOkHttpClientBuilder.get().build();
+ }
+ }
+
+ @Override
+ public OkHttpClient getRequestHttpClient() {
+ return this.httpClient;
+ }
+
+ @Override
+ public OkHttpProxyInfo getRequestHttpProxy() {
+ return this.httpProxy;
+ }
+
+ @Override
+ public HttpClientType getRequestType() {
+ return HttpClientType.OK_HTTP;
+ }
+
+ @Override
+ protected String doGetAccessTokenRequest() throws IOException {
+ WxChannelConfig config = this.getConfig();
+ String url = StringUtils.isNotEmpty(config.getAccessTokenUrl()) ? config.getAccessTokenUrl() :
+ StringUtils.isNotEmpty(config.getApiHostUrl()) ?
+ GET_ACCESS_TOKEN_URL.replace("https://api.weixin.qq.com", config.getApiHostUrl()) : GET_ACCESS_TOKEN_URL;
+
+ url = String.format(url, config.getAppid(), config.getSecret());
+
+ Request request = new Request.Builder().url(url).get().build();
+ try (Response response = getRequestHttpClient().newCall(request).execute()) {
+ return Objects.requireNonNull(response.body()).string();
+ }
+ }
+
+ @Override
+ protected String doGetStableAccessTokenRequest(boolean forceRefresh) throws IOException {
+ WxChannelConfig config = this.getConfig();
+ String url = StringUtils.isNotEmpty(config.getAccessTokenUrl()) ?
+ config.getAccessTokenUrl() : StringUtils.isNotEmpty(config.getApiHostUrl()) ?
+ GET_STABLE_ACCESS_TOKEN_URL.replace("https://api.weixin.qq.com", config.getApiHostUrl()) :
+ GET_STABLE_ACCESS_TOKEN_URL;
+
+ StableTokenParam requestParam = new StableTokenParam();
+ requestParam.setAppId(config.getAppid());
+ requestParam.setSecret(config.getSecret());
+ requestParam.setGrantType("client_credential");
+ requestParam.setForceRefresh(forceRefresh);
+ String requestJson = JsonUtils.encode(requestParam);
+ assert requestJson != null;
+
+ RequestBody body = RequestBody.Companion.create(requestJson, MediaType.parse("application/json; charset=utf-8"));
+ Request request = new Request.Builder().url(url).post(body).build();
+ try (Response response = getRequestHttpClient().newCall(request).execute()) {
+ return Objects.requireNonNull(response.body()).string();
+ }
+ }
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelSharerServiceImpl.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelSharerServiceImpl.java
index 96438ae00f..3e27b124c7 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelSharerServiceImpl.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelSharerServiceImpl.java
@@ -7,6 +7,7 @@
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Share.SEARCH_SHARER_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Share.UNBIND_SHARER_URL;
+import com.google.gson.JsonObject;
import java.util.List;
import lombok.extern.slf4j.Slf4j;
import me.chanjar.weixin.channel.api.WxChannelSharerService;
@@ -21,6 +22,7 @@
import me.chanjar.weixin.channel.bean.sharer.SharerUnbindResponse;
import me.chanjar.weixin.channel.util.ResponseUtils;
import me.chanjar.weixin.common.error.WxErrorException;
+import me.chanjar.weixin.common.util.json.GsonHelper;
/**
* 视频号小店 分享员服务实现
@@ -31,16 +33,17 @@
public class WxChannelSharerServiceImpl implements WxChannelSharerService {
/** 微信商店服务 */
- private final BaseWxChannelServiceImpl shopService;
+ private final BaseWxChannelServiceImpl, ?> shopService;
- public WxChannelSharerServiceImpl(BaseWxChannelServiceImpl shopService) {
+ public WxChannelSharerServiceImpl(BaseWxChannelServiceImpl, ?> shopService) {
this.shopService = shopService;
}
@Override
public SharerBindResponse bindSharer(String username) throws WxErrorException {
- String reqJson = "{\"username\": " + username + "}";
- String resJson = shopService.post(BIND_SHARER_URL, reqJson);
+ JsonObject jsonObject = GsonHelper.buildJsonObject("username", username);
+
+ String resJson = shopService.post(BIND_SHARER_URL, jsonObject);
return ResponseUtils.decode(resJson, SharerBindResponse.class);
}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelSupplierServiceImpl.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelSupplierServiceImpl.java
new file mode 100644
index 0000000000..451aebc8a0
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelSupplierServiceImpl.java
@@ -0,0 +1,132 @@
+package me.chanjar.weixin.channel.api.impl;
+
+import com.google.gson.JsonObject;
+import lombok.extern.slf4j.Slf4j;
+import me.chanjar.weixin.channel.api.WxChannelSupplierService;
+import me.chanjar.weixin.channel.bean.base.StreamPageParam;
+import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
+import me.chanjar.weixin.channel.bean.supplier.DistributeTypeResponse;
+import me.chanjar.weixin.channel.bean.supplier.DropshipAssignRequest;
+import me.chanjar.weixin.channel.bean.supplier.DropshipDetailResponse;
+import me.chanjar.weixin.channel.bean.supplier.DropshipListRequest;
+import me.chanjar.weixin.channel.bean.supplier.DropshipListResponse;
+import me.chanjar.weixin.channel.bean.supplier.DropshipResponse;
+import me.chanjar.weixin.channel.bean.supplier.DropshipSearchRequest;
+import me.chanjar.weixin.channel.bean.supplier.ProductDistributeRequest;
+import me.chanjar.weixin.channel.bean.supplier.ProductListResponse;
+import me.chanjar.weixin.channel.bean.supplier.SupplierInfoResponse;
+import me.chanjar.weixin.channel.bean.supplier.SupplierListResponse;
+import me.chanjar.weixin.channel.util.ResponseUtils;
+import me.chanjar.weixin.common.error.WxErrorException;
+import me.chanjar.weixin.common.util.json.GsonHelper;
+
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Supplier.ASSIGN_DROPSHIP_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Supplier.CANCEL_DROPSHIP_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Supplier.GET_DISTRIBUTE_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Supplier.GET_DROPSHIP_LIST_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Supplier.GET_DROPSHIP_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Supplier.GET_PRODUCT_DEFAULT_DISTRIBUTE_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Supplier.GET_PRODUCT_LIST_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Supplier.GET_SUPPLIER_LIST_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Supplier.SEARCH_DROPSHIP_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Supplier.SET_ALL_DISTRIBUTION_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Supplier.SET_MANUALLY_DISTRIBUTE_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Supplier.SET_PRODUCT_DISTRIBUTE_URL;
+
+/**
+ * 视频号小店代发管理服务。
+ *
+ * @author GitHub Copilot
+ */
+@Slf4j
+public class WxChannelSupplierServiceImpl implements WxChannelSupplierService {
+
+ private final BaseWxChannelServiceImpl, ?> shopService;
+
+ public WxChannelSupplierServiceImpl(BaseWxChannelServiceImpl, ?> shopService) {
+ this.shopService = shopService;
+ }
+
+ @Override
+ public SupplierListResponse getSupplierList() throws WxErrorException {
+ return getSupplierList(null, null);
+ }
+
+ @Override
+ public SupplierListResponse getSupplierList(Integer pageSize, String nextKey) throws WxErrorException {
+ StreamPageParam param = new StreamPageParam(pageSize, nextKey);
+ String respJson = shopService.post(GET_SUPPLIER_LIST_URL, param);
+ return ResponseUtils.decode(respJson, SupplierListResponse.class);
+ }
+
+ @Override
+ public DistributeTypeResponse getDistribute() throws WxErrorException {
+ String respJson = shopService.post(GET_DISTRIBUTE_URL, "{}");
+ return ResponseUtils.decode(respJson, DistributeTypeResponse.class);
+ }
+
+ @Override
+ public WxChannelBaseResponse setManuallyDistribute() throws WxErrorException {
+ String respJson = shopService.post(SET_MANUALLY_DISTRIBUTE_URL, "{}");
+ return ResponseUtils.decode(respJson, WxChannelBaseResponse.class);
+ }
+
+ @Override
+ public WxChannelBaseResponse setAllDistribute(String supplierId) throws WxErrorException {
+ JsonObject req = GsonHelper.buildJsonObject("supplier_id", supplierId);
+ String respJson = shopService.post(SET_ALL_DISTRIBUTION_URL, req);
+ return ResponseUtils.decode(respJson, WxChannelBaseResponse.class);
+ }
+
+ @Override
+ public WxChannelBaseResponse setProductDistribute(ProductDistributeRequest req) throws WxErrorException {
+ String respJson = shopService.post(SET_PRODUCT_DISTRIBUTE_URL, req);
+ return ResponseUtils.decode(respJson, WxChannelBaseResponse.class);
+ }
+
+ @Override
+ public SupplierInfoResponse getProductDefaultDistribute(String productId) throws WxErrorException {
+ JsonObject req = GsonHelper.buildJsonObject("product_id", productId);
+ String respJson = shopService.post(GET_PRODUCT_DEFAULT_DISTRIBUTE_URL, req);
+ return ResponseUtils.decode(respJson, SupplierInfoResponse.class);
+ }
+
+ @Override
+ public ProductListResponse getProductList(String supplierId) throws WxErrorException {
+ JsonObject req = GsonHelper.buildJsonObject("supplier_id", supplierId);
+ String respJson = shopService.post(GET_PRODUCT_LIST_URL, req);
+ return ResponseUtils.decode(respJson, ProductListResponse.class);
+ }
+
+ @Override
+ public DropshipResponse assignOrder(DropshipAssignRequest req) throws WxErrorException {
+ String respJson = shopService.post(ASSIGN_DROPSHIP_URL, req);
+ return ResponseUtils.decode(respJson, DropshipResponse.class);
+ }
+
+ @Override
+ public WxChannelBaseResponse cancelDropship(String orderId) throws WxErrorException {
+ JsonObject req = GsonHelper.buildJsonObject("order_id", orderId);
+ String respJson = shopService.post(CANCEL_DROPSHIP_URL, req);
+ return ResponseUtils.decode(respJson, WxChannelBaseResponse.class);
+ }
+
+ @Override
+ public DropshipDetailResponse getDropship(String orderId) throws WxErrorException {
+ JsonObject req = GsonHelper.buildJsonObject("order_id", orderId);
+ String respJson = shopService.post(GET_DROPSHIP_URL, req);
+ return ResponseUtils.decode(respJson, DropshipDetailResponse.class);
+ }
+
+ @Override
+ public DropshipListResponse listDropship(DropshipListRequest req) throws WxErrorException {
+ String respJson = shopService.post(GET_DROPSHIP_LIST_URL, req);
+ return ResponseUtils.decode(respJson, DropshipListResponse.class);
+ }
+
+ @Override
+ public DropshipListResponse searchDropship(DropshipSearchRequest req) throws WxErrorException {
+ String respJson = shopService.post(SEARCH_DROPSHIP_URL, req);
+ return ResponseUtils.decode(respJson, DropshipListResponse.class);
+ }
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelVipServiceImpl.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelVipServiceImpl.java
new file mode 100644
index 0000000000..4644989d60
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelVipServiceImpl.java
@@ -0,0 +1,68 @@
+package me.chanjar.weixin.channel.api.impl;
+
+import lombok.extern.slf4j.Slf4j;
+import me.chanjar.weixin.channel.api.WxChannelVipService;
+import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
+import me.chanjar.weixin.channel.bean.vip.*;
+import me.chanjar.weixin.channel.util.ResponseUtils;
+import me.chanjar.weixin.common.error.WxErrorException;
+
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Vip.*;
+
+/**
+ * 视频号小店 会员功能接口
+ *
+ * @author aushiye
+ * @link 会员功能接口文档
+ */
+
+@Slf4j
+public class WxChannelVipServiceImpl implements WxChannelVipService {
+ private final BaseWxChannelServiceImpl, ?> shopService;
+
+ public WxChannelVipServiceImpl(BaseWxChannelServiceImpl, ?> shopService) {
+ this.shopService = shopService;
+ }
+
+ @Override
+ public VipInfoResponse getVipInfo(String openId, Boolean needPhoneNumber) throws WxErrorException {
+ VipInfoParam param = new VipInfoParam(openId, needPhoneNumber);
+ String respJson = shopService.post(VIP_USER_INFO_URL, param);
+ return ResponseUtils.decode(respJson, VipInfoResponse.class);
+ }
+
+ @Override
+ public VipListResponse getVipList(Boolean needPhoneNumber, Integer pageNum, Integer pageSize) throws WxErrorException {
+ VipListParam param = new VipListParam(needPhoneNumber, pageNum, pageSize);
+ String respJson = shopService.post(VIP_USER_LIST_URL, param);
+ return ResponseUtils.decode(respJson, VipListResponse.class);
+ }
+
+ @Override
+ public VipScoreResponse getVipScore(String openId) throws WxErrorException {
+ VipOpenIdParam param = new VipOpenIdParam(openId);
+ String respJson = shopService.post(VIP_SCORE_URL, param);
+ return ResponseUtils.decode(respJson, VipScoreResponse.class);
+ }
+
+ @Override
+ public WxChannelBaseResponse increaseVipScore(String openId, String score, String remark, String requestId) throws WxErrorException {
+ VipScoreParam param = new VipScoreParam(openId, score, remark, requestId);
+ String respJson = shopService.post(SCORE_INCREASE_URL, param);
+ return ResponseUtils.decode(respJson, WxChannelBaseResponse.class);
+ }
+
+ @Override
+ public WxChannelBaseResponse decreaseVipScore(String openId, String score, String remark, String requestId) throws WxErrorException {
+ VipScoreParam param = new VipScoreParam(openId, score, remark, requestId);
+ String respJson = shopService.post(SCORE_DECREASE_URL, param);
+ return ResponseUtils.decode(respJson, WxChannelBaseResponse.class);
+ }
+
+ @Override
+ public WxChannelBaseResponse updateVipGrade(String openId, Integer score) throws WxErrorException {
+ VipGradeParam param = new VipGradeParam(openId, score);
+ String respJson = shopService.post(GRADE_UPDATE_URL, param);
+ return ResponseUtils.decode(respJson, WxChannelBaseResponse.class);
+ }
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelWarehouseServiceImpl.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelWarehouseServiceImpl.java
index b9609e5c6b..6805f26a4f 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelWarehouseServiceImpl.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelWarehouseServiceImpl.java
@@ -40,9 +40,9 @@
public class WxChannelWarehouseServiceImpl implements WxChannelWarehouseService {
/** 微信商店服务 */
- private final BaseWxChannelServiceImpl shopService;
+ private final BaseWxChannelServiceImpl, ?> shopService;
- public WxChannelWarehouseServiceImpl(BaseWxChannelServiceImpl shopService) {
+ public WxChannelWarehouseServiceImpl(BaseWxChannelServiceImpl, ?> shopService) {
this.shopService = shopService;
}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxFinderLiveServiceImpl.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxFinderLiveServiceImpl.java
new file mode 100644
index 0000000000..51623609cf
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxFinderLiveServiceImpl.java
@@ -0,0 +1,47 @@
+package me.chanjar.weixin.channel.api.impl;
+
+
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import me.chanjar.weixin.channel.api.WxFinderLiveService;
+import me.chanjar.weixin.channel.bean.lead.component.request.GetFinderLiveDataListRequest;
+import me.chanjar.weixin.channel.bean.lead.component.request.GetFinderLiveLeadsDataRequest;
+import me.chanjar.weixin.channel.bean.lead.component.response.FinderAttrResponse;
+import me.chanjar.weixin.channel.bean.lead.component.response.GetFinderLiveDataListResponse;
+import me.chanjar.weixin.channel.bean.lead.component.response.GetFinderLiveLeadsDataResponse;
+import me.chanjar.weixin.channel.util.ResponseUtils;
+import me.chanjar.weixin.common.error.WxErrorException;
+
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.FinderLive.GET_FINDER_ATTR_BY_APPID;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.FinderLive.GET_FINDER_LIVE_DATA_LIST;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.FinderLive.GET_FINDER_LIVE_LEADS_DATA;
+
+/**
+ * 视频号助手 留资服务的直播数据服务
+ * @author imyzt
+ * @date 2024/01/27
+ */
+@RequiredArgsConstructor
+@Slf4j
+public class WxFinderLiveServiceImpl implements WxFinderLiveService {
+
+ /** 微信商店服务 */
+ private final BaseWxChannelServiceImpl, ?> shopService;
+ @Override
+ public FinderAttrResponse getFinderAttrByAppid() throws WxErrorException {
+ String resJson = shopService.post(GET_FINDER_ATTR_BY_APPID, "{}");
+ return ResponseUtils.decode(resJson, FinderAttrResponse.class);
+ }
+
+ @Override
+ public GetFinderLiveDataListResponse getFinderLiveDataList(GetFinderLiveDataListRequest req) throws WxErrorException {
+ String resJson = shopService.post(GET_FINDER_LIVE_DATA_LIST, req);
+ return ResponseUtils.decode(resJson, GetFinderLiveDataListResponse.class);
+ }
+
+ @Override
+ public GetFinderLiveLeadsDataResponse getFinderLiveLeadsData(GetFinderLiveLeadsDataRequest req) throws WxErrorException {
+ String resJson = shopService.post(GET_FINDER_LIVE_LEADS_DATA, req);
+ return ResponseUtils.decode(resJson, GetFinderLiveLeadsDataResponse.class);
+ }
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxLeadComponentServiceImpl.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxLeadComponentServiceImpl.java
new file mode 100644
index 0000000000..eb1bcee28c
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxLeadComponentServiceImpl.java
@@ -0,0 +1,96 @@
+package me.chanjar.weixin.channel.api.impl;
+
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ArrayNode;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import me.chanjar.weixin.channel.api.WxLeadComponentService;
+import me.chanjar.weixin.channel.bean.lead.component.request.GetLeadInfoByComponentRequest;
+import me.chanjar.weixin.channel.bean.lead.component.request.GetLeadsComponentIdRequest;
+import me.chanjar.weixin.channel.bean.lead.component.request.GetLeadsComponentPromoteRecordRequest;
+import me.chanjar.weixin.channel.bean.lead.component.request.GetLeadsInfoByRequestIdRequest;
+import me.chanjar.weixin.channel.bean.lead.component.request.GetLeadsRequestIdRequest;
+import me.chanjar.weixin.channel.bean.lead.component.response.GetLeadsComponentIdResponse;
+import me.chanjar.weixin.channel.bean.lead.component.response.GetLeadsComponentPromoteRecordResponse;
+import me.chanjar.weixin.channel.bean.lead.component.response.GetLeadsRequestIdResponse;
+import me.chanjar.weixin.channel.bean.lead.component.response.LeadInfoResponse;
+import me.chanjar.weixin.channel.util.ResponseUtils;
+import me.chanjar.weixin.common.error.WxErrorException;
+import org.apache.commons.lang3.ObjectUtils;
+
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.LeadComponent.GET_LEADS_COMPONENT_ID;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.LeadComponent.GET_LEADS_COMPONENT_PROMOTE_RECORD;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.LeadComponent.GET_LEADS_INFO_BY_COMPONENT_ID;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.LeadComponent.GET_LEADS_INFO_BY_REQUEST_ID;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.LeadComponent.GET_LEADS_REQUEST_ID;
+
+/**
+ * 视频号助手 留资组件管理服务
+ * @author imyzt
+ * @date 2024/01/27
+ */
+@RequiredArgsConstructor
+@Slf4j
+public class WxLeadComponentServiceImpl implements WxLeadComponentService {
+
+ /** 微信商店服务 */
+ private final BaseWxChannelServiceImpl, ?> shopService;
+ private final ObjectMapper objectMapper = new ObjectMapper();
+ @Override
+ public LeadInfoResponse getLeadsInfoByComponentId(GetLeadInfoByComponentRequest req) throws WxErrorException {
+ req.setVersion(ObjectUtils.defaultIfNull(req.getVersion(), 1));
+ String resJson = shopService.post(GET_LEADS_INFO_BY_COMPONENT_ID, req);
+ return this.convertLeadInfoResponse(resJson);
+ }
+
+ @Override
+ public LeadInfoResponse getLeadsInfoByRequestId(GetLeadsInfoByRequestIdRequest req) throws WxErrorException {
+ req.setVersion(ObjectUtils.defaultIfNull(req.getVersion(), 1));
+ String resJson = shopService.post(GET_LEADS_INFO_BY_REQUEST_ID, req);
+ return this.convertLeadInfoResponse(resJson);
+ }
+
+ @Override
+ public GetLeadsRequestIdResponse getLeadsRequestId(GetLeadsRequestIdRequest req) throws WxErrorException {
+ String resJson = shopService.post(GET_LEADS_REQUEST_ID, req);
+ return ResponseUtils.decode(resJson, GetLeadsRequestIdResponse.class);
+ }
+
+ @Override
+ public GetLeadsComponentPromoteRecordResponse getLeadsComponentPromoteRecord(GetLeadsComponentPromoteRecordRequest req) throws WxErrorException {
+ String resJson = shopService.post(GET_LEADS_COMPONENT_PROMOTE_RECORD, req);
+ return ResponseUtils.decode(resJson, GetLeadsComponentPromoteRecordResponse.class);
+ }
+
+ @Override
+ public GetLeadsComponentIdResponse getLeadsComponentId(GetLeadsComponentIdRequest req) throws WxErrorException {
+ String resJson = shopService.post(GET_LEADS_COMPONENT_ID, req);
+ return ResponseUtils.decode(resJson, GetLeadsComponentIdResponse.class);
+ }
+
+ /**
+ * 微信返回的数据中, user_data和leads_data均为字符串包裹的非标准JSON结构, 为方便业务使用避免踩坑此处做好解析
+ */
+ private LeadInfoResponse convertLeadInfoResponse(String resJson) throws WxErrorException {
+ try {
+ ObjectNode rootNode = (ObjectNode) objectMapper.readTree(resJson);
+ ArrayNode convertedUserDataArray = objectMapper.createArrayNode();
+ for (JsonNode userDataEle : rootNode.get("user_data")) {
+ ObjectNode userDataJsonNode = (ObjectNode) objectMapper.readTree(userDataEle.asText());
+ ArrayNode leadsDataArray = (ArrayNode) objectMapper.readTree(userDataJsonNode.get("leads_data").asText());
+ userDataJsonNode.set("leads_data", leadsDataArray);
+ convertedUserDataArray.add(userDataJsonNode);
+ }
+ rootNode.set("user_data", convertedUserDataArray);
+ String json = objectMapper.writeValueAsString(rootNode);
+ return ResponseUtils.decode(json, LeadInfoResponse.class);
+ } catch (JsonProcessingException e) {
+ throw new WxErrorException(e);
+ }
+ }
+
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxLeagueProductServiceImpl.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxLeagueProductServiceImpl.java
index 29620874e2..fc8d2fbadc 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxLeagueProductServiceImpl.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxLeagueProductServiceImpl.java
@@ -32,9 +32,9 @@
public class WxLeagueProductServiceImpl implements WxLeagueProductService {
/** 微信商店服务 */
- private final BaseWxChannelServiceImpl shopService;
+ private final BaseWxChannelServiceImpl, ?> shopService;
- public WxLeagueProductServiceImpl(BaseWxChannelServiceImpl shopService) {
+ public WxLeagueProductServiceImpl(BaseWxChannelServiceImpl, ?>shopService) {
this.shopService = shopService;
}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxLeaguePromoterServiceImpl.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxLeaguePromoterServiceImpl.java
index a6bfddfbef..c81df29533 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxLeaguePromoterServiceImpl.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxLeaguePromoterServiceImpl.java
@@ -24,9 +24,9 @@
public class WxLeaguePromoterServiceImpl implements WxLeaguePromoterService {
/** 微信商店服务 */
- private final BaseWxChannelServiceImpl shopService;
+ private final BaseWxChannelServiceImpl, ?> shopService;
- public WxLeaguePromoterServiceImpl(BaseWxChannelServiceImpl shopService) {
+ public WxLeaguePromoterServiceImpl(BaseWxChannelServiceImpl, ?> shopService) {
this.shopService = shopService;
}
@@ -58,6 +58,34 @@ public PromoterInfoResponse getPromoterInfo(String finderId) throws WxErrorExcep
return ResponseUtils.decode(resJson, PromoterInfoResponse.class);
}
+ @Override
+ public WxChannelBaseResponse addPromoterV2(String promoterId) throws WxErrorException {
+ String reqJson = "{\"promoter_id\":\"" + promoterId + "\"}";
+ String resJson = shopService.post(ADD_PROMOTER_URL, reqJson);
+ return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
+ }
+
+ @Override
+ public WxChannelBaseResponse updatePromoterV2(String promoterId, int type) throws WxErrorException {
+ String reqJson = "{\"promoter_id\":\"" + promoterId + "\",\"type\":" + type + "}";
+ String resJson = shopService.post(EDIT_PROMOTER_URL, reqJson);
+ return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
+ }
+
+ @Override
+ public WxChannelBaseResponse deletePromoterV2(String promoterId) throws WxErrorException {
+ String reqJson = "{\"promoter_id\":\"" + promoterId + "\"}";
+ String resJson = shopService.post(DELETE_PROMOTER_URL, reqJson);
+ return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
+ }
+
+ @Override
+ public PromoterInfoResponse getPromoterInfoV2(String promoterId) throws WxErrorException {
+ String reqJson = "{\"promoter_id\":\"" + promoterId + "\"}";
+ String resJson = shopService.post(GET_PROMOTER_URL, reqJson);
+ return ResponseUtils.decode(resJson, PromoterInfoResponse.class);
+ }
+
@Override
public PromoterListResponse listPromoter(Integer pageIndex, Integer pageSize, Integer status)
throws WxErrorException {
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxLeagueSupplierServiceImpl.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxLeagueSupplierServiceImpl.java
index d69296bd0f..2b280a2f6d 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxLeagueSupplierServiceImpl.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxLeagueSupplierServiceImpl.java
@@ -38,9 +38,9 @@
public class WxLeagueSupplierServiceImpl implements WxLeagueSupplierService {
/** 微信商店服务 */
- private final BaseWxChannelServiceImpl shopService;
+ private final BaseWxChannelServiceImpl, ?> shopService;
- public WxLeagueSupplierServiceImpl(BaseWxChannelServiceImpl shopService) {
+ public WxLeagueSupplierServiceImpl(BaseWxChannelServiceImpl, ?> shopService) {
this.shopService = shopService;
}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxLeagueWindowServiceImpl.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxLeagueWindowServiceImpl.java
index a59fc6efa5..a0c21ab4ef 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxLeagueWindowServiceImpl.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxLeagueWindowServiceImpl.java
@@ -29,9 +29,9 @@
public class WxLeagueWindowServiceImpl implements WxLeagueWindowService {
/** 微信商店服务 */
- private final BaseWxChannelServiceImpl shopService;
+ private final BaseWxChannelServiceImpl, ?> shopService;
- public WxLeagueWindowServiceImpl(BaseWxChannelServiceImpl shopService) {
+ public WxLeagueWindowServiceImpl(BaseWxChannelServiceImpl, ?> shopService) {
this.shopService = shopService;
}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxStoreCooperationServiceImpl.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxStoreCooperationServiceImpl.java
new file mode 100644
index 0000000000..56dc78e09e
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxStoreCooperationServiceImpl.java
@@ -0,0 +1,68 @@
+package me.chanjar.weixin.channel.api.impl;
+
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Cooperation.CANCEL_COOPERATION_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Cooperation.GENERATE_QRCODE_COOPERATION_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Cooperation.GET_COOPERATION_STATUS_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Cooperation.LIST_COOPERATION_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Cooperation.UNBIND_COOPERATION_URL;
+
+import lombok.extern.slf4j.Slf4j;
+import me.chanjar.weixin.channel.api.WxStoreCooperationService;
+import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
+import me.chanjar.weixin.channel.bean.cooperation.CooperationListResponse;
+import me.chanjar.weixin.channel.bean.cooperation.CooperationQrCodeResponse;
+import me.chanjar.weixin.channel.bean.cooperation.CooperationSharerParam;
+import me.chanjar.weixin.channel.bean.cooperation.CooperationStatusResponse;
+import me.chanjar.weixin.channel.util.ResponseUtils;
+import me.chanjar.weixin.common.error.WxErrorException;
+
+/**
+ * 微信小店 合作账号相关接口
+ *
+ * @author Zeyes
+ */
+@Slf4j
+public class WxStoreCooperationServiceImpl implements WxStoreCooperationService {
+
+ /** 微信小店服务 */
+ private final BaseWxChannelServiceImpl, ?> storeService;
+
+ public WxStoreCooperationServiceImpl(BaseWxChannelServiceImpl, ?> storeService) {
+ this.storeService = storeService;
+ }
+
+ @Override
+ public CooperationListResponse listCooperation(Integer sharerType) throws WxErrorException {
+ String paramJson = "{\"sharer_type\":" + sharerType + "}";
+ String resJson = storeService.post(LIST_COOPERATION_URL, paramJson);
+ return ResponseUtils.decode(resJson, CooperationListResponse.class);
+ }
+
+ @Override
+ public CooperationStatusResponse getCooperationStatus(String sharerId, Integer sharerType) throws WxErrorException {
+ CooperationSharerParam param = new CooperationSharerParam(sharerId, sharerType);
+ String resJson = storeService.post(GET_COOPERATION_STATUS_URL, param);
+ return ResponseUtils.decode(resJson, CooperationStatusResponse.class);
+ }
+
+ @Override
+ public CooperationQrCodeResponse generateQrCode(String sharerId, Integer sharerType) throws WxErrorException {
+ CooperationSharerParam param = new CooperationSharerParam(sharerId, sharerType);
+ String resJson = storeService.post(GENERATE_QRCODE_COOPERATION_URL, param);
+ return ResponseUtils.decode(resJson, CooperationQrCodeResponse.class);
+ }
+
+ @Override
+ public WxChannelBaseResponse cancelInvitation(String sharerId, Integer sharerType) throws WxErrorException {
+ CooperationSharerParam param = new CooperationSharerParam(sharerId, sharerType);
+ String resJson = storeService.post(CANCEL_COOPERATION_URL, param);
+ return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
+ }
+
+ @Override
+ public WxChannelBaseResponse unbind(String sharerId, Integer sharerType) throws WxErrorException {
+ CooperationSharerParam param = new CooperationSharerParam(sharerId, sharerType);
+ String resJson = storeService.post(UNBIND_COOPERATION_URL, param);
+ return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
+ }
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxStoreHomePageServiceImpl.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxStoreHomePageServiceImpl.java
new file mode 100644
index 0000000000..e3e9f06deb
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxStoreHomePageServiceImpl.java
@@ -0,0 +1,164 @@
+package me.chanjar.weixin.channel.api.impl;
+
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.HomePage.*;
+
+
+import lombok.extern.slf4j.Slf4j;
+import me.chanjar.weixin.channel.api.WxStoreHomePageService;
+import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
+import me.chanjar.weixin.channel.bean.home.background.BackgroundApplyResponse;
+import me.chanjar.weixin.channel.bean.home.background.BackgroundGetResponse;
+import me.chanjar.weixin.channel.bean.home.banner.BannerApplyParam;
+import me.chanjar.weixin.channel.bean.home.banner.BannerApplyResponse;
+import me.chanjar.weixin.channel.bean.home.banner.BannerGetResponse;
+import me.chanjar.weixin.channel.bean.home.banner.BannerInfo;
+import me.chanjar.weixin.channel.bean.home.tree.TreeProductEditInfo;
+import me.chanjar.weixin.channel.bean.home.tree.TreeProductEditParam;
+import me.chanjar.weixin.channel.bean.home.tree.TreeProductListInfo;
+import me.chanjar.weixin.channel.bean.home.tree.TreeProductListParam;
+import me.chanjar.weixin.channel.bean.home.tree.TreeProductListResponse;
+import me.chanjar.weixin.channel.bean.home.tree.TreeShowGetResponse;
+import me.chanjar.weixin.channel.bean.home.tree.TreeShowInfo;
+import me.chanjar.weixin.channel.bean.home.tree.TreeShowParam;
+import me.chanjar.weixin.channel.bean.home.tree.TreeShowSetResponse;
+import me.chanjar.weixin.channel.bean.home.window.WindowProductIndexParam;
+import me.chanjar.weixin.channel.bean.home.window.WindowProductListParam;
+import me.chanjar.weixin.channel.bean.home.window.WindowProductSetting;
+import me.chanjar.weixin.channel.bean.home.window.WindowProductSettingResponse;
+import me.chanjar.weixin.channel.util.ResponseUtils;
+import me.chanjar.weixin.common.error.WxErrorException;
+
+/**
+ * 微信小店 主页管理相关接口
+ *
+ * @author Zeyes
+ */
+@Slf4j
+public class WxStoreHomePageServiceImpl implements WxStoreHomePageService {
+
+ /** 微信小店服务 */
+ private final BaseWxChannelServiceImpl, ?> storeService;
+
+ public WxStoreHomePageServiceImpl(BaseWxChannelServiceImpl, ?> storeService) {
+ this.storeService = storeService;
+ }
+
+
+ @Override
+ public WxChannelBaseResponse addTreeProduct(TreeProductEditInfo info) throws WxErrorException {
+ TreeProductEditParam param = new TreeProductEditParam(info);
+ String resJson = storeService.post(ADD_TREE_PRODUCT_URL, param);
+ return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
+ }
+
+ @Override
+ public WxChannelBaseResponse delTreeProduct(TreeProductEditInfo info) throws WxErrorException {
+ TreeProductEditParam param = new TreeProductEditParam(info);
+ String resJson = storeService.post(DEL_TREE_PRODUCT_URL, param);
+ return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
+ }
+
+ @Override
+ public TreeProductListResponse getTreeProductList(TreeProductListInfo info) throws WxErrorException {
+ TreeProductListParam param = new TreeProductListParam(info);
+ String resJson = storeService.post(LIST_TREE_PRODUCT_URL, param);
+ return ResponseUtils.decode(resJson, TreeProductListResponse.class);
+ }
+
+ @Override
+ public TreeShowSetResponse setShowTree(TreeShowInfo info) throws WxErrorException {
+ TreeShowParam param = new TreeShowParam(info);
+ String resJson = storeService.post(SET_SHOW_TREE_URL, param);
+ return ResponseUtils.decode(resJson, TreeShowSetResponse.class);
+ }
+
+ @Override
+ public TreeShowGetResponse getShowTree() throws WxErrorException {
+ String resJson = storeService.post(GET_SHOW_TREE_URL, "");
+ return ResponseUtils.decode(resJson, TreeShowGetResponse.class);
+ }
+
+ @Override
+ public WindowProductSettingResponse listWindowProduct(Integer pageSize, String nextKey) throws WxErrorException {
+ WindowProductListParam param = new WindowProductListParam(pageSize, nextKey);
+ String resJson = storeService.post(LIST_WINDOW_PRODUCT_URL, param);
+ return ResponseUtils.decode(resJson, WindowProductSettingResponse.class);
+ }
+
+ @Override
+ public WxChannelBaseResponse reorderWindowProduct(String productId, Integer indexNum) throws WxErrorException {
+ WindowProductIndexParam param = new WindowProductIndexParam(productId, indexNum);
+ String resJson = storeService.post(REORDER_WINDOW_PRODUCT_URL, param);
+ return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
+ }
+
+ @Override
+ public WxChannelBaseResponse hideWindowProduct(String productId, Integer setHide) throws WxErrorException {
+ WindowProductSetting param = new WindowProductSetting();
+ param.setProductId(productId);
+ param.setSetHide(setHide);
+ String resJson = storeService.post(HIDE_WINDOW_PRODUCT_URL, param);
+ return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
+ }
+
+ @Override
+ public WxChannelBaseResponse topWindowProduct(String productId, Integer setTop) throws WxErrorException {
+ WindowProductSetting param = new WindowProductSetting();
+ param.setProductId(productId);
+ param.setSetTop(setTop);
+ String resJson = storeService.post(TOP_WINDOW_PRODUCT_URL, param);
+ return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
+ }
+
+ @Override
+ public BackgroundApplyResponse applyBackground(String imgUrl) throws WxErrorException {
+ String paramJson = "{\"img_url\":\"" + imgUrl + "\"}";
+ String resJson = storeService.post(APPLY_BACKGROUND_URL, paramJson);
+ return ResponseUtils.decode(resJson, BackgroundApplyResponse.class);
+ }
+
+ @Override
+ public BackgroundGetResponse getBackground() throws WxErrorException {
+ String resJson = storeService.post(GET_BACKGROUND_URL, "");
+ return ResponseUtils.decode(resJson, BackgroundGetResponse.class);
+ }
+
+ @Override
+ public WxChannelBaseResponse cancelBackground(Integer applyId) throws WxErrorException {
+ String paramJson = "{\"apply_id\":" + applyId + "}";
+ String resJson = storeService.post(CANCEL_BACKGROUND_URL, paramJson);
+ return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
+ }
+
+ @Override
+ public WxChannelBaseResponse removeBackground() throws WxErrorException {
+ String resJson = storeService.post(REMOVE_BACKGROUND_URL, "");
+ return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
+ }
+
+ @Override
+ public BannerApplyResponse applyBanner(BannerInfo info) throws WxErrorException {
+ BannerApplyParam param = new BannerApplyParam(info);
+ String resJson = storeService.post(APPLY_BANNER_URL, param);
+ return ResponseUtils.decode(resJson, BannerApplyResponse.class);
+ }
+
+ @Override
+ public BannerGetResponse getBanner() throws WxErrorException {
+ String resJson = storeService.post(GET_BANNER_URL, "");
+ return ResponseUtils.decode(resJson, BannerGetResponse.class);
+ }
+
+ @Override
+ public WxChannelBaseResponse cancelBanner(Integer applyId) throws WxErrorException {
+ String paramJson = "{\"apply_id\":" + applyId + "}";
+ String resJson = storeService.post(CANCEL_BANNER_URL, paramJson);
+ return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
+ }
+
+ @Override
+ public WxChannelBaseResponse removeBanner() throws WxErrorException {
+ String resJson = storeService.post(REMOVE_BANNER_URL, "");
+ return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
+ }
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxTalentServiceImpl.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxTalentServiceImpl.java
new file mode 100644
index 0000000000..6bb623e9a4
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxTalentServiceImpl.java
@@ -0,0 +1,59 @@
+package me.chanjar.weixin.channel.api.impl;
+
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import me.chanjar.weixin.channel.api.WxTalentService;
+import me.chanjar.weixin.channel.bean.talent.TalentOrderDetailParam;
+import me.chanjar.weixin.channel.bean.talent.TalentOrderDetailResponse;
+import me.chanjar.weixin.channel.bean.talent.TalentOrderListParam;
+import me.chanjar.weixin.channel.bean.talent.TalentOrderListResponse;
+import me.chanjar.weixin.channel.bean.talent.TalentWindowProductDetailParam;
+import me.chanjar.weixin.channel.bean.talent.TalentWindowProductDetailResponse;
+import me.chanjar.weixin.channel.bean.talent.TalentWindowProductListParam;
+import me.chanjar.weixin.channel.bean.talent.TalentWindowProductListResponse;
+import me.chanjar.weixin.channel.util.ResponseUtils;
+import me.chanjar.weixin.common.error.WxErrorException;
+
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Talent.GET_ORDER_DETAIL_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Talent.GET_ORDER_LIST_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Talent.GET_WINDOW_PRODUCT_DETAIL_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Talent.GET_WINDOW_PRODUCT_LIST_URL;
+
+/**
+ * 微信小店-带货助手服务实现
+ *
+ * @author GitHub Copilot
+ */
+@RequiredArgsConstructor
+@Slf4j
+public class WxTalentServiceImpl implements WxTalentService {
+
+ /** 微信商店服务 */
+ private final BaseWxChannelServiceImpl, ?> shopService;
+
+ @Override
+ public TalentOrderListResponse getOrderList(TalentOrderListParam param) throws WxErrorException {
+ String resJson = shopService.post(GET_ORDER_LIST_URL, param);
+ return ResponseUtils.decode(resJson, TalentOrderListResponse.class);
+ }
+
+ @Override
+ public TalentOrderDetailResponse getOrderDetail(TalentOrderDetailParam param) throws WxErrorException {
+ String resJson = shopService.post(GET_ORDER_DETAIL_URL, param);
+ return ResponseUtils.decode(resJson, TalentOrderDetailResponse.class);
+ }
+
+ @Override
+ public TalentWindowProductListResponse getWindowProductList(TalentWindowProductListParam param)
+ throws WxErrorException {
+ String resJson = shopService.post(GET_WINDOW_PRODUCT_LIST_URL, param);
+ return ResponseUtils.decode(resJson, TalentWindowProductListResponse.class);
+ }
+
+ @Override
+ public TalentWindowProductDetailResponse getWindowProductDetail(TalentWindowProductDetailParam param)
+ throws WxErrorException {
+ String resJson = shopService.post(GET_WINDOW_PRODUCT_DETAIL_URL, param);
+ return ResponseUtils.decode(resJson, TalentWindowProductDetailResponse.class);
+ }
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/address/AddressAddParam.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/address/AddressAddParam.java
index a831de6655..71f7c5b966 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/address/AddressAddParam.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/address/AddressAddParam.java
@@ -12,11 +12,13 @@
* 地址 请求参数
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.address.AddressAddParam}。
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@JsonInclude(Include.NON_NULL)
+@Deprecated
public class AddressAddParam implements Serializable {
private static final long serialVersionUID = 6778585213498438738L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/address/AddressCode.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/address/AddressCode.java
index c7c885f0ab..9f212daa22 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/address/AddressCode.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/address/AddressCode.java
@@ -9,9 +9,11 @@
* 地址编码
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.address.AddressCode}。
*/
@Data
@NoArgsConstructor
+@Deprecated
public class AddressCode implements Serializable {
private static final long serialVersionUID = -6782328785056142627L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/address/AddressCodeResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/address/AddressCodeResponse.java
index 09ede50c38..df9559fee6 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/address/AddressCodeResponse.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/address/AddressCodeResponse.java
@@ -11,10 +11,12 @@
* 地址编码 响应
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.address.AddressCodeResponse}。
*/
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
+@Deprecated
public class AddressCodeResponse extends WxChannelBaseResponse {
private static final long serialVersionUID = -8994407971295563982L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/address/AddressDetail.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/address/AddressDetail.java
index 88f4945e20..f3dde94a28 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/address/AddressDetail.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/address/AddressDetail.java
@@ -11,10 +11,12 @@
* 用户地址
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.address.AddressDetail}。
*/
@Data
@NoArgsConstructor
@JsonInclude(JsonInclude.Include.NON_NULL)
+@Deprecated
public class AddressDetail implements Serializable {
private static final long serialVersionUID = -7839578838482198641L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/address/AddressIdParam.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/address/AddressIdParam.java
index d1eb7e0b46..1306fbf8ed 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/address/AddressIdParam.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/address/AddressIdParam.java
@@ -12,11 +12,13 @@
* 地址id 请求参数
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.address.AddressIdParam}。
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@JsonInclude(Include.NON_NULL)
+@Deprecated
public class AddressIdParam implements Serializable {
private static final long serialVersionUID = -7001183932180608746L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/address/AddressIdResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/address/AddressIdResponse.java
index f6505efa15..df580bc2e4 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/address/AddressIdResponse.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/address/AddressIdResponse.java
@@ -11,11 +11,13 @@
* 地址id 响应
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.address.AddressIdResponse}。
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
+@Deprecated
public class AddressIdResponse extends WxChannelBaseResponse {
private static final long serialVersionUID = -9218327846685744008L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/address/AddressInfoResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/address/AddressInfoResponse.java
index 957d0162a8..f77f562e34 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/address/AddressInfoResponse.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/address/AddressInfoResponse.java
@@ -10,10 +10,12 @@
* 地址id 响应
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.address.AddressInfoResponse}。
*/
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
+@Deprecated
public class AddressInfoResponse extends WxChannelBaseResponse {
private static final long serialVersionUID = 8203853673226715673L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/address/AddressListParam.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/address/AddressListParam.java
index c62cf39fb8..559d249250 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/address/AddressListParam.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/address/AddressListParam.java
@@ -11,11 +11,13 @@
* 用户地址 列表 请求参数
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.address.AddressListParam}。
*/
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@JsonInclude(Include.NON_NULL)
+@Deprecated
public class AddressListParam extends OffsetParam {
private static final long serialVersionUID = -4434287264623932176L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/address/AddressListResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/address/AddressListResponse.java
index b8846f9aa3..b18d399710 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/address/AddressListResponse.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/address/AddressListResponse.java
@@ -11,10 +11,12 @@
* 地址列表 响应
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.address.AddressListResponse}。
*/
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
+@Deprecated
public class AddressListResponse extends WxChannelBaseResponse {
private static final long serialVersionUID = -3997164605170764105L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/address/OfflineAddressType.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/address/OfflineAddressType.java
index 81dd169399..12345f2a52 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/address/OfflineAddressType.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/address/OfflineAddressType.java
@@ -10,10 +10,12 @@
* 线下配送地址类型
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.address.OfflineAddressType}。
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
+@Deprecated
public class OfflineAddressType implements Serializable {
private static final long serialVersionUID = 636850757572901377L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleAcceptExchangeReshipParam.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleAcceptExchangeReshipParam.java
new file mode 100644
index 0000000000..1f48cbe348
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleAcceptExchangeReshipParam.java
@@ -0,0 +1,37 @@
+package me.chanjar.weixin.channel.bean.after;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+
+/**
+ * 售后单换货发货信息
+ *
+ * @author Chu
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.after.AfterSaleAcceptExchangeReshipParam}。
+ */
+@Data
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@Deprecated
+public class AfterSaleAcceptExchangeReshipParam extends AfterSaleIdParam {
+ private static final long serialVersionUID = -7946679037747710613L;
+
+ /** 快递单号*/
+ @JsonProperty("waybill_id")
+ private String waybillId;
+
+ /** 快递公司id,通过获取快递公司列表接口获得,非主流快递公司可以填OTHER*/
+ @JsonProperty("delivery_id")
+ private String deliveryId;
+
+ public AfterSaleAcceptExchangeReshipParam() {
+
+ }
+
+ public AfterSaleAcceptExchangeReshipParam(String afterSaleOrderId, String waybillId, String deliveryId) {
+ super(afterSaleOrderId);
+ this.waybillId = waybillId;
+ this.deliveryId = deliveryId;
+ }
+
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleAcceptParam.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleAcceptParam.java
index ebc63a2190..13b0bc2f84 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleAcceptParam.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleAcceptParam.java
@@ -9,9 +9,11 @@
* 售后单同意信息
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.after.AfterSaleAcceptParam}。
*/
@Data
@JsonInclude(Include.NON_NULL)
+@Deprecated
public class AfterSaleAcceptParam extends AfterSaleIdParam {
private static final long serialVersionUID = -4352801757159074950L;
@@ -19,6 +21,10 @@ public class AfterSaleAcceptParam extends AfterSaleIdParam {
@JsonProperty("address_id")
private String addressId;
+ /** 针对退货退款同意售后的阶段: 1. 同意退货退款,并通知用户退货; 2. 确认收到货并退款给用户。 如果不填则将根据当前的售后单状态自动选择相应操作。对于仅退款的情况,由于只存在一种同意的场景,无需填写此字段。*/
+ @JsonProperty("accept_type")
+ private Integer acceptType;
+
public AfterSaleAcceptParam() {
}
@@ -26,4 +32,10 @@ public AfterSaleAcceptParam(String afterSaleOrderId, String addressId) {
super(afterSaleOrderId);
this.addressId = addressId;
}
+
+ public AfterSaleAcceptParam(String afterSaleOrderId, String addressId, Integer acceptType) {
+ super(afterSaleOrderId);
+ this.addressId = addressId;
+ this.acceptType = acceptType;
+ }
}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleCreateResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleCreateResponse.java
new file mode 100644
index 0000000000..268bf9814f
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleCreateResponse.java
@@ -0,0 +1,19 @@
+package me.chanjar.weixin.channel.bean.after;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
+
+/**
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.after.AfterSaleCreateResponse}。
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@Deprecated
+public class AfterSaleCreateResponse extends WxChannelBaseResponse {
+ private static final long serialVersionUID = 2680676438284658410L;
+
+ @JsonProperty("after_sale_order_id")
+ private String afterSaleOrderId;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleDetail.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleDetail.java
index aa1e7b400f..9c5780b20c 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleDetail.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleDetail.java
@@ -10,9 +10,11 @@
* 售后详情
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.after.AfterSaleDetail}。
*/
@Data
@NoArgsConstructor
+@Deprecated
public class AfterSaleDetail implements Serializable {
private static final long serialVersionUID = -8130659179770831047L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleExchangeDeliveryInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleExchangeDeliveryInfo.java
new file mode 100644
index 0000000000..2fbd7b482d
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleExchangeDeliveryInfo.java
@@ -0,0 +1,37 @@
+package me.chanjar.weixin.channel.bean.after;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import me.chanjar.weixin.channel.bean.base.AddressInfo;
+
+/**
+ * 换货类型的发货物流信息
+ *
+ * @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.after.AfterSaleExchangeDeliveryInfo}。
+ */
+@Data
+@NoArgsConstructor
+@Deprecated
+public class AfterSaleExchangeDeliveryInfo implements Serializable {
+
+ private static final long serialVersionUID = 3039216368034112038L;
+
+ /** 快递单号 */
+ @JsonProperty("waybill_id")
+ private String waybillId;
+
+ /** 物流公司id */
+ @JsonProperty("delivery_id")
+ private String deliveryId;
+
+ /** 物流公司名称 */
+ @JsonProperty("delivery_name")
+ private String deliveryName;
+
+ /** 地址信息 */
+ @JsonProperty("address_info")
+ private AddressInfo addressInfo;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleExchangeProductInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleExchangeProductInfo.java
new file mode 100644
index 0000000000..d279d78f56
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleExchangeProductInfo.java
@@ -0,0 +1,44 @@
+package me.chanjar.weixin.channel.bean.after;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 换货商品信息
+ *
+ * @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.after.AfterSaleExchangeProductInfo}。
+ */
+@Data
+@NoArgsConstructor
+@Deprecated
+public class AfterSaleExchangeProductInfo implements Serializable {
+
+ private static final long serialVersionUID = -1341436607011117854L;
+
+ /** 商品spuid */
+ @JsonProperty("product_id")
+ private String productId;
+
+ /** 旧商品skuid */
+ @JsonProperty("old_sku_id")
+ private String oldSkuId;
+
+ /** 新商品skuid */
+ @JsonProperty("new_sku_id")
+ private String newSkuId;
+
+ /** 数量 */
+ @JsonProperty("product_cnt")
+ private String productCnt;
+
+ /** 旧商品价格 */
+ @JsonProperty("old_sku_price")
+ private Integer oldSkuPrice;
+
+ /** 新商品价格 */
+ @JsonProperty("new_sku_price")
+ private Integer newSkuPrice;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleGenAfterSaleOrderParam.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleGenAfterSaleOrderParam.java
new file mode 100644
index 0000000000..ec2ec1c703
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleGenAfterSaleOrderParam.java
@@ -0,0 +1,29 @@
+package me.chanjar.weixin.channel.bean.after;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.after.AfterSaleGenAfterSaleOrderParam}。
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@Deprecated
+public class AfterSaleGenAfterSaleOrderParam extends AfterSaleRefundPriceDiffParam {
+ private static final long serialVersionUID = -6873909673739068936L;
+
+ @JsonProperty("count")
+ private Integer count;
+
+ @JsonProperty("type")
+ private String type;
+
+ @JsonProperty("address_id")
+ private String addressId;
+
+ @JsonProperty("exchange_sku_info")
+ private ExchangeSkuInfo exchangeSkuInfo;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleHandleFastExchangeReceiptParam.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleHandleFastExchangeReceiptParam.java
new file mode 100644
index 0000000000..05af300f2f
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleHandleFastExchangeReceiptParam.java
@@ -0,0 +1,33 @@
+package me.chanjar.weixin.channel.bean.after;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.List;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.after.AfterSaleHandleFastExchangeReceiptParam}。
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@Deprecated
+public class AfterSaleHandleFastExchangeReceiptParam extends AfterSaleIdParam {
+ private static final long serialVersionUID = 5430106715116197677L;
+
+ @JsonProperty("act")
+ private Integer act;
+
+ @JsonProperty("reject_reason")
+ private String rejectReason;
+
+ @JsonProperty("reject_reason_type")
+ private Integer rejectReasonType;
+
+ @JsonProperty("merchant_text")
+ private String merchantText;
+
+ @JsonProperty("reject_confirm_exchange")
+ private List rejectConfirmExchange;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleIdParam.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleIdParam.java
index 1e16a72395..8eec8569ec 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleIdParam.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleIdParam.java
@@ -12,11 +12,13 @@
* 售后单id信息
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.after.AfterSaleIdParam}。
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@JsonInclude(Include.NON_NULL)
+@Deprecated
public class AfterSaleIdParam implements Serializable {
private static final long serialVersionUID = 4974332291476116540L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleInfo.java
index b0d668b30e..d7309b0be4 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleInfo.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleInfo.java
@@ -9,9 +9,11 @@
* 售后单信息
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.after.AfterSaleInfo}。
*/
@Data
@NoArgsConstructor
+@Deprecated
public class AfterSaleInfo implements Serializable {
private static final long serialVersionUID = 6595670817781635247L;
@@ -82,4 +84,20 @@ public class AfterSaleInfo implements Serializable {
/** 纠纷id,该字段可用于获取纠纷信息 */
@JsonProperty("complaint_id")
private String complaintId;
+
+ /** 仅在待商家审核退款退货申请或收货期间返回,表示操作剩余时间(秒数)*/
+ @JsonProperty("deadline")
+ private Long deadline;
+
+ /** 售后换货商品信息 */
+ @JsonProperty("exchange_product_info")
+ private AfterSaleExchangeProductInfo exchangeProductInfo;
+
+ /** 售后换货物流信息 */
+ @JsonProperty("exchange_delivery_info")
+ private AfterSaleExchangeDeliveryInfo exchangeDeliveryInfo;
+
+ /** 售后换货虚拟号码信息 */
+ @JsonProperty("virtual_tel_num_info")
+ private AfterSaleVirtualNumberInfo virtualTelNumInfo;
}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleInfoResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleInfoResponse.java
index adedf72f03..c9f31b77d9 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleInfoResponse.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleInfoResponse.java
@@ -10,10 +10,12 @@
* 售后单 响应
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.after.AfterSaleInfoResponse}。
*/
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
+@Deprecated
public class AfterSaleInfoResponse extends WxChannelBaseResponse {
private static final long serialVersionUID = -752661975153491902L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleListParam.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleListParam.java
index 78cc394085..86ae7825f3 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleListParam.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleListParam.java
@@ -12,11 +12,13 @@
* 售后单列表 请求参数
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.after.AfterSaleListParam}。
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@JsonInclude(Include.NON_NULL)
+@Deprecated
public class AfterSaleListParam implements Serializable {
private static final long serialVersionUID = -103549981452112069L;
@@ -28,6 +30,14 @@ public class AfterSaleListParam implements Serializable {
@JsonProperty("end_create_time")
private Long endCreateTime;
+ /** 售后单更新起始时间 */
+ @JsonProperty("begin_update_time")
+ private Long beginUpdateTime;
+
+ /** 售后单更新结束时间,end_update_time减去begin_update_time不得大于24小时 */
+ @JsonProperty("end_update_time")
+ private Long endUpdateTime;
+
/** 翻页参数,从第二页开始传,来源于上一页的返回值 */
@JsonProperty("next_key")
private String nextKey;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleListResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleListResponse.java
index 3ad67cffcf..1fbc115f2c 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleListResponse.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleListResponse.java
@@ -11,10 +11,12 @@
* 售后单列表 响应
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.after.AfterSaleListResponse}。
*/
@Data
@NoArgsConstructor
-@EqualsAndHashCode
+@EqualsAndHashCode(callSuper = true)
+@Deprecated
public class AfterSaleListResponse extends WxChannelBaseResponse {
private static final long serialVersionUID = 5033313416948732123L;
@@ -23,6 +25,7 @@ public class AfterSaleListResponse extends WxChannelBaseResponse {
private List ids;
/** 翻页参数 */
+ @JsonProperty("next_key")
private String nextKey;
/** 是否还有数据 */
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleMerchantUpdateParam.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleMerchantUpdateParam.java
new file mode 100644
index 0000000000..808091cbe5
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleMerchantUpdateParam.java
@@ -0,0 +1,59 @@
+package me.chanjar.weixin.channel.bean.after;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * 售后单商家协商信息
+ *
+ * @author Chu
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.after.AfterSaleMerchantUpdateParam}。
+ */
+@Data
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@Deprecated
+public class AfterSaleMerchantUpdateParam extends AfterSaleIdParam {
+ private static final long serialVersionUID = -3672834150982780L;
+
+ /** 协商修改把售后单修改成该售后类型。1:退款;2:退货退款*/
+ @JsonProperty("type")
+ private Integer type;
+
+ /** 金额(单位:分)*/
+ @JsonProperty("amount")
+ private Integer amount;
+
+ /** 协商描述*/
+ @JsonProperty("merchant_update_desc")
+ private String merchantUpdateDesc;
+
+ /** 协商原因*/
+ @JsonProperty("update_reason_type")
+ private Integer updateReasonType;
+
+ /** 1:已协商一致,邀请买家取消售后; 2:邀请买家核实与补充凭证; 3:修改买家售后申请*/
+ @JsonProperty("merchant_update_type")
+ private Integer merchantUpdateType;
+
+ /** 协商凭证id列表,可使用图片上传接口获取media_id(数据类型填0),当update_reason_type对应的need_image为1时必填*/
+ @JsonProperty("media_ids")
+ private List mediaIds;
+
+ public AfterSaleMerchantUpdateParam() {
+ }
+
+ public AfterSaleMerchantUpdateParam(String afterSaleOrderId, Integer type, Integer updateReasonType, Integer merchantUpdateType
+ , Integer amount, String merchantUpdateDesc, List mediaIds) {
+ super(afterSaleOrderId);
+ this.type = type;
+ this.updateReasonType = updateReasonType;
+ this.merchantUpdateType = merchantUpdateType;
+ this.amount = amount;
+ this.merchantUpdateDesc = merchantUpdateDesc;
+ this.mediaIds = mediaIds;
+ }
+
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleProductInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleProductInfo.java
index ffcaf320ca..a74283350c 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleProductInfo.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleProductInfo.java
@@ -9,9 +9,11 @@
* 售后相关商品信息
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.after.AfterSaleProductInfo}。
*/
@Data
@NoArgsConstructor
+@Deprecated
public class AfterSaleProductInfo implements Serializable {
private static final long serialVersionUID = 4205179093262757775L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleReason.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleReason.java
new file mode 100644
index 0000000000..9efb0fc02f
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleReason.java
@@ -0,0 +1,35 @@
+package me.chanjar.weixin.channel.bean.after;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+/**
+ * 全量售后原因
+ *
+ * @author lizhengwu
+ * @date 2024/7/24
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.after.AfterSaleReason}。
+ */
+@Data
+@NoArgsConstructor
+@Deprecated
+public class AfterSaleReason implements Serializable {
+
+ private static final long serialVersionUID = -3674527884494606230L;
+
+ /**
+ * 售后原因枚举
+ */
+ @JsonProperty("reason")
+ private Integer reason;
+
+ /**
+ * 售后原因说明
+ */
+ @JsonProperty("reason_text")
+ private String reasonText;
+
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleReasonResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleReasonResponse.java
new file mode 100644
index 0000000000..79d9a6714f
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleReasonResponse.java
@@ -0,0 +1,30 @@
+package me.chanjar.weixin.channel.bean.after;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
+
+import java.util.List;
+
+/**
+ * 售后原因
+ *
+ *
+ * @author lizhengwu
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.after.AfterSaleReasonResponse}。
+ */
+@Data
+@NoArgsConstructor
+@EqualsAndHashCode
+@Deprecated
+public class AfterSaleReasonResponse extends WxChannelBaseResponse {
+
+
+ private static final long serialVersionUID = -580378623915041396L;
+
+ @JsonProperty("reason_list")
+ private List reasonList;
+
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleRefundPriceDiffParam.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleRefundPriceDiffParam.java
new file mode 100644
index 0000000000..7949fe98f3
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleRefundPriceDiffParam.java
@@ -0,0 +1,37 @@
+package me.chanjar.weixin.channel.bean.after;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.Serializable;
+import lombok.Data;
+
+/**
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.after.AfterSaleRefundPriceDiffParam}。
+ */
+@Data
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@Deprecated
+public class AfterSaleRefundPriceDiffParam implements Serializable {
+ private static final long serialVersionUID = 3875058376021518123L;
+
+ @JsonProperty("request_id")
+ private String requestId;
+
+ @JsonProperty("order_id")
+ private String orderId;
+
+ @JsonProperty("product_id")
+ private String productId;
+
+ @JsonProperty("sku_id")
+ private String skuId;
+
+ @JsonProperty("amount")
+ private Integer amount;
+
+ @JsonProperty("reason")
+ private String reason;
+
+ @JsonProperty("desc")
+ private String desc;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleRejectExchangeReshipParam.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleRejectExchangeReshipParam.java
new file mode 100644
index 0000000000..6097ea6fb5
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleRejectExchangeReshipParam.java
@@ -0,0 +1,43 @@
+package me.chanjar.weixin.channel.bean.after;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * 售后单换货拒绝发货信息
+ *
+ * @author Chu
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.after.AfterSaleRejectExchangeReshipParam}。
+ */
+@Data
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@Deprecated
+public class AfterSaleRejectExchangeReshipParam extends AfterSaleIdParam {
+ private static final long serialVersionUID = -7946679037747710613L;
+
+ /** 拒绝原因具体描述 ,可使用默认描述,也可以自定义描述*/
+ @JsonProperty("reject_reason")
+ private String rejectReason;
+
+ /** 拒绝原因枚举 */
+ @JsonProperty("reject_reason_type")
+ private Integer rejectReasonType;
+
+ /** 退款凭证,可使用图片上传接口获取media_id(数据类型填0)*/
+ @JsonProperty("reject_certificates")
+ private List rejectCertificates;
+
+ public AfterSaleRejectExchangeReshipParam() {
+ }
+
+ public AfterSaleRejectExchangeReshipParam(String afterSaleOrderId, String rejectReason, Integer rejectReasonType, List rejectCertificates) {
+ super(afterSaleOrderId);
+ this.rejectReason = rejectReason;
+ this.rejectReasonType = rejectReasonType;
+ this.rejectCertificates = rejectCertificates;
+ }
+
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleRejectParam.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleRejectParam.java
index 080665ac00..3aefc8b4e8 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleRejectParam.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleRejectParam.java
@@ -5,20 +5,38 @@
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
+import java.util.List;
+
/**
* 售后单拒绝信息
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.after.AfterSaleRejectParam}。
*/
@Data
@JsonInclude(Include.NON_NULL)
+@Deprecated
public class AfterSaleRejectParam extends AfterSaleIdParam {
private static final long serialVersionUID = -7507483859864253314L;
- /** 拒绝原因 */
+ /**
+ * 拒绝原因
+ */
@JsonProperty("reject_reason")
private String rejectReason;
+ /**
+ * 拒绝原因枚举值
+ */
+ @JsonProperty("reject_reason_type")
+ private Integer rejectReasonType;
+
+ /**
+ * 拒绝凭证图片列表,可使用图片上传接口获取media_id
+ */
+ @JsonProperty("reject_certificates")
+ private List rejectCertificates;
+
public AfterSaleRejectParam() {
}
@@ -26,4 +44,18 @@ public AfterSaleRejectParam(String afterSaleOrderId, String rejectReason) {
super(afterSaleOrderId);
this.rejectReason = rejectReason;
}
+
+ public AfterSaleRejectParam(String afterSaleOrderId, String rejectReason, Integer rejectReasonType) {
+ super(afterSaleOrderId);
+ this.rejectReason = rejectReason;
+ this.rejectReasonType = rejectReasonType;
+ }
+
+ public AfterSaleRejectParam(String afterSaleOrderId, String rejectReason, Integer rejectReasonType,
+ List rejectCertificates) {
+ super(afterSaleOrderId);
+ this.rejectReason = rejectReason;
+ this.rejectReasonType = rejectReasonType;
+ this.rejectCertificates = rejectCertificates;
+ }
}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleRejectReason.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleRejectReason.java
new file mode 100644
index 0000000000..4f4b70b4e7
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleRejectReason.java
@@ -0,0 +1,46 @@
+package me.chanjar.weixin.channel.bean.after;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+/**
+ * 拒绝售后原因
+ *
+ * @author lizhengwu
+ * @date 2024/7/24
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.after.AfterSaleRejectReason}。
+ */
+@Data
+@NoArgsConstructor
+@Deprecated
+public class AfterSaleRejectReason implements Serializable {
+
+ private static final long serialVersionUID = -3672834150982780L;
+
+ /**
+ * 售后拒绝原因枚举
+ */
+ @JsonProperty("reject_reason_type")
+ private Integer rejectReasonType;
+
+ /**
+ * 售后拒绝原因说明
+ */
+ @JsonProperty("reject_reason_type_text")
+ private String rejectReasonTypeText;
+
+ /**
+ * 售后拒绝原因默认描述
+ */
+ @JsonProperty("reject_reason")
+ private String rejectReason;
+
+ /**
+ * 售后拒绝原因适用场景
+ */
+ @JsonProperty("reject_scene")
+ private Integer rejectScene;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleRejectReasonResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleRejectReasonResponse.java
new file mode 100644
index 0000000000..06c1256c5f
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleRejectReasonResponse.java
@@ -0,0 +1,31 @@
+package me.chanjar.weixin.channel.bean.after;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
+
+import java.util.List;
+
+/**
+ * 售后原因
+ *
+ * @author lizhengwu
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.after.AfterSaleRejectReasonResponse}。
+ */
+@Data
+@NoArgsConstructor
+@EqualsAndHashCode
+@Deprecated
+public class AfterSaleRejectReasonResponse extends WxChannelBaseResponse {
+
+ private static final long serialVersionUID = -7946679037747710613L;
+
+ /**
+ * 售后原因列表
+ */
+ @JsonProperty("reject_reason_list")
+ private List rejectReasonList;
+
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleReturnParam.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleReturnParam.java
index 47e815c8dd..d2a0502c27 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleReturnParam.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleReturnParam.java
@@ -9,8 +9,10 @@
* 退货信息
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.after.AfterSaleReturnParam}。
*/
@Data
+@Deprecated
public class AfterSaleReturnParam implements Serializable {
private static final long serialVersionUID = -1101993925465293521L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleVirtualNumberInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleVirtualNumberInfo.java
new file mode 100644
index 0000000000..ab37c18ebc
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleVirtualNumberInfo.java
@@ -0,0 +1,28 @@
+package me.chanjar.weixin.channel.bean.after;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 虚拟号码信息
+ *
+ * @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.after.AfterSaleVirtualNumberInfo}。
+ */
+@Data
+@NoArgsConstructor
+@Deprecated
+public class AfterSaleVirtualNumberInfo implements Serializable {
+ private static final long serialVersionUID = -5756618937333859985L;
+
+ /** 虚拟号码 */
+ @JsonProperty("virtual_tel_number")
+ private String virtualTelNumber;
+
+ /** 虚拟号码过期时间 */
+ @JsonProperty("virtual_tel_expire_time")
+ private Long virtualTelExpireTime;
+
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleVirtualTelNumResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleVirtualTelNumResponse.java
new file mode 100644
index 0000000000..8a40fdec43
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleVirtualTelNumResponse.java
@@ -0,0 +1,22 @@
+package me.chanjar.weixin.channel.bean.after;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
+
+/**
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.after.AfterSaleVirtualTelNumResponse}。
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@Deprecated
+public class AfterSaleVirtualTelNumResponse extends WxChannelBaseResponse {
+ private static final long serialVersionUID = -2715343569103426942L;
+
+ @JsonProperty("virtual_tel_number")
+ private String virtualTelNumber;
+
+ @JsonProperty("virtual_tel_expire_time")
+ private Long virtualTelExpireTime;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/ExchangeSkuInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/ExchangeSkuInfo.java
new file mode 100644
index 0000000000..929e3560b6
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/ExchangeSkuInfo.java
@@ -0,0 +1,18 @@
+package me.chanjar.weixin.channel.bean.after;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.Serializable;
+import lombok.Data;
+
+/**
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.after.ExchangeSkuInfo}。
+ */
+@Data
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@Deprecated
+public class ExchangeSkuInfo implements Serializable {
+ private static final long serialVersionUID = 1L;
+ @JsonProperty("new_sku_id")
+ private String newSkuId;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/GuaranteeMerchantModifyParam.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/GuaranteeMerchantModifyParam.java
new file mode 100644
index 0000000000..41be302aed
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/GuaranteeMerchantModifyParam.java
@@ -0,0 +1,23 @@
+package me.chanjar.weixin.channel.bean.after;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.after.GuaranteeMerchantModifyParam}。
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@Deprecated
+public class GuaranteeMerchantModifyParam extends GuaranteeOrderIdParam {
+ private static final long serialVersionUID = 9193536167701367687L;
+
+ @JsonProperty("bad_level")
+ private Integer badLevel;
+
+ @JsonProperty("merchant_remark")
+ private String merchantRemark;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/GuaranteeMerchantProofParam.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/GuaranteeMerchantProofParam.java
new file mode 100644
index 0000000000..3501bff266
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/GuaranteeMerchantProofParam.java
@@ -0,0 +1,23 @@
+package me.chanjar.weixin.channel.bean.after;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.after.GuaranteeMerchantProofParam}。
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@Deprecated
+public class GuaranteeMerchantProofParam extends GuaranteeOrderIdParam {
+ private static final long serialVersionUID = -2365495841866160967L;
+
+ @JsonProperty("content")
+ private String content;
+
+ @JsonProperty("pic_list")
+ private java.util.List picList;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/GuaranteeModifyRequest.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/GuaranteeModifyRequest.java
new file mode 100644
index 0000000000..c6d7786f8c
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/GuaranteeModifyRequest.java
@@ -0,0 +1,36 @@
+package me.chanjar.weixin.channel.bean.after;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonInclude.Include;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+
+/**
+ * 商家协商保障单请求参数。
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.after.GuaranteeModifyRequest}。
+ */
+@Data
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+@JsonInclude(Include.NON_NULL)
+@Deprecated
+public class GuaranteeModifyRequest extends GuaranteeOrderIdParam {
+
+ private static final long serialVersionUID = 4268864541609439068L;
+
+ /** 商品破损程度。 */
+ @JsonProperty("bad_level")
+ private Integer badLevel;
+
+ /** 商家协商备注。 */
+ @JsonProperty("merchant_remark")
+ private String merchantRemark;
+
+ public GuaranteeModifyRequest(String guaranteeOrderId, Integer badLevel, String merchantRemark) {
+ super(guaranteeOrderId);
+ this.badLevel = badLevel;
+ this.merchantRemark = merchantRemark;
+ }
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/GuaranteeOrderIdParam.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/GuaranteeOrderIdParam.java
new file mode 100644
index 0000000000..2fb99a097d
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/GuaranteeOrderIdParam.java
@@ -0,0 +1,27 @@
+package me.chanjar.weixin.channel.bean.after;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonInclude.Include;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.Serializable;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 保障单号参数。
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.after.GuaranteeOrderIdParam}。
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@JsonInclude(Include.NON_NULL)
+@Deprecated
+public class GuaranteeOrderIdParam implements Serializable {
+
+ private static final long serialVersionUID = -6638498743123537413L;
+
+ /** 保障单号。 */
+ @JsonProperty("guarantee_order_id")
+ private String guaranteeOrderId;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/GuaranteeOrderInfoResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/GuaranteeOrderInfoResponse.java
new file mode 100644
index 0000000000..c7c2301aec
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/GuaranteeOrderInfoResponse.java
@@ -0,0 +1,61 @@
+package me.chanjar.weixin.channel.bean.after;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
+
+/**
+ * 保障单详情响应。
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.after.GuaranteeOrderInfoResponse}。
+ */
+@Data
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+@Deprecated
+public class GuaranteeOrderInfoResponse extends WxChannelBaseResponse {
+
+ private static final long serialVersionUID = 7354122991247317485L;
+
+ /** 保障单详情。 */
+ @JsonProperty("guarantee_order")
+ private GuaranteeOrder guaranteeOrder;
+
+ /**
+ * 保障单详情。
+ */
+ @Data
+ @NoArgsConstructor
+ public static class GuaranteeOrder implements Serializable {
+
+ private static final long serialVersionUID = -2398976447575813507L;
+
+ /** 保障单号。 */
+ @JsonProperty("guarantee_order_id")
+ private String guaranteeOrderId;
+
+ /** 保障单状态。 */
+ @JsonProperty("status")
+ private String status;
+
+ /** 商品信息。 */
+ @JsonProperty("product_info")
+ private ProductInfo productInfo;
+ }
+
+ /**
+ * 详情商品信息。
+ */
+ @Data
+ @NoArgsConstructor
+ public static class ProductInfo implements Serializable {
+
+ private static final long serialVersionUID = -2455740986246085934L;
+
+ /** 商品 SPU ID。 */
+ @JsonProperty("product_id")
+ private String productId;
+ }
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/GuaranteeOrderListParam.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/GuaranteeOrderListParam.java
new file mode 100644
index 0000000000..a5c64c629a
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/GuaranteeOrderListParam.java
@@ -0,0 +1,46 @@
+package me.chanjar.weixin.channel.bean.after;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonInclude.Include;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.Serializable;
+import java.util.List;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 保障单列表请求参数。
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.after.GuaranteeOrderListParam}。
+ */
+@Data
+@NoArgsConstructor
+@JsonInclude(Include.NON_NULL)
+@Deprecated
+public class GuaranteeOrderListParam implements Serializable {
+
+ private static final long serialVersionUID = 1622570776364341988L;
+
+ @JsonProperty("guarantee_order_id_list")
+ private List guaranteeOrderIdList;
+
+ @JsonProperty("order_id_list")
+ private List orderIdList;
+
+ @JsonProperty("type")
+ private Integer type;
+
+ @JsonProperty("begin_time")
+ private Long beginTime;
+
+ @JsonProperty("end_time")
+ private Long endTime;
+
+ @JsonProperty("status_list")
+ private String statusList;
+
+ @JsonProperty("offset")
+ private Integer offset;
+
+ @JsonProperty("limit")
+ private Integer limit;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/GuaranteeOrderListResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/GuaranteeOrderListResponse.java
new file mode 100644
index 0000000000..defb95b909
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/GuaranteeOrderListResponse.java
@@ -0,0 +1,66 @@
+package me.chanjar.weixin.channel.bean.after;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.Serializable;
+import java.util.List;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
+
+/**
+ * 保障单列表响应。
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.after.GuaranteeOrderListResponse}。
+ */
+@Data
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+@Deprecated
+public class GuaranteeOrderListResponse extends WxChannelBaseResponse {
+
+ private static final long serialVersionUID = 9105476087203713187L;
+
+ /** 保障单总数。 */
+ @JsonProperty("total_num")
+ private Integer totalNum;
+
+ /** 保障单列表。 */
+ @JsonProperty("guarantee_order_list")
+ private List guaranteeOrderList;
+
+ /**
+ * 保障单列表项。
+ */
+ @Data
+ @NoArgsConstructor
+ public static class GuaranteeOrder implements Serializable {
+
+ private static final long serialVersionUID = 7151952524213202281L;
+
+ /** 保障单号。 */
+ @JsonProperty("guarantee_order_id")
+ private String guaranteeOrderId;
+
+ /** 保障单状态。 */
+ @JsonProperty("status")
+ private String status;
+
+ /** 商品信息列表。 */
+ @JsonProperty("product_info")
+ private List productInfo;
+ }
+
+ /**
+ * 列表商品信息。
+ */
+ @Data
+ @NoArgsConstructor
+ public static class ProductInfo implements Serializable {
+
+ private static final long serialVersionUID = -2565763879505631638L;
+
+ /** 商品 SPU ID。 */
+ @JsonProperty("product_id")
+ private String productId;
+ }
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/GuaranteeOrderResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/GuaranteeOrderResponse.java
new file mode 100644
index 0000000000..d3909cf10e
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/GuaranteeOrderResponse.java
@@ -0,0 +1,20 @@
+package me.chanjar.weixin.channel.bean.after;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.databind.JsonNode;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
+
+/**
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.after.GuaranteeOrderResponse}。
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@Deprecated
+public class GuaranteeOrderResponse extends WxChannelBaseResponse {
+ private static final long serialVersionUID = 3977781489692530604L;
+
+ @JsonProperty("guarantee_order")
+ private JsonNode guaranteeOrder;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/GuaranteeProofRequest.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/GuaranteeProofRequest.java
new file mode 100644
index 0000000000..8a6d29b885
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/GuaranteeProofRequest.java
@@ -0,0 +1,37 @@
+package me.chanjar.weixin.channel.bean.after;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonInclude.Include;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.List;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+
+/**
+ * 商家举证保障单请求参数。
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.after.GuaranteeProofRequest}。
+ */
+@Data
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+@JsonInclude(Include.NON_NULL)
+@Deprecated
+public class GuaranteeProofRequest extends GuaranteeOrderIdParam {
+
+ private static final long serialVersionUID = 6599721896742974275L;
+
+ /** 举证内容。 */
+ @JsonProperty("content")
+ private String content;
+
+ /** 举证图片 media_id 列表。 */
+ @JsonProperty("pic_list")
+ private List picList;
+
+ public GuaranteeProofRequest(String guaranteeOrderId, String content, List picList) {
+ super(guaranteeOrderId);
+ this.content = content;
+ this.picList = picList;
+ }
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/GuaranteeRefuseRequest.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/GuaranteeRefuseRequest.java
new file mode 100644
index 0000000000..0e67312cca
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/GuaranteeRefuseRequest.java
@@ -0,0 +1,37 @@
+package me.chanjar.weixin.channel.bean.after;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonInclude.Include;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.List;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+
+/**
+ * 商家拒绝保障单请求参数。
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.after.GuaranteeRefuseRequest}。
+ */
+@Data
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+@JsonInclude(Include.NON_NULL)
+@Deprecated
+public class GuaranteeRefuseRequest extends GuaranteeOrderIdParam {
+
+ private static final long serialVersionUID = -6905594717805091393L;
+
+ /** 拒绝原因。 */
+ @JsonProperty("reason")
+ private String reason;
+
+ /** 拒绝凭证图片 media_id 列表。 */
+ @JsonProperty("pic_list")
+ private List picList;
+
+ public GuaranteeRefuseRequest(String guaranteeOrderId, String reason, List picList) {
+ super(guaranteeOrderId);
+ this.reason = reason;
+ this.picList = picList;
+ }
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/MerchantUploadInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/MerchantUploadInfo.java
index 805c3a3f6e..1ce46042fe 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/MerchantUploadInfo.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/MerchantUploadInfo.java
@@ -10,9 +10,11 @@
* 商家上传的信息
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.after.MerchantUploadInfo}。
*/
@Data
@NoArgsConstructor
+@Deprecated
public class MerchantUploadInfo implements Serializable {
private static final long serialVersionUID = 373513419356603563L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/RefundEvidenceParam.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/RefundEvidenceParam.java
index c81ae042d4..e3cd1dccc9 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/RefundEvidenceParam.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/RefundEvidenceParam.java
@@ -12,11 +12,13 @@
* 退款凭证信息
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.after.RefundEvidenceParam}。
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@JsonInclude(JsonInclude.Include.NON_NULL)
+@Deprecated
public class RefundEvidenceParam implements Serializable {
private static final long serialVersionUID = 2117305897849528009L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/RefundInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/RefundInfo.java
index 9837b72b28..d87875d7e9 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/RefundInfo.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/RefundInfo.java
@@ -9,13 +9,19 @@
* 退款信息
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.after.RefundInfo}。
*/
@Data
@NoArgsConstructor
+@Deprecated
public class RefundInfo implements Serializable {
private static final long serialVersionUID = -6994243947898889309L;
/** 退款金额(分) */
@JsonProperty("amount")
private Integer amount;
+
+ /** 标明售后单退款直接原因, 枚举值详情请参考 {@link me.chanjar.weixin.channel.enums.RefundReason} */
+ @JsonProperty("refund_reason")
+ private Integer refundReason;
}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/RefundResp.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/RefundResp.java
index 83b7039a77..96f639e607 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/RefundResp.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/RefundResp.java
@@ -9,9 +9,11 @@
* 退款结果
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.after.RefundResp}。
*/
@Data
@NoArgsConstructor
+@Deprecated
public class RefundResp implements Serializable {
private static final long serialVersionUID = 6549707043779644156L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/ReturnInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/ReturnInfo.java
index 08238d5484..3f3e0a1066 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/ReturnInfo.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/ReturnInfo.java
@@ -9,9 +9,11 @@
* 用户退货信息
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.after.ReturnInfo}。
*/
@Data
@NoArgsConstructor
+@Deprecated
public class ReturnInfo implements Serializable {
private static final long serialVersionUID = 1643844664701376892L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/SyncWorkOrderParam.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/SyncWorkOrderParam.java
new file mode 100644
index 0000000000..4408ec16c3
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/SyncWorkOrderParam.java
@@ -0,0 +1,83 @@
+package me.chanjar.weixin.channel.bean.after;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.Serializable;
+import java.util.List;
+import lombok.Data;
+
+/**
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.after.SyncWorkOrderParam}。
+ */
+@Data
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@Deprecated
+public class SyncWorkOrderParam implements Serializable {
+ private static final long serialVersionUID = -7336088606071452113L;
+
+ @JsonProperty("complaint_id")
+ private String complaintId;
+
+ @JsonProperty("work_order_info")
+ private WorkOrderInfo workOrderInfo;
+
+ @Data
+ @JsonInclude(JsonInclude.Include.NON_NULL)
+ public static class WorkOrderInfo implements Serializable {
+ private static final long serialVersionUID = 8573016851280130766L;
+
+ @JsonProperty("version")
+ private Integer version;
+
+ @JsonProperty("items")
+ private List items;
+
+ @JsonProperty("work_order_id")
+ private String workOrderId;
+ }
+
+ @Data
+ @JsonInclude(JsonInclude.Include.NON_NULL)
+ public static class WorkOrderItem implements Serializable {
+ private static final long serialVersionUID = 6925580701152256736L;
+
+ @JsonProperty("status")
+ private Integer status;
+
+ @JsonProperty("desc")
+ private String desc;
+
+ @JsonProperty("update_time")
+ private Long updateTime;
+
+ @JsonProperty("result_type")
+ private Integer resultType;
+
+ @JsonProperty("refund_amount")
+ private Integer refundAmount;
+
+ @JsonProperty("media_list")
+ private List mediaList;
+ }
+
+ @Data
+ @JsonInclude(JsonInclude.Include.NON_NULL)
+ public static class WorkOrderMedia implements Serializable {
+ private static final long serialVersionUID = 2258990333977395631L;
+
+ @JsonProperty("type")
+ private Integer type;
+
+ @JsonProperty("picture")
+ private WorkOrderPicture picture;
+ }
+
+ @Data
+ @JsonInclude(JsonInclude.Include.NON_NULL)
+ public static class WorkOrderPicture implements Serializable {
+ private static final long serialVersionUID = -3339842364541603289L;
+
+ @JsonProperty("tmp_media_id")
+ private String tmpMediaId;
+ }
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/audit/AuditApplyResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/audit/AuditApplyResponse.java
index 547207c82b..7963c8ea7b 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/audit/AuditApplyResponse.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/audit/AuditApplyResponse.java
@@ -10,10 +10,12 @@
* 审核提交结果响应
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.audit.AuditApplyResponse}。
*/
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
+@Deprecated
public class AuditApplyResponse extends WxChannelBaseResponse {
private static final long serialVersionUID = -3950614749162384497L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/audit/AuditResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/audit/AuditResponse.java
index 3ef07387d1..af2e31497b 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/audit/AuditResponse.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/audit/AuditResponse.java
@@ -10,10 +10,12 @@
* 审核结果响应
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.audit.AuditResponse}。
*/
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
+@Deprecated
public class AuditResponse extends WxChannelBaseResponse {
private static final long serialVersionUID = 9218713381520774914L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/audit/AuditResult.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/audit/AuditResult.java
index 89aaa8a267..2d0edf0a13 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/audit/AuditResult.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/audit/AuditResult.java
@@ -9,9 +9,11 @@
* 审核结果
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.audit.AuditResult}。
*/
@Data
@NoArgsConstructor
+@Deprecated
public class AuditResult implements Serializable {
private static final long serialVersionUID = 1846416634865665240L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/audit/CategoryAuditInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/audit/CategoryAuditInfo.java
index 72a84bc922..516debd10a 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/audit/CategoryAuditInfo.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/audit/CategoryAuditInfo.java
@@ -1,5 +1,6 @@
package me.chanjar.weixin.channel.bean.audit;
+import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable;
import java.util.List;
@@ -11,10 +12,13 @@
* 类目审核信息
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.audit.CategoryAuditInfo}。
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@Deprecated
public class CategoryAuditInfo implements Serializable {
private static final long serialVersionUID = -8792967130645424788L;
@@ -31,7 +35,47 @@ public class CategoryAuditInfo implements Serializable {
@JsonProperty("level3")
private Long level3;
- /** 资质材料,图片url,图片类型,最多不超过10张 */
+ /** 新类目树类目ID */
+ @JsonProperty("cats_v2")
+ private List catsV2;
+
+ /** 资质材料,图片fileid,图片类型,最多不超过10张 */
@JsonProperty("certificate")
private List certificates;
+
+ /** 报备函,图片fileid,图片类型,最多不超过10张 */
+ @JsonProperty("baobeihan")
+ private List baobeihan;
+
+ /** 经营证明,图片fileid,图片类型,最多不超过10张 */
+ @JsonProperty("jingyingzhengming")
+ private List jingyingzhengming;
+
+ /** 带货口碑,图片fileid,图片类型,最多不超过10张 */
+ @JsonProperty("daihuokoubei")
+ private List daihuokoubei;
+
+ /** 入住资质,图片fileid,图片类型,最多不超过10张 */
+ @JsonProperty("ruzhuzhizhi")
+ private List ruzhuzhizhi;
+
+ /** 经营流水,图片fileid,图片类型,最多不超过10张 */
+ @JsonProperty("jingyingliushui")
+ private List jingyingliushui;
+
+ /** 补充材料,图片fileid,图片类型,最多不超过10张 */
+ @JsonProperty("buchongcailiao")
+ private List buchongcailiao;
+
+ /** 经营平台,仅支持taobao,jd,douyin,kuaishou,pdd,other这些取值 */
+ @JsonProperty("jingyingpingtai")
+ private String jingyingpingtai;
+
+ /** 账号名称 */
+ @JsonProperty("zhanghaomingcheng")
+ private String zhanghaomingcheng;
+
+ /** 品牌列表,获取类目信息中的attr.is_limit_brand为true时必传 */
+ @JsonProperty("brand_list")
+ private List brandList;
}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/audit/CategoryAuditRequest.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/audit/CategoryAuditRequest.java
index a311bf0d2f..a3bf73cc09 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/audit/CategoryAuditRequest.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/audit/CategoryAuditRequest.java
@@ -10,10 +10,12 @@
* 类目审核信息
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.audit.CategoryAuditRequest}。
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
+@Deprecated
public class CategoryAuditRequest implements Serializable {
private static final long serialVersionUID = -1151634735247657643L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/audit/CategoryBrand.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/audit/CategoryBrand.java
new file mode 100644
index 0000000000..058c224004
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/audit/CategoryBrand.java
@@ -0,0 +1,25 @@
+package me.chanjar.weixin.channel.bean.audit;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.Serializable;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 分类中的品牌
+ *
+ * @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.audit.CategoryBrand}。
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@Deprecated
+public class CategoryBrand implements Serializable {
+ private static final long serialVersionUID = -5437441266080209907L;
+
+ /** 品牌ID,是店铺申请且已审核通过的品牌ID */
+ @JsonProperty("brand_id")
+ private String brand_id;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/audit/CatsV2.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/audit/CatsV2.java
new file mode 100644
index 0000000000..c77ad5fcea
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/audit/CatsV2.java
@@ -0,0 +1,24 @@
+package me.chanjar.weixin.channel.bean.audit;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.Serializable;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 新类目树类目ID
+ * @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.audit.CatsV2}。
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@Deprecated
+public class CatsV2 implements Serializable {
+ private static final long serialVersionUID = -2484092110142035589L;
+
+ /** 新类目树类目ID */
+ @JsonProperty("cat_id")
+ private String catId;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/audit/ProductAuditInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/audit/ProductAuditInfo.java
index 7693f23ed3..814bcf6755 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/audit/ProductAuditInfo.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/audit/ProductAuditInfo.java
@@ -9,9 +9,11 @@
* 商品审核信息
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.audit.ProductAuditInfo}。
*/
@Data
@NoArgsConstructor
+@Deprecated
public class ProductAuditInfo implements Serializable {
private static final long serialVersionUID = -5264206679057480206L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/base/AddressInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/base/AddressInfo.java
index 3c713840a4..df752977b2 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/base/AddressInfo.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/base/AddressInfo.java
@@ -10,10 +10,12 @@
* 地址信息
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.base.AddressInfo}。
*/
@Data
@NoArgsConstructor
@Accessors(chain = true)
+@Deprecated
public class AddressInfo implements Serializable {
private static final long serialVersionUID = 6928300709804576100L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/base/AttrInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/base/AttrInfo.java
index ca6ce7a750..c50f528a00 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/base/AttrInfo.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/base/AttrInfo.java
@@ -10,10 +10,12 @@
* 属性
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.base.AttrInfo}。
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
+@Deprecated
public class AttrInfo implements Serializable {
private static final long serialVersionUID = -790859309885311785L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/base/OffsetParam.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/base/OffsetParam.java
index ebfad1bf21..10dc30d7b3 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/base/OffsetParam.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/base/OffsetParam.java
@@ -12,11 +12,13 @@
* 偏移参数
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.base.OffsetParam}。
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@JsonInclude(Include.NON_NULL)
+@Deprecated
public class OffsetParam implements Serializable {
private static final long serialVersionUID = -1268796871980541662L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/base/PageParam.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/base/PageParam.java
index d76e48d3b6..dde4e6bc0c 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/base/PageParam.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/base/PageParam.java
@@ -10,10 +10,12 @@
* 分页参数
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.base.PageParam}。
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
+@Deprecated
public class PageParam implements Serializable {
private static final long serialVersionUID = -2606033044242617845L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/base/StreamPageParam.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/base/StreamPageParam.java
index 6f3fb76d71..0a1f02f83a 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/base/StreamPageParam.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/base/StreamPageParam.java
@@ -10,10 +10,12 @@
* 流式分页参数
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.base.StreamPageParam}。
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
+@Deprecated
public class StreamPageParam implements Serializable {
private static final long serialVersionUID = -4098060161712929196L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/base/TimeRange.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/base/TimeRange.java
index f681794835..39ae602166 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/base/TimeRange.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/base/TimeRange.java
@@ -9,9 +9,11 @@
* 时间范围
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.base.TimeRange}。
*/
@Data
@NoArgsConstructor
+@Deprecated
public class TimeRange implements Serializable {
private static final long serialVersionUID = -8149679871789511479L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/base/WxChannelBaseResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/base/WxChannelBaseResponse.java
index b20d7f4b33..36732574ed 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/base/WxChannelBaseResponse.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/base/WxChannelBaseResponse.java
@@ -8,7 +8,9 @@
* 视频号小店 基础响应
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.base.WxStoreBaseResponse}。
*/
+@Deprecated
public class WxChannelBaseResponse implements Serializable {
private static final long serialVersionUID = 3141420881984171781L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/brand/BasicBrand.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/brand/BasicBrand.java
index 714740f843..63e366943d 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/brand/BasicBrand.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/brand/BasicBrand.java
@@ -9,9 +9,11 @@
* 基础品牌信息
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.brand.BasicBrand}。
*/
@Data
@NoArgsConstructor
+@Deprecated
public class BasicBrand implements Serializable {
private static final long serialVersionUID = -1991771439710177859L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/brand/Brand.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/brand/Brand.java
index 92f4f41acc..37ad02c4af 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/brand/Brand.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/brand/Brand.java
@@ -10,11 +10,13 @@
* 品牌信息
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.brand.Brand}。
*/
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
+@Deprecated
public class Brand extends BasicBrand {
private static final long serialVersionUID = 4648597514861057019L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/brand/BrandApplicationDetail.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/brand/BrandApplicationDetail.java
index 48575f27cd..ebdbb27e9e 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/brand/BrandApplicationDetail.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/brand/BrandApplicationDetail.java
@@ -10,9 +10,11 @@
* 商标申请信息
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.brand.BrandApplicationDetail}。
*/
@Data
@NoArgsConstructor
+@Deprecated
public class BrandApplicationDetail implements Serializable {
private static final long serialVersionUID = 2145344855482129473L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/brand/BrandApplyListResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/brand/BrandApplyListResponse.java
index 16e7f3ae82..7530bd0c78 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/brand/BrandApplyListResponse.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/brand/BrandApplyListResponse.java
@@ -11,10 +11,12 @@
* 品牌申请列表响应
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.brand.BrandApplyListResponse}。
*/
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
+@Deprecated
public class BrandApplyListResponse extends WxChannelBaseResponse {
private static final long serialVersionUID = 243021267020609148L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/brand/BrandGrantDetail.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/brand/BrandGrantDetail.java
index 6b4826fcd4..4f90819308 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/brand/BrandGrantDetail.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/brand/BrandGrantDetail.java
@@ -10,9 +10,11 @@
* 商标授权信息
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.brand.BrandGrantDetail}。
*/
@Data
@NoArgsConstructor
+@Deprecated
public class BrandGrantDetail implements Serializable {
private static final long serialVersionUID = 3537812707384823606L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/brand/BrandInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/brand/BrandInfo.java
index 799002369d..f7dd7c485d 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/brand/BrandInfo.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/brand/BrandInfo.java
@@ -10,10 +10,12 @@
* 品牌信息
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.brand.BrandInfo}。
*/
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
+@Deprecated
public class BrandInfo extends Brand {
private static final long serialVersionUID = 5464505958132626159L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/brand/BrandInfoResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/brand/BrandInfoResponse.java
index 20536b5a07..573923e209 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/brand/BrandInfoResponse.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/brand/BrandInfoResponse.java
@@ -10,10 +10,12 @@
* 品牌响应
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.brand.BrandInfoResponse}。
*/
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
+@Deprecated
public class BrandInfoResponse extends WxChannelBaseResponse {
private static final long serialVersionUID = 2105745692451683517L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/brand/BrandListResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/brand/BrandListResponse.java
index c6cff6f317..4b48368e04 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/brand/BrandListResponse.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/brand/BrandListResponse.java
@@ -11,10 +11,12 @@
* 品牌列表响应
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.brand.BrandListResponse}。
*/
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
+@Deprecated
public class BrandListResponse extends WxChannelBaseResponse {
private static final long serialVersionUID = -5335449078706304920L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/brand/BrandParam.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/brand/BrandParam.java
index 05f8d89b42..872dba2409 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/brand/BrandParam.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/brand/BrandParam.java
@@ -11,11 +11,13 @@
* 品牌参数
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.brand.BrandParam}。
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@JsonInclude(JsonInclude.Include.NON_NULL)
+@Deprecated
public class BrandParam implements Serializable {
private static final long serialVersionUID = -4894709391464428613L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/brand/BrandRegisterDetail.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/brand/BrandRegisterDetail.java
index 28b417f38c..744b521fd8 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/brand/BrandRegisterDetail.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/brand/BrandRegisterDetail.java
@@ -10,9 +10,11 @@
* 品牌注册信息
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.brand.BrandRegisterDetail}。
*/
@Data
@NoArgsConstructor
+@Deprecated
public class BrandRegisterDetail implements Serializable {
private static final long serialVersionUID = 1169957179510362405L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/brand/BrandSearchParam.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/brand/BrandSearchParam.java
index e73ed4f54e..e472d03879 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/brand/BrandSearchParam.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/brand/BrandSearchParam.java
@@ -10,10 +10,12 @@
* 品牌搜索参数
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.brand.BrandSearchParam}。
*/
@Data
@EqualsAndHashCode(callSuper = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
+@Deprecated
public class BrandSearchParam extends StreamPageParam {
private static final long serialVersionUID = 5961201403338269712L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/category/AccountCategoryResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/category/AccountCategoryResponse.java
index 3db7c74cec..ebcd0b5cf1 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/category/AccountCategoryResponse.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/category/AccountCategoryResponse.java
@@ -11,10 +11,12 @@
* 分类响应
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.category.AccountCategoryResponse}。
*/
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
+@Deprecated
public class AccountCategoryResponse extends WxChannelBaseResponse {
private static final long serialVersionUID = 3486089711447908477L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/category/CategoryAndQualificationList.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/category/CategoryAndQualificationList.java
index c9e973c8b8..ad163fad7a 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/category/CategoryAndQualificationList.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/category/CategoryAndQualificationList.java
@@ -10,9 +10,11 @@
* 分类资质响应
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.category.CategoryAndQualificationList}。
*/
@Data
@NoArgsConstructor
+@Deprecated
public class CategoryAndQualificationList implements Serializable {
private static final long serialVersionUID = 4245906598437404655L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/category/CategoryDetailResult.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/category/CategoryDetailResult.java
index 8819e94312..44bc6bbc27 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/category/CategoryDetailResult.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/category/CategoryDetailResult.java
@@ -9,9 +9,11 @@
/**
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.category.CategoryDetailResult}。
*/
@Data
@NoArgsConstructor
+@Deprecated
public class CategoryDetailResult extends WxChannelBaseResponse {
private static final long serialVersionUID = 4657778764371047619L;
@@ -22,6 +24,9 @@ public class CategoryDetailResult extends WxChannelBaseResponse {
@JsonProperty("attr")
private Attr attr;
+ @JsonProperty("product_qua_list")
+ private List productQuaList;
+
@Data
@NoArgsConstructor
@@ -74,6 +79,38 @@ public static class Attr implements Serializable {
/** 佣金信息 */
@JsonProperty("transactionfee_info")
private FeeInfo feeInfo;
+
+ /** 折扣规则 */
+ @JsonProperty("coupon_rule")
+ private CouponRule couponRule;
+
+ /** 价格下限,单位分,商品售价不可低于此价格 */
+ @JsonProperty("floor_price")
+ private Long floorPrice;
+
+ /** 收货时间选项 */
+ @JsonProperty("confirm_receipt_days")
+ private List confirmReceiptDays;
+
+ /** 是否品牌定向准入,即该类目一定要有品牌 */
+ @JsonProperty("is_limit_brand")
+ private Boolean limitBrand;
+
+ /** 商品编辑要求 */
+ @JsonProperty("product_requirement")
+ private ProductRequirement productRequirement;
+
+ /** 尺码表 */
+ @JsonProperty("size_chart")
+ private SizeChart sizeChart;
+
+ /** 放心买必须打开坏损包赔 */
+ @JsonProperty("is_confidence_require_bad_must_pay")
+ private Boolean confidenceRequireBadMustPay;
+
+ /** 资质信息 */
+ @JsonProperty("product_qua_list")
+ private List productQuaList;
}
@Data
@@ -93,11 +130,27 @@ public static class ProductAttr implements Serializable {
@JsonProperty("name")
private String name;
- /** 类目必填项类型,string为自定义,select_one为多选一 */
+ /** 属性类型,string为自定义,select_one为多选一,该参数短期保留,用于兼容。将来废弃,使用type_v2替代 */
@JsonProperty("type")
private String type;
- /** 类目必填项值 */
+ /**
+ * 属性类型v2,共7种类型
+ * string:文本
+ * select_one:单选,选项列表在value中
+ * select_many:多选,选项列表在value中
+ * integer:整数,数字必须为整数
+ * decimal4:小数(4 位精度),小数部分最多 4 位
+ * integer_unit:整数 + 单位,单位的选项列表在value中
+ * decimal4_unit:小数(4 位精度) + 单位,单位的选项列表在value中
+ */
+ @JsonProperty("type_v2")
+ private String typeV2;
+
+ /**
+ * 可选项列表,当type为:select_one/select_many时,为选项列表
+ * 当type为:integer_unit/decimal4_unit时,为单位的列表
+ */
@JsonProperty("value")
private String value;
@@ -105,7 +158,13 @@ public static class ProductAttr implements Serializable {
@JsonProperty("is_required")
private Boolean required;
+ /** 输入提示,请填写提示语 */
+ @JsonProperty("hint")
+ private String hint;
+ /** 允许添加选项,当type为select_one/select_many时,标识是否允许添加新选项(value中不存在的选项) */
+ @JsonProperty("append_allowed")
+ private Boolean appendAllowed;
}
@Data
@@ -123,8 +182,78 @@ public static class FeeInfo implements Serializable {
/** 佣金激励类型,0:无激励措施,1:新店佣金减免 */
@JsonProperty("incentive_type")
private Integer incentiveType;
+ }
+
+ @Data
+ @NoArgsConstructor
+ public static class CouponRule implements Serializable {
+
+ /** 最高的折扣比例,百分比, 0表示无限制 */
+ @JsonProperty("discount_ratio_limit")
+ private Integer supportCoupon;
+
+ /** 最高的折扣金额,单位分,0表示无限制 */
+ @JsonProperty("discount_limit")
+ private Integer couponType;
+ }
+
+ @Data
+ @NoArgsConstructor
+ public static class ProductRequirement implements Serializable {
+ /** 商品标题的编辑要求 */
+ @JsonProperty("product_title_requirement")
+ private String productTitleRequirement;
+
+ /** 商品主图的编辑要求 */
+ @JsonProperty("product_img_requirement")
+ private String productImgRequirement;
+
+ /** 商品描述的编辑要求 */
+ @JsonProperty("product_desc_requirement")
+ private String productDescRequirement;
+ }
+ @Data
+ @NoArgsConstructor
+ public static class SizeChart implements Serializable {
+
+ /** 是否支持尺码表 */
+ @JsonProperty("is_support")
+ private Boolean support;
+
+ /** 尺码配置要求列表 */
+ @JsonProperty("item_list")
+ private List itemList;
+ }
+
+ @Data
+ @NoArgsConstructor
+ public static class SizeChartItem implements Serializable {
+ /** 尺码属性名称 */
+ @JsonProperty("name")
+ private String name;
+
+ /** 尺码属性值的单位 */
+ @JsonProperty("unit")
+ private String unit;
+
+ /** 尺码属性值的类型,1:字符型,2:整数型,3:小数型 */
+ @JsonProperty("type")
+ private String type;
+
+ /** 尺码属性值的填写格式,1:单值填写,2:区间值填写,3:支持单值或区间值 */
+ @JsonProperty("format")
+ private String format;
+
+ /** 尺码属性值的限制 */
+ @JsonProperty("limit")
+ private String limit;
+
+ /** 是否必填 */
+ @JsonProperty("is_required")
+ private Boolean required;
}
+
}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/category/CategoryQualification.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/category/CategoryQualification.java
index f384eaae45..75b39381e9 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/category/CategoryQualification.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/category/CategoryQualification.java
@@ -2,6 +2,7 @@
import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable;
+import java.util.List;
import lombok.Data;
import lombok.NoArgsConstructor;
@@ -9,9 +10,11 @@
* 分类资质信息
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.category.CategoryQualification}。
*/
@Data
@NoArgsConstructor
+@Deprecated
public class CategoryQualification implements Serializable {
private static final long serialVersionUID = 6495550078851408381L;
@@ -24,8 +27,26 @@ public class CategoryQualification implements Serializable {
@JsonProperty("qua")
private QualificationInfo info;
- /** 商品资质信息 */
+ /** 商品资质信息,将废弃,使用product_qua_list代替 */
@JsonProperty("product_qua")
+ @Deprecated
private QualificationInfo productInfo;
+ /**
+ * 品牌资质信息。
+ *
+ * @deprecated 微信接口仍返回该字段,暂未提供替代字段。
+ */
+ @JsonProperty("brand_qua")
+ @Deprecated
+ private QualificationInfo brandQua;
+
+ /** 商品资质列表,替代product_qua */
+ @JsonProperty("product_qua_list")
+ private List productQuaList;
+
+ /** 放心买必须打开坏损包赔 */
+ @JsonProperty("is_confidence_require_bad_must_pay")
+ private Boolean confidenceRequireBadMustPay;
+
}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/category/CategoryQualificationResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/category/CategoryQualificationResponse.java
index 984a3ad79b..1ac37c98a2 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/category/CategoryQualificationResponse.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/category/CategoryQualificationResponse.java
@@ -11,10 +11,12 @@
* 分类资质响应
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.category.CategoryQualificationResponse}。
*/
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
+@Deprecated
public class CategoryQualificationResponse extends WxChannelBaseResponse {
private static final long serialVersionUID = -7869091908852685830L;
@@ -22,4 +24,7 @@ public class CategoryQualificationResponse extends WxChannelBaseResponse {
@JsonProperty("cats")
private List list;
+ @JsonProperty("cats_v2")
+ private List catsV2;
+
}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/category/PassCategoryInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/category/PassCategoryInfo.java
index 82b16c0188..e51e96d019 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/category/PassCategoryInfo.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/category/PassCategoryInfo.java
@@ -9,9 +9,11 @@
* 审核通过的分类和资质信息
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.category.PassCategoryInfo}。
*/
@Data
@NoArgsConstructor
+@Deprecated
public class PassCategoryInfo implements Serializable {
private static final long serialVersionUID = 1152077957498898216L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/category/PassCategoryResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/category/PassCategoryResponse.java
index af6f484254..fe8effa7af 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/category/PassCategoryResponse.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/category/PassCategoryResponse.java
@@ -3,6 +3,7 @@
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
import lombok.Data;
+import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
@@ -10,9 +11,12 @@
* 审核通过的分类和资质信息
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.category.PassCategoryResponse}。
*/
@Data
@NoArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+@Deprecated
public class PassCategoryResponse extends WxChannelBaseResponse {
private static final long serialVersionUID = -3674591447273025743L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/category/QualificationInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/category/QualificationInfo.java
index 197ac46528..fee3fddfbe 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/category/QualificationInfo.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/category/QualificationInfo.java
@@ -9,9 +9,11 @@
* 资质信息
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.category.QualificationInfo}。
*/
@Data
@NoArgsConstructor
+@Deprecated
public class QualificationInfo implements Serializable {
/** 资质ID */
@@ -29,4 +31,8 @@ public class QualificationInfo implements Serializable {
/** 该类目申请的时候是否一定要提交资质 */
@JsonProperty("mandatory")
private Boolean mandatory;
+
+ /** 资质名称 */
+ @JsonProperty("name")
+ private String name;
}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/category/RelationCategoryItem.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/category/RelationCategoryItem.java
new file mode 100644
index 0000000000..3579fc11c3
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/category/RelationCategoryItem.java
@@ -0,0 +1,43 @@
+package me.chanjar.weixin.channel.bean.category;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+/**
+ * 店铺类目权限列表项
+ *
+ * @author chucheng
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.category.RelationCategoryItem}。
+ */
+@Data
+@NoArgsConstructor
+@Deprecated
+public class RelationCategoryItem implements Serializable {
+
+ /** 类目id */
+ @JsonProperty("id")
+ private Long id;
+
+ /** 类目状态, 1生效中,2已失效 */
+ @JsonProperty("status")
+ private Integer status;
+
+ /** 失效原因 */
+ @JsonProperty("uneffective_reason")
+ private String uneffectiveReason;
+
+ /** 生效时间 */
+ @JsonProperty("effective_time")
+ private Long effectiveTime;
+
+ /** 失效时间 */
+ @JsonProperty("uneffective_time")
+ private Long uneffectiveTime;
+
+ /** 类目资质id */
+ @JsonProperty("qua_id")
+ private Long quaId;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/category/RelationCategoryRequest.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/category/RelationCategoryRequest.java
new file mode 100644
index 0000000000..ef73e59515
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/category/RelationCategoryRequest.java
@@ -0,0 +1,30 @@
+package me.chanjar.weixin.channel.bean.category;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.Serializable;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 类目权限列表请求参数
+ *
+ * @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.category.RelationCategoryRequest}。
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@Deprecated
+public class RelationCategoryRequest implements Serializable {
+
+ private static final long serialVersionUID = -8765432109876543210L;
+
+ /** 是否按状态筛选 */
+ @JsonProperty("is_filter_status")
+ private Boolean isFilterStatus;
+
+ /** 类目状态(当 isFilterStatus 为 true 时有效) */
+ @JsonProperty("status")
+ private Integer status;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/category/RelationCategoryResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/category/RelationCategoryResponse.java
new file mode 100644
index 0000000000..64e4f67186
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/category/RelationCategoryResponse.java
@@ -0,0 +1,27 @@
+package me.chanjar.weixin.channel.bean.category;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.List;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
+
+/**
+ * 店铺的类目权限列表响应
+ *
+ * @author chucheng
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.category.RelationCategoryResponse}。
+ */
+@Data
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+@Deprecated
+public class RelationCategoryResponse extends WxChannelBaseResponse {
+
+ private static final long serialVersionUID = -8473920857463918245L;
+
+ @JsonProperty("list")
+ private List list;
+
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/category/ShopCategory.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/category/ShopCategory.java
index b36edfa9e2..5154efec3b 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/category/ShopCategory.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/category/ShopCategory.java
@@ -9,9 +9,11 @@
* 商品类目
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.category.ShopCategory}。
*/
@Data
@NoArgsConstructor
+@Deprecated
public class ShopCategory implements Serializable {
/** 类目ID */
@@ -29,4 +31,8 @@ public class ShopCategory implements Serializable {
/** 层级 */
@JsonProperty("level")
private Integer level;
+
+ /** 是否为叶子类目(品类) */
+ @JsonProperty("leaf")
+ private Boolean leaf;
}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/category/ShopCategoryResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/category/ShopCategoryResponse.java
index 2af64ad1c3..ca31e49dfe 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/category/ShopCategoryResponse.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/category/ShopCategoryResponse.java
@@ -11,10 +11,12 @@
* 分类响应
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.category.ShopCategoryResponse}。
*/
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
+@Deprecated
public class ShopCategoryResponse extends WxChannelBaseResponse {
private static final long serialVersionUID = 3871098948660947422L;
@@ -23,5 +25,7 @@ public class ShopCategoryResponse extends WxChannelBaseResponse {
@JsonProperty("cat_list")
private List categories;
-
+ /** 类目列表 */
+ @JsonProperty("cat_list_v2")
+ private List catListV2;
}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/CompassFinderBaseParam.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/CompassFinderBaseParam.java
new file mode 100644
index 0000000000..a1d5e277cc
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/CompassFinderBaseParam.java
@@ -0,0 +1,30 @@
+package me.chanjar.weixin.channel.bean.compass;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+/**
+ * 获取达人罗盘数据通用请求参数
+ *
+ * @author Winnie
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class CompassFinderBaseParam implements Serializable {
+
+ private static final long serialVersionUID = - 4900361041041434435L;
+
+ /**
+ * 日期,格式 yyyyMMdd
+ */
+ @JsonProperty("ds")
+ private String ds;
+
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/finder/Field.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/finder/Field.java
new file mode 100644
index 0000000000..a23cde1878
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/finder/Field.java
@@ -0,0 +1,33 @@
+package me.chanjar.weixin.channel.bean.compass.finder;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * 维度数据
+ *
+ * @author Winnie
+ */
+@Data
+@NoArgsConstructor
+public class Field implements Serializable {
+
+ private static final long serialVersionUID = - 4243469984232948689L;
+
+ /**
+ * 维度类别名
+ */
+ @JsonProperty("field_name")
+ private String fieldName;
+
+ /**
+ * 维度指标数据列表
+ */
+ @JsonProperty("data_list")
+ private List dataList;
+
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/finder/FieldData.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/finder/FieldData.java
new file mode 100644
index 0000000000..a8b82c8326
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/finder/FieldData.java
@@ -0,0 +1,32 @@
+package me.chanjar.weixin.channel.bean.compass.finder;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+/**
+ * 维度指标数据
+ *
+ * @author Winnie
+ */
+@Data
+@NoArgsConstructor
+public class FieldData implements Serializable {
+
+ private static final long serialVersionUID = - 4022953139259283599L;
+
+ /**
+ * 维度指标名
+ */
+ @JsonProperty("dim_key")
+ private String dimKey;
+
+ /**
+ * 维度指标值
+ */
+ @JsonProperty("dim_value")
+ private String dimValue;
+
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/finder/Overall.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/finder/Overall.java
new file mode 100644
index 0000000000..ab77df0f97
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/finder/Overall.java
@@ -0,0 +1,56 @@
+package me.chanjar.weixin.channel.bean.compass.finder;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+/**
+ * 电商概览数据
+ *
+ * @author Winnie
+ */
+@Data
+@NoArgsConstructor
+public class Overall implements Serializable {
+
+ private static final long serialVersionUID = 2456038666608345011L;
+
+ /**
+ * 成交金额,单位分
+ */
+ @JsonProperty("pay_gmv")
+ private String payGmv;
+
+ /**
+ * 直播成交金额,单位分
+ */
+ @JsonProperty("live_pay_gmv")
+ private String livePayGmv;
+
+ /**
+ * 短视频成交金额,单位分
+ */
+ @JsonProperty("feed_pay_gmv")
+ private String feedPayGmv;
+
+ /**
+ * 橱窗成交金额,单位分
+ */
+ @JsonProperty("window_pay_gmv")
+ private String windowPayGmv;
+
+ /**
+ * 商品分享支付金额,单位分
+ */
+ @JsonProperty("product_pay_gmv")
+ private String productPayGmv;
+
+ /**
+ * 其他渠道成交金额,单位分
+ */
+ @JsonProperty("other_pay_gmv")
+ private String otherPayGmv;
+
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/finder/OverallResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/finder/OverallResponse.java
new file mode 100644
index 0000000000..8331726c13
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/finder/OverallResponse.java
@@ -0,0 +1,27 @@
+package me.chanjar.weixin.channel.bean.compass.finder;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
+
+/**
+ * 获取电商概览数据响应
+ *
+ * @author Winnie
+ */
+@Data
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+public class OverallResponse extends WxChannelBaseResponse {
+
+ private static final long serialVersionUID = 6350218415876820956L;
+
+ /**
+ * 电商概览数据
+ */
+ @JsonProperty("data")
+ private Overall data;
+
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/finder/ProductCompassData.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/finder/ProductCompassData.java
new file mode 100644
index 0000000000..d84c8d367b
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/finder/ProductCompassData.java
@@ -0,0 +1,170 @@
+package me.chanjar.weixin.channel.bean.compass.finder;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+/**
+ * 商品罗盘数据
+ *
+ * @author Winnie
+ */
+@Data
+@NoArgsConstructor
+public class ProductCompassData implements Serializable {
+
+ private static final long serialVersionUID = - 1009289493985863096L;
+
+ /**
+ * 成交金额
+ */
+ @JsonProperty("pay_gmv")
+ private String payGmv;
+
+ /**
+ * 下单金额(单位:分)
+ */
+ @JsonProperty("create_gmv")
+ private String createGmv;
+
+ /**
+ * 下单订单数
+ */
+ @JsonProperty("create_cnt")
+ private String createCnt;
+
+ /**
+ * 下单人数
+ */
+ @JsonProperty("create_uv")
+ private String createUv;
+
+ /**
+ * 下单件数
+ */
+ @JsonProperty("create_product_cnt")
+ private String createProductCnt;
+
+ /**
+ * 成交订单数
+ */
+ @JsonProperty("pay_cnt")
+ private String payCnt;
+
+ /**
+ * 成交人数
+ */
+ @JsonProperty("pay_uv")
+ private String payUv;
+
+ /**
+ * 成交件数
+ */
+ @JsonProperty("pay_product_cnt")
+ private String payProductCnt;
+
+ /**
+ * 成交金额(剔除退款)(单位:分)
+ */
+ @JsonProperty("pure_pay_gmv")
+ private String purePayGmv;
+
+ /**
+ * 成交客单价(单位:分)
+ */
+ @JsonProperty("pay_gmv_per_uv")
+ private String payGmvPerUv;
+
+ /**
+ * 实际结算金额(单位:分)
+ */
+ @JsonProperty("actual_commission")
+ private String actualCommission;
+
+ /**
+ * 预估佣金金额(单位:分)
+ */
+ @JsonProperty("predict_commission")
+ private String predictCommission;
+
+ /**
+ * 商品点击人数
+ */
+ @JsonProperty("product_click_uv")
+ private String productClickUv;
+
+ /**
+ * 商品点击次数
+ */
+ @JsonProperty("product_click_cnt")
+ private String productClickCnt;
+
+ /**
+ * 成交退款金额
+ */
+ @JsonProperty("pay_refund_gmv")
+ private String payRefundGmv;
+
+ /**
+ * 成交退款人数
+ */
+ @JsonProperty("pay_refund_uv")
+ private String payRefundUv;
+
+ /**
+ * 成交退款率
+ */
+ @JsonProperty("pay_refund_ratio")
+ private Double payRefundRatio;
+
+ /**
+ * 发货后成交退款率
+ */
+ @JsonProperty("pay_refund_after_send_ratio")
+ private Double payRefundAfterSendRatio;
+
+ /**
+ * 成交退款订单数
+ */
+ @JsonProperty("pay_refund_cnt")
+ private String payRefundCnt;
+
+ /**
+ * 成交退款件数
+ */
+ @JsonProperty("pay_refund_product_cnt")
+ private String payRefundProductCnt;
+
+ /**
+ * 发货前成交退款率
+ */
+ @JsonProperty("pay_refund_before_send_ratio")
+ private Double payRefundBeforeSendRatio;
+
+ /**
+ * 退款金额(单位:分)
+ */
+ @JsonProperty("refund_gmv")
+ private String refundGmv;
+
+ /**
+ * 退款件数
+ */
+ @JsonProperty("refund_product_cnt")
+ private String refundProductCnt;
+
+ /**
+ * 退款订单数
+ */
+ @JsonProperty("refund_cnt")
+ private String refundCnt;
+
+ /**
+ * 退款人数
+ */
+ @JsonProperty("refund_uv")
+ private String refundUv;
+
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/finder/ProductDataParam.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/finder/ProductDataParam.java
new file mode 100644
index 0000000000..57a26a9794
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/finder/ProductDataParam.java
@@ -0,0 +1,34 @@
+package me.chanjar.weixin.channel.bean.compass.finder;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import me.chanjar.weixin.channel.bean.compass.CompassFinderBaseParam;
+
+/**
+ * 获取带货商品数据请求参数
+ *
+ * @author Winnie
+ */
+@Data
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class ProductDataParam extends CompassFinderBaseParam {
+
+ private static final long serialVersionUID = - 5016298274452168329L;
+
+ /**
+ * 商品id
+ */
+ @JsonProperty("product_id")
+ private String productId;
+
+ public ProductDataParam(String ds, String productId) {
+ super(ds);
+ this.productId = productId;
+ }
+
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/finder/ProductDataResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/finder/ProductDataResponse.java
new file mode 100644
index 0000000000..628e0cc221
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/finder/ProductDataResponse.java
@@ -0,0 +1,27 @@
+package me.chanjar.weixin.channel.bean.compass.finder;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
+
+/**
+ * 获取带货商品数据响应
+ *
+ * @author Winnie
+ */
+@Data
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+public class ProductDataResponse extends WxChannelBaseResponse {
+
+ private static final long serialVersionUID = 7264776818163943719L;
+
+ /**
+ * 带货商品数据
+ */
+ @JsonProperty("product_info")
+ private ProductInfo productInfo;
+
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/finder/ProductInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/finder/ProductInfo.java
new file mode 100644
index 0000000000..3d1071b261
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/finder/ProductInfo.java
@@ -0,0 +1,68 @@
+package me.chanjar.weixin.channel.bean.compass.finder;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+/**
+ * 带货商品数据
+ *
+ * @author Winnie
+ */
+@Data
+@NoArgsConstructor
+public class ProductInfo implements Serializable {
+
+ private static final long serialVersionUID = - 3347940276601700091L;
+
+ /**
+ * 商品id
+ */
+ @JsonProperty("product_id")
+ private String productId;
+
+ /**
+ * 商品头图
+ */
+ @JsonProperty("head_img_url")
+ private String headImgUrl;
+
+ /**
+ * 商品标题
+ */
+ @JsonProperty("title")
+ private String title;
+
+ /**
+ * 商品价格
+ */
+ @JsonProperty("price")
+ private String price;
+
+ /**
+ * 1级类目
+ */
+ @JsonProperty("first_category_id")
+ private String firstCategoryId;
+
+ /**
+ * 2级类目
+ */
+ @JsonProperty("second_category_id")
+ private String secondCategoryId;
+
+ /**
+ * 3级类目
+ */
+ @JsonProperty("third_category_id")
+ private String thirdCategoryId;
+
+ /**
+ * 商品罗盘数据
+ */
+ @JsonProperty("data")
+ private ProductCompassData data;
+
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/finder/ProductListResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/finder/ProductListResponse.java
new file mode 100644
index 0000000000..e327531305
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/finder/ProductListResponse.java
@@ -0,0 +1,29 @@
+package me.chanjar.weixin.channel.bean.compass.finder;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
+
+import java.util.List;
+
+/**
+ * 获取带货商品列表响应
+ *
+ * @author Winnie
+ */
+@Data
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+public class ProductListResponse extends WxChannelBaseResponse {
+
+ private static final long serialVersionUID = 7903039293558611066L;
+
+ /**
+ * 带货商品列表
+ */
+ @JsonProperty("product_list")
+ private List productList;
+
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/finder/SaleProfileData.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/finder/SaleProfileData.java
new file mode 100644
index 0000000000..379943903e
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/finder/SaleProfileData.java
@@ -0,0 +1,27 @@
+package me.chanjar.weixin.channel.bean.compass.finder;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * 带货人群数据
+ *
+ * @author Winnie
+ */
+@Data
+@NoArgsConstructor
+public class SaleProfileData implements Serializable {
+
+ private static final long serialVersionUID = - 5542602540358792014L;
+
+ /**
+ * 维度数据列表
+ */
+ @JsonProperty("field_list")
+ private List fieldList;
+
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/finder/SaleProfileDataParam.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/finder/SaleProfileDataParam.java
new file mode 100644
index 0000000000..abe4610785
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/finder/SaleProfileDataParam.java
@@ -0,0 +1,34 @@
+package me.chanjar.weixin.channel.bean.compass.finder;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import me.chanjar.weixin.channel.bean.compass.CompassFinderBaseParam;
+
+/**
+ * 获取带货人群数据请求参数
+ *
+ * @author Winnie
+ */
+@Data
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class SaleProfileDataParam extends CompassFinderBaseParam {
+
+ private static final long serialVersionUID = 4037843292285732855L;
+
+ /**
+ * 用户类型 {@link me.chanjar.weixin.channel.enums.SaleProfileUserType}
+ */
+ @JsonProperty("type")
+ private Integer type;
+
+ public SaleProfileDataParam(String ds, Integer type) {
+ super(ds);
+ this.type = type;
+ }
+
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/finder/SaleProfileDataResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/finder/SaleProfileDataResponse.java
new file mode 100644
index 0000000000..a976671ba0
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/finder/SaleProfileDataResponse.java
@@ -0,0 +1,27 @@
+package me.chanjar.weixin.channel.bean.compass.finder;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
+
+/**
+ * 获取带货人群数据响应
+ *
+ * @author Winnie
+ */
+@Data
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+public class SaleProfileDataResponse extends WxChannelBaseResponse {
+
+ private static final long serialVersionUID = - 6409722880191468272L;
+
+ /**
+ * 带货人群数据
+ */
+ @JsonProperty("data")
+ private SaleProfileData data;
+
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/CompassFinderIdParam.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/CompassFinderIdParam.java
new file mode 100644
index 0000000000..9383d2de2f
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/CompassFinderIdParam.java
@@ -0,0 +1,32 @@
+package me.chanjar.weixin.channel.bean.compass.shop;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import me.chanjar.weixin.channel.bean.compass.CompassFinderBaseParam;
+
+/**
+ * 带货达人 请求参数
+ *
+ * @author Zeyes
+ */
+@Data
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class CompassFinderIdParam extends CompassFinderBaseParam {
+
+ private static final long serialVersionUID = 9214560943091074780L;
+
+ /** 视频号ID */
+ @JsonProperty("finder_id")
+ private String finderId;
+
+ public CompassFinderIdParam(String ds, String finderId) {
+ super(ds);
+ this.finderId = finderId;
+ }
+
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/FinderAuthListResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/FinderAuthListResponse.java
new file mode 100644
index 0000000000..0f0351e975
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/FinderAuthListResponse.java
@@ -0,0 +1,30 @@
+package me.chanjar.weixin.channel.bean.compass.shop;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.List;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
+
+/**
+ * 获取授权视频号列表 响应
+ *
+ * @author Zeyes
+ */
+@Data
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+public class FinderAuthListResponse extends WxChannelBaseResponse {
+
+ private static final long serialVersionUID = -3215073536002857589L;
+
+ /** 主营视频号id */
+ @JsonProperty("main_finder_id")
+ private String mainFinderId;
+
+ /** 授权视频号id列表 */
+ @JsonProperty("authorized_finder_id_list")
+ private List authorizedFinderIdList;
+
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/FinderGmvData.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/FinderGmvData.java
new file mode 100644
index 0000000000..822f93c4f0
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/FinderGmvData.java
@@ -0,0 +1,39 @@
+package me.chanjar.weixin.channel.bean.compass.shop;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 带货达人数据
+ *
+ * @author Zeyes
+ */
+@Data
+@NoArgsConstructor
+public class FinderGmvData implements Serializable {
+
+ private static final long serialVersionUID = -7463331971169286175L;
+
+ /** 成交金额,单位分 */
+ @JsonProperty("pay_gmv")
+ private String payGmv;
+
+ /** 动销商品数 */
+ @JsonProperty("pay_product_id_cnt")
+ private String payProductIdCnt;
+
+ /** 成交人数 */
+ @JsonProperty("pay_uv")
+ private String payUv;
+
+ /** 退款金额,单位分 */
+ @JsonProperty("refund_gmv")
+ private String refundGmv;
+
+ /** 成交退款金额,单位分 */
+ @JsonProperty("pay_refund_gmv")
+ private String payRefundGmv;
+
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/FinderGmvItem.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/FinderGmvItem.java
new file mode 100644
index 0000000000..a102732c8a
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/FinderGmvItem.java
@@ -0,0 +1,30 @@
+package me.chanjar.weixin.channel.bean.compass.shop;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 带货达人列表数据
+ *
+ * @author Zeyes
+ */
+@Data
+@NoArgsConstructor
+public class FinderGmvItem implements Serializable {
+
+ private static final long serialVersionUID = -3740996985044711599L;
+
+ /** 视频号id */
+ @JsonProperty("finder_id")
+ private String finderId;
+
+ /** 视频号昵称 */
+ @JsonProperty("finder_nickname")
+ private String finderNickname;
+
+ /** 带货达人数据 */
+ @JsonProperty("data")
+ private FinderGmvData data;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/FinderListResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/FinderListResponse.java
new file mode 100644
index 0000000000..a5a37d9a2f
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/FinderListResponse.java
@@ -0,0 +1,26 @@
+package me.chanjar.weixin.channel.bean.compass.shop;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.List;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
+
+/**
+ * 带货达人列表 响应
+ *
+ * @author Zeyes
+ */
+@Data
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+public class FinderListResponse extends WxChannelBaseResponse {
+
+ private static final long serialVersionUID = 6358992001065379269L;
+
+ /** 授权视频号id列表 */
+ @JsonProperty("finder_list")
+ private List finderList;
+
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/FinderOverallData.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/FinderOverallData.java
new file mode 100644
index 0000000000..6303202709
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/FinderOverallData.java
@@ -0,0 +1,35 @@
+package me.chanjar.weixin.channel.bean.compass.shop;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 带货数据概览
+ *
+ * @author Zeyes
+ */
+@Data
+@NoArgsConstructor
+public class FinderOverallData implements Serializable {
+
+ private static final long serialVersionUID = -994852668593815907L;
+
+ /** 成交金额,单位分 */
+ @JsonProperty("pay_gmv")
+ private String payGmv;
+
+ /** 动销达人数 */
+ @JsonProperty("pay_sales_finder_cnt")
+ private String paySalesFinderCnt;
+
+ /** 动销商品数 */
+ @JsonProperty("pay_product_id_cnt")
+ private String payProductIdCnt;
+
+ /** 点击-成交转化率 */
+ @JsonProperty("click_to_pay_uv_ratio")
+ private Double clickToPayUvRatio;
+
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/FinderOverallResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/FinderOverallResponse.java
new file mode 100644
index 0000000000..fdc83fcce8
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/FinderOverallResponse.java
@@ -0,0 +1,26 @@
+package me.chanjar.weixin.channel.bean.compass.shop;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
+
+/**
+ * 带货数据概览 响应
+ *
+ * @author Zeyes
+ */
+@Data
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+public class FinderOverallResponse extends WxChannelBaseResponse {
+
+ private static final long serialVersionUID = -4935555091396799318L;
+
+ /**
+ * 电商概览数据
+ */
+ @JsonProperty("data")
+ private FinderOverallData data;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/FinderProductListItem.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/FinderProductListItem.java
new file mode 100644
index 0000000000..7f6ad34445
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/FinderProductListItem.java
@@ -0,0 +1,66 @@
+package me.chanjar.weixin.channel.bean.compass.shop;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 带货达人商品列表
+ *
+ * @author Zeyes
+ */
+@Data
+@NoArgsConstructor
+public class FinderProductListItem implements Serializable {
+
+ private static final long serialVersionUID = 1646092488200992026L;
+
+ /** 商品id */
+ @JsonProperty("product_id")
+ private String productId;
+
+ /** 商品头图 */
+ @JsonProperty("head_img_url")
+ private String headImgUrl;
+
+ /** 商品标题 */
+ @JsonProperty("title")
+ private String title;
+
+ /** 商品价格 */
+ @JsonProperty("price")
+ private String price;
+
+ /** 商品1级类目 */
+ @JsonProperty("first_category_id")
+ private String firstCategoryId;
+
+ /** 商品2级类目 */
+ @JsonProperty("second_category_id")
+ private String secondCategoryId;
+
+ /** 商品3级类目 */
+ @JsonProperty("third_category_id")
+ private String thirdCategoryId;
+
+ /** gmv */
+ @JsonProperty("data")
+ private GmvData data;
+
+
+ @Data
+ @NoArgsConstructor
+ public static class GmvData implements Serializable {
+ private static final long serialVersionUID = 1840494188469233735L;
+
+ /** 佣金率 */
+ @JsonProperty("commission_ratio")
+ private Double commissionRatio;
+
+ /** 成交金额,单位分 */
+ @JsonProperty("pay_gmv")
+ private String payGmv;
+ }
+
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/FinderProductListResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/FinderProductListResponse.java
new file mode 100644
index 0000000000..bcdb1932d4
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/FinderProductListResponse.java
@@ -0,0 +1,28 @@
+package me.chanjar.weixin.channel.bean.compass.shop;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.List;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
+
+/**
+ * 带货达人商品列表 响应
+ *
+ * @author Zeyes
+ */
+@Data
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+public class FinderProductListResponse extends WxChannelBaseResponse {
+
+ private static final long serialVersionUID = 5883861777181983173L;
+
+ /**
+ * 带货达人商品列表
+ */
+ @JsonProperty("product_list")
+ private List productList;
+
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/FinderProductOverallResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/FinderProductOverallResponse.java
new file mode 100644
index 0000000000..e47223a4d8
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/FinderProductOverallResponse.java
@@ -0,0 +1,25 @@
+package me.chanjar.weixin.channel.bean.compass.shop;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
+
+/**
+ * 带货达人详情 响应
+ *
+ * @author Zeyes
+ */
+@Data
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+public class FinderProductOverallResponse extends WxChannelBaseResponse {
+
+ private static final long serialVersionUID = 6358992001065379269L;
+
+ /** 带货达人详情 */
+ @JsonProperty("data")
+ private FinderGmvData data;
+
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/FinderProductSimpleGmvData.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/FinderProductSimpleGmvData.java
new file mode 100644
index 0000000000..7a635dc4b0
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/FinderProductSimpleGmvData.java
@@ -0,0 +1,26 @@
+package me.chanjar.weixin.channel.bean.compass.shop;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 带货达人商品GMV数据
+ *
+ * @author Zeyes
+ */
+@Data
+@NoArgsConstructor
+public class FinderProductSimpleGmvData implements Serializable {
+ private static final long serialVersionUID = -3740996985044711599L;
+
+ /** 佣金率 */
+ @JsonProperty("commission_ratio")
+ private Double commissionRatio;
+
+ /** 成交金额,单位分 */
+ @JsonProperty("pay_gmv")
+ private String payGmv;
+
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopField.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopField.java
new file mode 100644
index 0000000000..4acd91ace0
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopField.java
@@ -0,0 +1,44 @@
+package me.chanjar.weixin.channel.bean.compass.shop;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.Serializable;
+import java.util.List;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 维度数据
+ *
+ * @author Zeyes
+ */
+@Data
+@NoArgsConstructor
+public class ShopField implements Serializable {
+
+ private static final long serialVersionUID = -8669197081350262569L;
+
+ /** 维度类别名 */
+ @JsonProperty("field_name")
+ private String fieldName;
+
+ /** 维度指标数据列表 */
+ @JsonProperty("data_list")
+ private List dataList;
+
+
+ @Data
+ @NoArgsConstructor
+ public static class FieldDetail implements Serializable {
+
+ private static final long serialVersionUID = 2900633035074950462L;
+
+ /** 维度指标名 */
+ @JsonProperty("dim_key")
+ private String dimKey;
+
+ /** 维度指标值 */
+ @JsonProperty("dim_value")
+ private String dimValue;
+
+ }
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopLiveData.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopLiveData.java
new file mode 100644
index 0000000000..d6a7b99451
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopLiveData.java
@@ -0,0 +1,36 @@
+package me.chanjar.weixin.channel.bean.compass.shop;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 店铺开播数据
+ *
+ * @author Zeyes
+ */
+@Data
+@NoArgsConstructor
+public class ShopLiveData implements Serializable {
+
+ /** 直播id */
+ @JsonProperty("live_id")
+ private String liveId;
+
+ /** 直播标题 */
+ @JsonProperty("live_title")
+ private String liveTitle;
+
+ /** 开播时间,unix时间戳 */
+ @JsonProperty("live_time")
+ private String liveTime;
+
+ /** 直播时长,单位秒 */
+ @JsonProperty("live_duration")
+ private String liveDuration;
+
+ /** 直播封面 */
+ @JsonProperty("live_cover_img_url")
+ private String liveCoverImgUrl;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopLiveListResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopLiveListResponse.java
new file mode 100644
index 0000000000..3ec9b68772
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopLiveListResponse.java
@@ -0,0 +1,26 @@
+package me.chanjar.weixin.channel.bean.compass.shop;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.List;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
+
+/**
+ * 店铺开播列表 响应
+ *
+ * @author Zeyes
+ */
+@Data
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+public class ShopLiveListResponse extends WxChannelBaseResponse {
+
+ private static final long serialVersionUID = -7110751559923117330L;
+
+ /** 店铺开播列表 */
+ @JsonProperty("live_list")
+ private List liveList;
+
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopOverall.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopOverall.java
new file mode 100644
index 0000000000..bf2fc8f42f
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopOverall.java
@@ -0,0 +1,42 @@
+package me.chanjar.weixin.channel.bean.compass.shop;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 电商概览数据
+ *
+ * @author Zeyes
+ */
+@Data
+@NoArgsConstructor
+public class ShopOverall implements Serializable {
+
+ private static final long serialVersionUID = 3304918097895132226L;
+
+ /** 成交金额,单位分 */
+ @JsonProperty("pay_gmv")
+ private String payGmv;
+
+ /** 成交人数 */
+ @JsonProperty("pay_uv")
+ private String payUv;
+
+ /** 成交退款金额,单位分 */
+ @JsonProperty("pay_refund_gmv")
+ private String payRefundGmv;
+
+ /** 成交订单数 */
+ @JsonProperty("pay_order_cnt")
+ private String payOrderCnt;
+
+ /** 直播成交金额,单位分 */
+ @JsonProperty("live_pay_gmv")
+ private String livePayGmv;
+
+ /** 短视频成交金额,单位分 */
+ @JsonProperty("feed_pay_gmv")
+ private String feedPayGmv;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopOverallResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopOverallResponse.java
new file mode 100644
index 0000000000..4b371454ca
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopOverallResponse.java
@@ -0,0 +1,27 @@
+package me.chanjar.weixin.channel.bean.compass.shop;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
+
+/**
+ * 获取电商概览数据响应
+ *
+ * @author Zeyes
+ */
+@Data
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+public class ShopOverallResponse extends WxChannelBaseResponse {
+
+ private static final long serialVersionUID = 1632800741359642057L;
+
+ /**
+ * 电商概览数据
+ */
+ @JsonProperty("data")
+ private ShopOverall data;
+
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopProductCompassData.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopProductCompassData.java
new file mode 100644
index 0000000000..03253e399e
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopProductCompassData.java
@@ -0,0 +1,143 @@
+package me.chanjar.weixin.channel.bean.compass.shop;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 店铺商品罗盘数据
+ *
+ * @author Zeyes
+ */
+@Data
+@NoArgsConstructor
+public class ShopProductCompassData implements Serializable {
+
+ private static final long serialVersionUID = 5387546181020447627L;
+
+ /** 成交金额 */
+ @JsonProperty("pay_gmv")
+ private String payGmv;
+
+ /**下单金额,单位分 */
+ @JsonProperty("create_gmv")
+ private String createGmv;
+
+ /** 下单订单数 */
+ @JsonProperty("create_cnt")
+ private String createCnt;
+
+ /** 下单人数 */
+ @JsonProperty("create_uv")
+ private String createUv;
+
+ /** 下单件数 */
+ @JsonProperty("create_product_cnt")
+ private String createProductCnt;
+
+ /** 成交订单数 */
+ @JsonProperty("pay_cnt")
+ private String payCnt;
+
+ /** 成交人数 */
+ @JsonProperty("pay_uv")
+ private String payUv;
+
+ /** 成交件数 */
+ @JsonProperty("pay_product_cnt")
+ private String payProductCnt;
+
+ /** 成交金额(剔除退款) */
+ @JsonProperty("pure_pay_gmv")
+ private String purePayGmv;
+
+ /** 成交客单价(剔除退款) */
+ @JsonProperty("pay_gmv_per_uv")
+ private String payGmvPerUv;
+
+ /** 实际结算金额,单位分 */
+ @JsonProperty("seller_actual_settle_amount")
+ private String sellerActualSettleAmount;
+
+ /** 实际服务费金额,单位分 */
+ @JsonProperty("platform_actual_commission")
+ private String platformActualCommission;
+
+ /** 实际达人佣金支出,单位分 */
+ @JsonProperty("finderuin_actual_commission")
+ private String finderuinActualCommission;
+
+ /** 实际团长佣金支出,单位分 */
+ @JsonProperty("captain_actual_commission")
+ private String captainActualCommission;
+
+ /** 预估结算金额,单位分 */
+ @JsonProperty("seller_predict_settle_amount")
+ private String sellerPredictSettleAmount;
+
+ /** 预估服务费金额,单位分 */
+ @JsonProperty("platform_predict_commission")
+ private String platformPredictCommission;
+
+ /** 预估达人佣金支出,单位分 */
+ @JsonProperty("finderuin_predict_commission")
+ private String finderuinPredictCommission;
+
+ /** 预估团长佣金支出,单位分 */
+ @JsonProperty("captain_predict_commission")
+ private String captainPredictCommission;
+
+ /** 商品点击人数 */
+ @JsonProperty("product_click_uv")
+ private String productClickUv;
+
+ /** 商品点击次数 */
+ @JsonProperty("product_click_cnt")
+ private String productClickCnt;
+
+ /** 成交退款金额,单位分 */
+ @JsonProperty("pay_refund_gmv")
+ private String payRefundGmv;
+
+ /** 成交退款人数,单位分 */
+ @JsonProperty("pay_refund_uv")
+ private String payRefundUv;
+
+ /** 成交退款率 */
+ @JsonProperty("pay_refund_ratio")
+ private Double payRefundRatio;
+
+ /** 发货后成交退款率 */
+ @JsonProperty("pay_refund_after_send_ratio")
+ private Double payRefundAfterSendRatio;
+
+ /** 成交退款订单数 */
+ @JsonProperty("pay_refund_cnt")
+ private String payRefundCnt;
+
+ /** 成交退款件数 */
+ @JsonProperty("pay_refund_product_cnt")
+ private String payRefundProductCnt;
+
+ /** 发货前成交退款率 */
+ @JsonProperty("pay_refund_before_send_ratio")
+ private Double payRefundBeforeSendRatio;
+
+ /** 退款金额,单位分 */
+ @JsonProperty("refund_gmv")
+ private String refundGmv;
+
+ /** 退款件数 */
+ @JsonProperty("refund_product_cnt")
+ private String refundProductCnt;
+
+ /** 退款订单数 */
+ @JsonProperty("refund_cnt")
+ private String refundCnt;
+
+ /** 退款人数 */
+ @JsonProperty("refund_uv")
+ private String refundUv;
+
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopProductDataParam.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopProductDataParam.java
new file mode 100644
index 0000000000..74d7306273
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopProductDataParam.java
@@ -0,0 +1,32 @@
+package me.chanjar.weixin.channel.bean.compass.shop;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import me.chanjar.weixin.channel.bean.compass.CompassFinderBaseParam;
+
+/**
+ * 商品数据 请求参数
+ *
+ * @author Zeyes
+ */
+@Data
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class ShopProductDataParam extends CompassFinderBaseParam {
+
+ private static final long serialVersionUID = - 5016298274452168329L;
+
+ /** 商品id */
+ @JsonProperty("product_id")
+ private String productId;
+
+ public ShopProductDataParam(String ds, String productId) {
+ super(ds);
+ this.productId = productId;
+ }
+
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopProductDataResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopProductDataResponse.java
new file mode 100644
index 0000000000..bd7a22d243
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopProductDataResponse.java
@@ -0,0 +1,26 @@
+package me.chanjar.weixin.channel.bean.compass.shop;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
+
+/**
+ * 商品详细信息 响应
+ *
+ * @author Zeyes
+ */
+@Data
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+public class ShopProductDataResponse extends WxChannelBaseResponse {
+
+ private static final long serialVersionUID = 6903392663954301579L;
+
+ /** 商品详细信息 */
+ @JsonProperty("product_info")
+ private ShopProductInfo productInfo;
+
+
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopProductInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopProductInfo.java
new file mode 100644
index 0000000000..1eb55eaa75
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopProductInfo.java
@@ -0,0 +1,51 @@
+package me.chanjar.weixin.channel.bean.compass.shop;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 店铺带货商品数据
+ *
+ * @author Zeyes
+ */
+@Data
+@NoArgsConstructor
+public class ShopProductInfo implements Serializable {
+
+ private static final long serialVersionUID = 3376047696301017643L;
+
+ /** 商品id */
+ @JsonProperty("product_id")
+ private String productId;
+
+ /** 商品图 */
+ @JsonProperty("head_img_url")
+ private String headImgUrl;
+
+ /** 商品标题 */
+ @JsonProperty("title")
+ private String title;
+
+ /** 商品价格,单位分 */
+ @JsonProperty("price")
+ private String price;
+
+ /** 商品一级类目 */
+ @JsonProperty("first_category_id")
+ private String firstCategoryId;
+
+ /** 商品二级类目 */
+ @JsonProperty("second_category_id")
+ private String secondCategoryId;
+
+ /** 商品三级类目 */
+ @JsonProperty("third_category_id")
+ private String thirdCategoryId;
+
+ /** 商品罗盘数据 */
+ @JsonProperty("data")
+ private ShopProductCompassData data;
+
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopProductListResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopProductListResponse.java
new file mode 100644
index 0000000000..258b8f5845
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopProductListResponse.java
@@ -0,0 +1,26 @@
+package me.chanjar.weixin.channel.bean.compass.shop;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.List;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
+
+/**
+ * 商品列表 响应
+ *
+ * @author Zeyes
+ */
+@Data
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+public class ShopProductListResponse extends WxChannelBaseResponse {
+
+ private static final long serialVersionUID = -6328224902770141045L;
+
+ /** 商品列表 */
+ @JsonProperty("product_list")
+ private List productList;
+
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopSaleProfileData.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopSaleProfileData.java
new file mode 100644
index 0000000000..23639c5356
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopSaleProfileData.java
@@ -0,0 +1,24 @@
+package me.chanjar.weixin.channel.bean.compass.shop;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.Serializable;
+import java.util.List;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 店铺人群数据
+ *
+ * @author Zeyes
+ */
+@Data
+@NoArgsConstructor
+public class ShopSaleProfileData implements Serializable {
+
+ private static final long serialVersionUID = -6825849811081728787L;
+
+ /** 维度数据列表 */
+ @JsonProperty("field_list")
+ private List fieldList;
+
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopSaleProfileDataParam.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopSaleProfileDataParam.java
new file mode 100644
index 0000000000..36cab13860
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopSaleProfileDataParam.java
@@ -0,0 +1,32 @@
+package me.chanjar.weixin.channel.bean.compass.shop;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import me.chanjar.weixin.channel.bean.compass.CompassFinderBaseParam;
+
+/**
+ * 获取带货人群数据请求参数
+ *
+ * @author Zeyes
+ */
+@Data
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class ShopSaleProfileDataParam extends CompassFinderBaseParam {
+
+ private static final long serialVersionUID = 240010632808576923L;
+
+ /** 用户类型 */
+ @JsonProperty("type")
+ private Integer type;
+
+ public ShopSaleProfileDataParam(String ds, Integer type) {
+ super(ds);
+ this.type = type;
+ }
+
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopSaleProfileDataResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopSaleProfileDataResponse.java
new file mode 100644
index 0000000000..a874cd6355
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopSaleProfileDataResponse.java
@@ -0,0 +1,25 @@
+package me.chanjar.weixin.channel.bean.compass.shop;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
+
+/**
+ * 店铺人群数据 响应
+ *
+ * @author Zeyes
+ */
+@Data
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+public class ShopSaleProfileDataResponse extends WxChannelBaseResponse {
+
+ private static final long serialVersionUID = 8520148855114842741L;
+
+ /** 店铺人群数据 */
+ @JsonProperty("data")
+ private ShopSaleProfileData data;
+
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/complaint/ComplaintHistory.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/complaint/ComplaintHistory.java
index 4570fdc615..f34da72f92 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/complaint/ComplaintHistory.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/complaint/ComplaintHistory.java
@@ -10,9 +10,11 @@
* 纠纷历史
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.complaint.ComplaintHistory}。
*/
@Data
@NoArgsConstructor
+@Deprecated
public class ComplaintHistory implements Serializable {
private static final long serialVersionUID = -4706637116597650133L;
@@ -26,7 +28,7 @@ public class ComplaintHistory implements Serializable {
/** 用户联系电话 */
@JsonProperty("phone_number")
- private Integer phoneNumber;
+ private String phoneNumber;
/** 相关文本内容 */
@JsonProperty("content")
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/complaint/ComplaintOrderResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/complaint/ComplaintOrderResponse.java
index a0a8ec1e18..5fc472bb7e 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/complaint/ComplaintOrderResponse.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/complaint/ComplaintOrderResponse.java
@@ -10,9 +10,11 @@
* 纠纷单响应
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.complaint.ComplaintOrderResponse}。
*/
@Data
@NoArgsConstructor
+@Deprecated
public class ComplaintOrderResponse extends WxChannelBaseResponse {
private static final long serialVersionUID = 1968530826349555367L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/complaint/ComplaintParam.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/complaint/ComplaintParam.java
index 0090348efe..925bbf3db6 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/complaint/ComplaintParam.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/complaint/ComplaintParam.java
@@ -12,11 +12,13 @@
* 纠纷单留言
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.complaint.ComplaintParam}。
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@JsonInclude(JsonInclude.Include.NON_NULL)
+@Deprecated
public class ComplaintParam implements Serializable {
private static final long serialVersionUID = 6146118590005718327L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/cooperation/CooperationData.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/cooperation/CooperationData.java
new file mode 100644
index 0000000000..8d825003e2
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/cooperation/CooperationData.java
@@ -0,0 +1,49 @@
+package me.chanjar.weixin.channel.bean.cooperation;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 合作账号信息
+ *
+ * @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.cooperation.CooperationData}。
+ */
+@Data
+@NoArgsConstructor
+@Deprecated
+public class CooperationData implements Serializable {
+
+ private static final long serialVersionUID = 3930010847236599458L;
+
+ /** 合作账号id 公众号: gh_开头id 小程序: appid */
+ @JsonProperty("sharer_id")
+ private String sharerId;
+
+ /** 邀请/合作账号状态 1已绑定 2已解绑 3邀请已拒绝 4邀请接受中 5邀请接受超时 6邀请接受失败 7邀请店铺取消 */
+ @JsonProperty("status")
+ private Integer status;
+
+ /** 合作账号名称 */
+ @JsonProperty("sharer_name")
+ private String sharerName;
+
+ /** 合作账号类型 2公众号 3小程序 */
+ @JsonProperty("sharer_type")
+ private Integer sharerType;
+
+ /** 接受绑定时间戳,ms */
+ @JsonProperty("bind_time")
+ private Long bindTime;
+
+ /** 用户拒绝时间戳,ms */
+ @JsonProperty("reject_time")
+ private Long rejectTime;
+
+ /** 商家取消时间戳,ms */
+ @JsonProperty("cancel_time")
+ private Long cancelTime;
+
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/cooperation/CooperationListResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/cooperation/CooperationListResponse.java
new file mode 100644
index 0000000000..b2f093e779
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/cooperation/CooperationListResponse.java
@@ -0,0 +1,27 @@
+package me.chanjar.weixin.channel.bean.cooperation;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.List;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
+
+/**
+ * 合作账号列表响应
+ *
+ * @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.cooperation.CooperationListResponse}。
+ */
+@Data
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+@Deprecated
+public class CooperationListResponse extends WxChannelBaseResponse {
+
+ private static final long serialVersionUID = 6998637882644598826L;
+
+ /** 合作账号列表 */
+ @JsonProperty("data_list")
+ private List dataList;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/cooperation/CooperationQrCode.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/cooperation/CooperationQrCode.java
new file mode 100644
index 0000000000..6f4d7cc9df
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/cooperation/CooperationQrCode.java
@@ -0,0 +1,25 @@
+package me.chanjar.weixin.channel.bean.cooperation;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 合作账号二维码数据
+ *
+ * @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.cooperation.CooperationQrCode}。
+ */
+@Data
+@NoArgsConstructor
+@Deprecated
+public class CooperationQrCode implements Serializable {
+
+ private static final long serialVersionUID = -7096916911986699150L;
+
+ /** base64编码后的图片数据 */
+ @JsonProperty("qrcode_base64")
+ private Integer qrCodeBase64;
+
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/cooperation/CooperationQrCodeResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/cooperation/CooperationQrCodeResponse.java
new file mode 100644
index 0000000000..b1f92059f5
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/cooperation/CooperationQrCodeResponse.java
@@ -0,0 +1,26 @@
+package me.chanjar.weixin.channel.bean.cooperation;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
+
+/**
+ * 合作账号二维码响应
+ *
+ * @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.cooperation.CooperationQrCodeResponse}。
+ */
+@Data
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+@Deprecated
+public class CooperationQrCodeResponse extends WxChannelBaseResponse {
+
+ private static final long serialVersionUID = 6998637882644598826L;
+
+ /** 合作账号二维码 */
+ @JsonProperty("data")
+ private CooperationQrCode data;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/cooperation/CooperationSharerParam.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/cooperation/CooperationSharerParam.java
new file mode 100644
index 0000000000..d93b96f90b
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/cooperation/CooperationSharerParam.java
@@ -0,0 +1,32 @@
+package me.chanjar.weixin.channel.bean.cooperation;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.Serializable;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 合作账号参数
+ *
+ * @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.cooperation.CooperationSharerParam}。
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@Deprecated
+public class CooperationSharerParam implements Serializable {
+
+ private static final long serialVersionUID = 5032621997764493109L;
+
+ /** 合作账号id */
+ @JsonProperty("sharer_id")
+ private String sharerId;
+
+ /** 合作账号类型 */
+ @JsonProperty("sharer_type")
+ private Integer sharerType;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/cooperation/CooperationStatus.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/cooperation/CooperationStatus.java
new file mode 100644
index 0000000000..84585cf45f
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/cooperation/CooperationStatus.java
@@ -0,0 +1,25 @@
+package me.chanjar.weixin.channel.bean.cooperation;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 合作账号状态
+ *
+ * @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.cooperation.CooperationStatus}。
+ */
+@Data
+@NoArgsConstructor
+@Deprecated
+public class CooperationStatus implements Serializable {
+
+ private static final long serialVersionUID = -7096916911986699150L;
+
+ /** 邀请/合作账号状态 1已绑定 2已解绑 3邀请已拒绝 4邀请接受中 5邀请接受超时 6邀请接受失败 7邀请店铺取消 */
+ @JsonProperty("status")
+ private Integer status;
+
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/cooperation/CooperationStatusResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/cooperation/CooperationStatusResponse.java
new file mode 100644
index 0000000000..3dd6496eb8
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/cooperation/CooperationStatusResponse.java
@@ -0,0 +1,26 @@
+package me.chanjar.weixin.channel.bean.cooperation;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
+
+/**
+ * 合作账号状态响应
+ *
+ * @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.cooperation.CooperationStatusResponse}。
+ */
+@Data
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+@Deprecated
+public class CooperationStatusResponse extends WxChannelBaseResponse {
+
+ private static final long serialVersionUID = 6998637882644598826L;
+
+ /** 合作账号状态 */
+ @JsonProperty("data")
+ private CooperationStatus data;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/AutoValidInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/AutoValidInfo.java
index 73c09def1e..10e6861add 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/AutoValidInfo.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/AutoValidInfo.java
@@ -9,9 +9,11 @@
* 自动生效信息
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.coupon.AutoValidInfo}。
*/
@Data
@NoArgsConstructor
+@Deprecated
public class AutoValidInfo implements Serializable {
private static final long serialVersionUID = 1702505613539861103L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/CouponDetailInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/CouponDetailInfo.java
index 34f76716f9..7b1c0b9623 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/CouponDetailInfo.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/CouponDetailInfo.java
@@ -9,10 +9,12 @@
* 优惠券信息
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.coupon.CouponDetailInfo}。
*/
@Data
@NoArgsConstructor
+@Deprecated
public class CouponDetailInfo implements Serializable {
private static final long serialVersionUID = 5994815232349181577L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/CouponIdInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/CouponIdInfo.java
index b787016a09..ef7b0322c4 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/CouponIdInfo.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/CouponIdInfo.java
@@ -10,10 +10,12 @@
* 优惠券id
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.coupon.CouponIdInfo}。
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
+@Deprecated
public class CouponIdInfo implements Serializable {
private static final long serialVersionUID = 6284609705855608275L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/CouponIdResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/CouponIdResponse.java
index 7556fa6f11..cb3e87b2d1 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/CouponIdResponse.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/CouponIdResponse.java
@@ -9,10 +9,12 @@
/**
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.coupon.CouponIdResponse}。
*/
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
+@Deprecated
public class CouponIdResponse extends WxChannelBaseResponse {
private static final long serialVersionUID = -3263189706802013651L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/CouponInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/CouponInfo.java
index cd247f9d71..760ec78c41 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/CouponInfo.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/CouponInfo.java
@@ -6,9 +6,11 @@
/**
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.coupon.CouponInfo}。
*/
@Data
@NoArgsConstructor
+@Deprecated
public class CouponInfo extends CouponIdInfo {
private static final long serialVersionUID = -5862063828870424262L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/CouponInfoResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/CouponInfoResponse.java
index 801843025e..3157df797a 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/CouponInfoResponse.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/CouponInfoResponse.java
@@ -8,10 +8,12 @@
/**
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.coupon.CouponInfoResponse}。
*/
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
+@Deprecated
public class CouponInfoResponse extends WxChannelBaseResponse {
private static final long serialVersionUID = 5261320058699488529L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/CouponListParam.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/CouponListParam.java
index 6c7fc03a6e..bc7047e472 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/CouponListParam.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/CouponListParam.java
@@ -12,10 +12,12 @@
* 获取优惠券ID列表接口的请求参数
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.coupon.CouponListParam}。
*/
@Data
@NoArgsConstructor
@JsonInclude(Include.NON_NULL)
+@Deprecated
public class CouponListParam implements Serializable {
private static final long serialVersionUID = 7123047113279657365L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/CouponListResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/CouponListResponse.java
index 66d6f63eef..18c1f3ea59 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/CouponListResponse.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/CouponListResponse.java
@@ -9,10 +9,12 @@
/**
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.coupon.CouponListResponse}。
*/
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
+@Deprecated
public class CouponListResponse extends WxChannelBaseResponse {
private static final long serialVersionUID = -5330296358041282751L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/CouponParam.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/CouponParam.java
index fa89b0a1e4..9c47e54530 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/CouponParam.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/CouponParam.java
@@ -9,10 +9,12 @@
* 优惠券参数
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.coupon.CouponParam}。
*/
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
+@Deprecated
public class CouponParam extends CouponIdInfo {
private static final long serialVersionUID = -3663331372622943337L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/CouponStatusParam.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/CouponStatusParam.java
index 405ad52400..64d58cbf08 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/CouponStatusParam.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/CouponStatusParam.java
@@ -7,10 +7,12 @@
/**
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.coupon.CouponStatusParam}。
*/
@Data
@EqualsAndHashCode(callSuper = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
+@Deprecated
public class CouponStatusParam extends CouponIdInfo {
private static final long serialVersionUID = -7108348049925634704L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/DiscountCondition.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/DiscountCondition.java
index e249455526..4cac13356e 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/DiscountCondition.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/DiscountCondition.java
@@ -10,9 +10,11 @@
* 折扣条件
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.coupon.DiscountCondition}。
*/
@Data
@NoArgsConstructor
+@Deprecated
public class DiscountCondition implements Serializable {
private static final long serialVersionUID = 3250293381093835082L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/DiscountInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/DiscountInfo.java
index 7988e47ce6..5c7efc1e1d 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/DiscountInfo.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/DiscountInfo.java
@@ -9,9 +9,11 @@
* 优惠信息
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.coupon.DiscountInfo}。
*/
@Data
@NoArgsConstructor
+@Deprecated
public class DiscountInfo implements Serializable {
private static final long serialVersionUID = 3660070880545144112L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/ExtInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/ExtInfo.java
index 69cf3dc073..1c36bebec2 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/ExtInfo.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/ExtInfo.java
@@ -9,9 +9,11 @@
* 额外信息
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.coupon.ExtInfo}。
*/
@Data
@NoArgsConstructor
+@Deprecated
public class ExtInfo implements Serializable {
private static final long serialVersionUID = 9053035437087423233L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/PromoteInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/PromoteInfo.java
index 75d48e6d3e..7cdb5c1d8a 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/PromoteInfo.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/PromoteInfo.java
@@ -9,9 +9,11 @@
* 推广信息
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.coupon.PromoteInfo}。
*/
@Data
@NoArgsConstructor
+@Deprecated
public class PromoteInfo implements Serializable {
private static final long serialVersionUID = -3030639750899957382L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/ReceiveInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/ReceiveInfo.java
index 9a602ac390..2f4c861843 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/ReceiveInfo.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/ReceiveInfo.java
@@ -9,9 +9,11 @@
* 领取信息
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.coupon.ReceiveInfo}。
*/
@Data
@NoArgsConstructor
+@Deprecated
public class ReceiveInfo implements Serializable {
private static final long serialVersionUID = 755956808504040633L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/StockInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/StockInfo.java
index 07aaf4a1ec..652440b82a 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/StockInfo.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/StockInfo.java
@@ -9,9 +9,11 @@
* 库存信息
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.coupon.StockInfo}。
*/
@Data
@NoArgsConstructor
+@Deprecated
public class StockInfo implements Serializable {
private static final long serialVersionUID = -6078383881065929862L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/UserCoupon.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/UserCoupon.java
index 06436a9e73..804ed8d93e 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/UserCoupon.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/UserCoupon.java
@@ -9,10 +9,12 @@
* 用户优惠券
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.coupon.UserCoupon}。
*/
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
+@Deprecated
public class UserCoupon extends UserCouponIdInfo {
private static final long serialVersionUID = -4777537717885622888L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/UserCouponIdInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/UserCouponIdInfo.java
index d68d881c98..8d9ef4a1d5 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/UserCouponIdInfo.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/UserCouponIdInfo.java
@@ -8,9 +8,11 @@
* 用户优惠券id
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.coupon.UserCouponIdInfo}。
*/
@Data
@NoArgsConstructor
+@Deprecated
public class UserCouponIdInfo extends CouponIdInfo {
private static final long serialVersionUID = -8285585134793264542L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/UserCouponIdParam.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/UserCouponIdParam.java
index aa2eb15421..9340f0fc90 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/UserCouponIdParam.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/UserCouponIdParam.java
@@ -6,8 +6,10 @@
/**
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.coupon.UserCouponIdParam}。
*/
@Data
+@Deprecated
public class UserCouponIdParam implements Serializable {
private static final long serialVersionUID = 3967276158727848348L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/UserCouponListParam.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/UserCouponListParam.java
index f14f5d7f6e..67963a72b8 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/UserCouponListParam.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/UserCouponListParam.java
@@ -8,11 +8,13 @@
/**
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.coupon.UserCouponListParam}。
*/
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
+@Deprecated
public class UserCouponListParam extends CouponListParam {
private static final long serialVersionUID = -1056132009327357435L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/UserCouponListResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/UserCouponListResponse.java
index 2c3582e678..5019c4f5d2 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/UserCouponListResponse.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/UserCouponListResponse.java
@@ -9,10 +9,12 @@
/**
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.coupon.UserCouponListResponse}。
*/
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
+@Deprecated
public class UserCouponListResponse extends WxChannelBaseResponse {
private static final long serialVersionUID = 5201633937239352879L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/UserCouponResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/UserCouponResponse.java
index aeb9d89afb..ab5fbc7b89 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/UserCouponResponse.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/UserCouponResponse.java
@@ -8,10 +8,12 @@
/**
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.coupon.UserCouponResponse}。
*/
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
+@Deprecated
public class UserCouponResponse extends WxChannelBaseResponse {
private static final long serialVersionUID = 1434098386857953234L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/UserExtInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/UserExtInfo.java
index 18962361ec..8b0ddc09a1 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/UserExtInfo.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/UserExtInfo.java
@@ -9,9 +9,11 @@
* 用户优惠券附加信息
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.coupon.UserExtInfo}。
*/
@Data
@NoArgsConstructor
+@Deprecated
public class UserExtInfo implements Serializable {
private static final long serialVersionUID = 8304922825230343409L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/ValidInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/ValidInfo.java
index 10df794324..b33a90667a 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/ValidInfo.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/coupon/ValidInfo.java
@@ -9,9 +9,11 @@
* 优惠券有效信息
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.coupon.ValidInfo}。
*/
@Data
@NoArgsConstructor
+@Deprecated
public class ValidInfo implements Serializable {
private static final long serialVersionUID = -4550516248380285635L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/delivery/DeliveryCompanyInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/delivery/DeliveryCompanyInfo.java
index 349d70cbb1..c9c3ca1986 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/delivery/DeliveryCompanyInfo.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/delivery/DeliveryCompanyInfo.java
@@ -9,9 +9,11 @@
* 快递公司信息
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.delivery.DeliveryCompanyInfo}。
*/
@Data
@NoArgsConstructor
+@Deprecated
public class DeliveryCompanyInfo implements Serializable {
private static final long serialVersionUID = 4225666604513570564L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/delivery/DeliveryCompanyResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/delivery/DeliveryCompanyResponse.java
index d74a9439ea..55745dd98c 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/delivery/DeliveryCompanyResponse.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/delivery/DeliveryCompanyResponse.java
@@ -10,9 +10,11 @@
* 快递公司列表响应
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.delivery.DeliveryCompanyResponse}。
*/
@Data
@NoArgsConstructor
+@Deprecated
public class DeliveryCompanyResponse extends WxChannelBaseResponse {
private static final long serialVersionUID = -7695903997951385166L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/delivery/DeliveryInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/delivery/DeliveryInfo.java
index 23ab8dad2c..fe7442a07c 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/delivery/DeliveryInfo.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/delivery/DeliveryInfo.java
@@ -10,9 +10,11 @@
* 物流信息
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.delivery.DeliveryInfo}。
*/
@Data
@NoArgsConstructor
+@Deprecated
public class DeliveryInfo implements Serializable {
private static final long serialVersionUID = -6205626967305385248L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/delivery/DeliverySendParam.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/delivery/DeliverySendParam.java
index f486032bc4..aa0125d9d1 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/delivery/DeliverySendParam.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/delivery/DeliverySendParam.java
@@ -13,11 +13,13 @@
* 订单发货信息
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.delivery.DeliverySendParam}。
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@JsonInclude(Include.NON_NULL)
+@Deprecated
public class DeliverySendParam implements Serializable {
private static final long serialVersionUID = 4555821308266899135L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/delivery/FreightProductInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/delivery/FreightProductInfo.java
index 2a7c7dd3c6..23e4aef3e3 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/delivery/FreightProductInfo.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/delivery/FreightProductInfo.java
@@ -10,9 +10,11 @@
* 包裹中商品信息
*
* @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.delivery.FreightProductInfo}。
*/
@Data
@NoArgsConstructor
+@Deprecated
public class FreightProductInfo implements Serializable {
private static final long serialVersionUID = -3751269707150372172L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/delivery/FreshInspectParam.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/delivery/FreshInspectParam.java
new file mode 100644
index 0000000000..bc0c4a959b
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/delivery/FreshInspectParam.java
@@ -0,0 +1,33 @@
+package me.chanjar.weixin.channel.bean.delivery;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonInclude.Include;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.Serializable;
+import java.util.List;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 商品打包信息 参数
+ *
+ * @author Zeyes
+ * @deprecated 请迁移至 {@link com.binarywang.wxjava.store.bean.delivery.FreshInspectParam}。
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@JsonInclude(Include.NON_NULL)
+@Deprecated
+public class FreshInspectParam implements Serializable {
+ private static final long serialVersionUID = -1635894867602084789L;
+
+ /** 订单ID */
+ @JsonProperty("order_id")
+ private String orderId;
+
+ /** 商品打包信息 */
+ @JsonProperty("audit_items")
+ private List auditItems;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/delivery/PackageAuditInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/delivery/PackageAuditInfo.java
new file mode 100644
index 0000000000..9acee665e5
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/delivery/PackageAuditInfo.java
@@ -0,0 +1,34 @@
+package me.chanjar.weixin.channel.bean.delivery;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.Serializable;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import me.chanjar.weixin.channel.enums.PackageAuditItemType;
+
+/**
+ * 商品打包信息
+ *
+ * @author