From eaf5b3ac1af4e918a3feba4744aa2aa4f7c457a8 Mon Sep 17 00:00:00 2001 From: Hodor <1221879+zhlqee@user.noreply.gitee.com> Date: Tue, 12 Nov 2024 12:15:11 +0000 Subject: [PATCH 001/326] =?UTF-8?q?:art:=20=E9=92=88=E5=AF=B9=E4=BC=81?= =?UTF-8?q?=E5=BE=AE=E6=A8=A1=E6=9D=BF=E5=8D=A1=E7=89=87=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E4=B8=AD=E6=8C=89=E9=92=AE=E4=BA=A4=E4=BA=92=E5=9E=8B=E6=B6=88?= =?UTF-8?q?=E6=81=AF=E7=9A=84buttonSelection=E5=B1=9E=E6=80=A7=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0builder=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cp/bean/messagebuilder/TemplateCardBuilder.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/messagebuilder/TemplateCardBuilder.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/messagebuilder/TemplateCardBuilder.java index b174b7cc75..d3cbb89a3d 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/messagebuilder/TemplateCardBuilder.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/messagebuilder/TemplateCardBuilder.java @@ -427,6 +427,17 @@ public TemplateCardBuilder taskId(String taskId) { return this; } + /** + * Button selection template card builder. + * + * @param buttonSelection the button selection + * @return the template card builder + */ + public TemplateCardBuilder buttonSelection(TemplateCardButtonSelection buttonSelection) { + this.buttonSelection = buttonSelection; + return this; + } + /** * Buttons template card builder. * From 900f06847a1c797b2e626e5584b1a9b238ff4b0c Mon Sep 17 00:00:00 2001 From: YT <306932545@qq.com> Date: Sun, 24 Nov 2024 03:26:29 +0000 Subject: [PATCH 002/326] =?UTF-8?q?:new:=20=E3=80=90=E5=BE=AE=E4=BF=A1?= =?UTF-8?q?=E6=94=AF=E4=BB=98=E3=80=91=E5=B9=B3=E5=8F=B0=E6=94=B6=E4=BB=98?= =?UTF-8?q?=E9=80=9A=EF=BC=88=E9=80=80=E6=AC=BE=EF=BC=89=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=9E=AB=E4=BB=98=E9=80=80=E6=AC=BE=E5=9B=9E=E8=A1=A5=E5=92=8C?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E5=9E=AB=E4=BB=98=E5=9B=9E=E8=A1=A5=E7=BB=93?= =?UTF-8?q?=E6=9E=9C=E7=9A=84=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bean/ecommerce/RefundNotifyResult.java | 19 +++ .../bean/ecommerce/RefundQueryResult.java | 38 +++++ .../wxpay/bean/ecommerce/RefundsRequest.java | 35 ++++ .../wxpay/bean/ecommerce/RefundsResult.java | 18 ++ .../bean/ecommerce/ReturnAdvanceResult.java | 159 ++++++++++++++++++ .../wxpay/service/EcommerceService.java | 27 +++ .../service/impl/EcommerceServiceImpl.java | 19 +++ 7 files changed, 315 insertions(+) create mode 100644 weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/ReturnAdvanceResult.java diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/RefundNotifyResult.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/RefundNotifyResult.java index 89ef5d0cbd..c8c6c10589 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/RefundNotifyResult.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/RefundNotifyResult.java @@ -170,6 +170,25 @@ public class RefundNotifyResult implements Serializable { @SerializedName(value = "amount") private Amount amount; + /** + *
+ * 字段名:退款出资商户 + * 变量名:refund_account + * 是否必填:否 + * 类型:string(32) + * 描述: + * 电商平台垫资退款专用参数。需先确认已开通此功能后,才能使用。若需要开通,请联系微信支付客服。 + * 枚举值: + * REFUND_SOURCE_PARTNER_ADVANCE : 电商平台垫付,需要向微信支付申请开通 + * REFUND_SOURCE_SUB_MERCHANT : 二级商户,默认值 + * 注意: + * 若传入REFUND_SOURCE_PARTNER_ADVANCE,仅代表可以使用垫付退款,实际出款账户需以退款申请受理结果或查单结果为准。 + * 示例值:REFUND_SOURCE_SUB_MERCHANT + *+ */ + @SerializedName(value = "refund_account") + private String refundAccount; + @Data @NoArgsConstructor public static class Amount implements Serializable { diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/RefundQueryResult.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/RefundQueryResult.java index bbb30ea897..bfcd499e21 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/RefundQueryResult.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/RefundQueryResult.java @@ -183,6 +183,44 @@ public class RefundQueryResult implements Serializable { */ public List
+ * 字段名:退款出资商户 + * 变量名:refund_account + * 是否必填:否 + * 类型:string(32) + * 描述: + * 电商平台垫资退款专用参数。需先确认已开通此功能后,才能使用。若需要开通,请联系微信支付客服。 + * 枚举值: + * REFUND_SOURCE_PARTNER_ADVANCE : 电商平台垫付,需要向微信支付申请开通 + * REFUND_SOURCE_SUB_MERCHANT : 二级商户,默认值 + * 注意: + * 若传入REFUND_SOURCE_PARTNER_ADVANCE,仅代表可以使用垫付退款,实际出款账户需以退款申请受理结果或查单结果为准。 + * 示例值:REFUND_SOURCE_SUB_MERCHANT + *+ */ + @SerializedName(value = "refund_account") + private String refundAccount; + + /** + *
+ * 字段名:资金账户 + * 变量名:funds_account + * 是否必填:否 + * 类型:string(32) + * 描述: + * 若订单处于待分账状态,且未指定垫资退款(即refund_account未指定为REFUND_SOURCE_PARTNER_ADVANCE), + * 可以传入此参数,指定退款资金来源账户。当该字段不存在时,默认使用订单交易资金所在账户出款, + * 即待分账时使用不可用余额的资金进行退款,已分账或无分账时使用可用余额的资金进行退款。 AVAILABLE:可用余额 + * 示例值:AVAILABLE + *+ */ + @SerializedName(value = "funds_account") + private String fundsAccount; + + + @Data @NoArgsConstructor public static class Amount implements Serializable { diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/RefundsRequest.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/RefundsRequest.java index 96e6c22fab..b453a994f1 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/RefundsRequest.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/RefundsRequest.java @@ -147,6 +147,41 @@ public class RefundsRequest implements Serializable { @SerializedName(value = "notify_url") private String notifyUrl; + /** + *
+ * 字段名:退款出资商户 + * 变量名:refund_account + * 是否必填:否 + * 类型:string(32) + * 描述: + * 电商平台垫资退款专用参数。需先确认已开通此功能后,才能使用。若需要开通,请联系微信支付客服。 + * 枚举值: + * REFUND_SOURCE_PARTNER_ADVANCE : 电商平台垫付,需要向微信支付申请开通 + * REFUND_SOURCE_SUB_MERCHANT : 二级商户,默认值 + * 注意: + * 若传入REFUND_SOURCE_PARTNER_ADVANCE,仅代表可以使用垫付退款,实际出款账户需以退款申请受理结果或查单结果为准。 + * 示例值:REFUND_SOURCE_SUB_MERCHANT + *+ */ + @SerializedName(value = "refund_account") + private String refundAccount; + + /** + *
+ * 字段名:资金账户 + * 变量名:funds_account + * 是否必填:否 + * 类型:string(32) + * 描述: + * 若订单处于待分账状态,且未指定垫资退款(即refund_account未指定为REFUND_SOURCE_PARTNER_ADVANCE), + * 可以传入此参数,指定退款资金来源账户。当该字段不存在时,默认使用订单交易资金所在账户出款, + * 即待分账时使用不可用余额的资金进行退款,已分账或无分账时使用可用余额的资金进行退款。 AVAILABLE:可用余额 + * 示例值:AVAILABLE + *+ */ + @SerializedName(value = "funds_account") + private String fundsAccount; + @Data @Builder @NoArgsConstructor(access = AccessLevel.PRIVATE) diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/RefundsResult.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/RefundsResult.java index 9637587409..9d66ce8c38 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/RefundsResult.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/RefundsResult.java @@ -240,4 +240,22 @@ public static class PromotionDetail implements Serializable { } + + /** + *
+ * 字段名:退款资金来源 + * 变量名:refund_account + * 是否必填:否 + * 类型:string(32) + * 描述: + * 枚举值: + * REFUND_SOURCE_PARTNER_ADVANCE : 电商平台垫付 + * REFUND_SOURCE_SUB_MERCHANT : 二级商户,默认值 + * 示例值:REFUND_SOURCE_SUB_MERCHANT + *+ */ + @SerializedName(value = "refund_account") + private String refundAccount; + + } diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/ReturnAdvanceResult.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/ReturnAdvanceResult.java new file mode 100644 index 0000000000..e47bd5ca3d --- /dev/null +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/ReturnAdvanceResult.java @@ -0,0 +1,159 @@ +package com.github.binarywang.wxpay.bean.ecommerce; + +import com.google.gson.annotations.SerializedName; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.List; + + +/** + * 垫付退款回补API结果 + * *
+ * * 文档地址:https://pay.weixin.qq.com/wiki/doc/apiv3_partner/apis/chapter7_6_4.shtml + * *+ * + * @author yantao + * created on 2024/11/20 + */ +@Data +@NoArgsConstructor +public class ReturnAdvanceResult implements Serializable { + + private static final long serialVersionUID = -186851559004865784L; + + /** + *
+ * 字段名:微信退款单号 + * 变量名:refund_id + * 是否必填:是 + * 类型:string(32) + * 描述: + * 微信支付退款单的主键,唯一定义此资源的标识。 必须是垫付退款的微信支付退款单 + * 示例值:50000000382019052709732678859 + *+ */ + @SerializedName(value = "refund_id") + private String refundId; + + /** + *
+ * 字段名:微信回补单号 + * 变量名:advance_return_id + * 是否必填:是 + * 类型:string(32) + * 描述:微信支付生成的垫付回补操作单号 + * 示例值:1215562501201407033233368018 + *+ */ + @SerializedName(value = "advance_return_id") + private String advanceReturnId ; + + /** + *
+ * 字段名:垫付回补金额 + * 变量名:return_amount + * 是否必填:是 + * 类型:int + * 描述:退款单对应的垫付退款的金额 + * 示例值:888 + *+ */ + @SerializedName(value = "return_amount") + private Integer returnAmount ; + + /** + *
+ * 字段名:出款方商户号 + * 变量名:payer_mchid + * 是否必填:是 + * 类型:string(32) + * 描述:微信支付分配给出款方的商户号 + * 示例值:1900000109 + *+ */ + @SerializedName(value = "payer_mchid") + private String payerMchid ; + + /** + *
+ * 字段名:出款方账户 + * 变量名:payer_account + * 是否必填:是 + * 类型:string(32) + * 描述: + * 枚举值: + * BASIC:基本账户 + * OPERATION:运营账户 + * 示例值:BASIC + *+ */ + @SerializedName(value = "payer_account") + private String payerAccount; + + /** + *
+ * 字段名:入账方商户号 + * 变量名:payee_mchid + * 是否必填:是 + * 类型:string(32) + * 描述: + * 微信支付分配给入账方的商户号 + * 示例值:1900000108 + *+ */ + @SerializedName(value = "payee_mchid") + private String payeeMchid; + + /** + *
+ * 字段名:入账方账户 + * 变量名:payee_account + * 是否必填:是 + * 类型:string(32) + * 描述:枚举值: + * BASIC:基本账户 + * OPERATION:运营账户 + * 示例值:BASIC + *+ */ + @SerializedName(value = "payee_account") + private String payeeAccount; + + /** + *
+ * 字段名:垫付回补结果 + * 变量名:result + * 是否必填:是 + * 类型:string(32) + * 描述:枚举值: + * SUCCESS:回补成功 + * FAILED:回补失败,出款方账户余额不足时发生 + * PROCESSING:处理中 + * 示例值:SUCCESS + *+ */ + @SerializedName(value = "result") + private String result ; + + /** + *
+ * 字段名:垫付回补完成时间 + * 变量名:success_time + * 是否必填:否 + * 类型:string(64) + * 描述:垫付回补完成的时间,遵循rfc3339标准格式, + * 格式为yyyy-MM-DDTHH:mm:ss+TIMEZONE,yyyy-MM-DD表示年月日, + * T出现在字符串中,表示time元素的开头,HH:mm:ss表示时分秒, + * TIMEZONE表示时区(+08:00表示东八区时间,领先UTC 8小时,即北京时间)。 + * 例如:2015-05-20T13:29:35+08:00表示北京时间2015年05月20日13点29分35秒。 + * 示例值:2018-06-08T10:34:56+08:00 + *+ */ + @SerializedName(value = "success_time") + private String successTime; + + + +} diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/EcommerceService.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/EcommerceService.java index 99d17e0732..2dbb2906c3 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/EcommerceService.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/EcommerceService.java @@ -364,6 +364,33 @@ public interface EcommerceService { */ RefundQueryResult queryRefundByRefundId(String subMchid, String refundId) throws WxPayException; + + /** + *
+ * 垫付退款回补API + * 文档地址: https://pay.weixin.qq.com/wiki/doc/apiv3_partner/apis/chapter7_6_4.shtml + *+ * + * @param subMchid 二级商户号 + * @param refundId 微信退款单号 + * @return 返回数据 return refunds result + * @throws WxPayException the wx pay exception + */ + ReturnAdvanceResult refundsReturnAdvance(String subMchid, String refundId) throws WxPayException; + + + /** + *
+ * 查询垫付回补结果API + * 文档地址: https://pay.weixin.qq.com/wiki/doc/apiv3_partner/apis/chapter7_6_5.shtml + *+ * + * @param subMchid 二级商户号 + * @param refundId 微信退款单号 + * @return 返回数据 return refunds result + * @throws WxPayException the wx pay exception + */ + ReturnAdvanceResult queryRefundsReturnAdvance(String subMchid, String refundId) throws WxPayException; /** *
* 查询退款API
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/EcommerceServiceImpl.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/EcommerceServiceImpl.java
index 3671ab72ba..36dc08d6f6 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/EcommerceServiceImpl.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/EcommerceServiceImpl.java
@@ -290,6 +290,25 @@ public RefundQueryResult queryRefundByRefundId(String subMchid, String refundId)
return GSON.fromJson(response, RefundQueryResult.class);
}
+
+ @Override
+ public ReturnAdvanceResult refundsReturnAdvance(String subMchid, String refundId) throws WxPayException {
+ String url = String.format("%s/v3/ecommerce/refunds/%s/return-advance", this.payService.getPayBaseUrl(), refundId);
+ Map request = new HashMap();
+ request.put("sub_mchid",subMchid);
+ String response = this.payService.postV3(url, GSON.toJson(request));
+ return GSON.fromJson(response, ReturnAdvanceResult.class);
+ }
+
+
+ @Override
+ public ReturnAdvanceResult queryRefundsReturnAdvance(String subMchid, String refundId) throws WxPayException {
+ String url = String.format("%s/v3/ecommerce/refunds/%s/return-advance?sub_mchid=%s", this.payService.getPayBaseUrl(), refundId,subMchid);
+ String response = this.payService.getV3(url);
+ return GSON.fromJson(response, ReturnAdvanceResult.class);
+ }
+
+
@Override
public RefundQueryResult queryRefundByOutRefundNo(String subMchid, String outRefundNo) throws WxPayException {
String url = String.format("%s/v3/ecommerce/refunds/out-refund-no/%s?sub_mchid=%s", this.payService.getPayBaseUrl(), outRefundNo, subMchid);
From d2ff40f56296b1b8644d34f38eadead4b93bd12a Mon Sep 17 00:00:00 2001
From: Binary Wang
Date: Sun, 24 Nov 2024 11:38:15 +0800
Subject: [PATCH 003/326] =?UTF-8?q?:art:=20#3414=20=E3=80=90=E8=A7=86?=
=?UTF-8?q?=E9=A2=91=E5=8F=B7=E3=80=91=E5=B0=8F=E5=BA=97API=E8=8E=B7?=
=?UTF-8?q?=E5=8F=96=E8=AE=A2=E5=8D=95=E8=AF=A6=E6=83=85=E6=8E=A5=E5=8F=A3?=
=?UTF-8?q?=E7=BB=93=E6=9E=9C=E7=B1=BB=E6=96=B0=E5=A2=9E=E5=87=A0=E4=B8=AA?=
=?UTF-8?q?=E5=B1=9E=E6=80=A7?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../channel/bean/order/OrderPriceInfo.java | 72 +++++++++++++++----
1 file changed, 58 insertions(+), 14 deletions(-)
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/OrderPriceInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/OrderPriceInfo.java
index 64e6690a66..b1688cde5c 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/OrderPriceInfo.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/OrderPriceInfo.java
@@ -1,10 +1,11 @@
package me.chanjar.weixin.channel.bean.order;
import com.fasterxml.jackson.annotation.JsonProperty;
-import java.io.Serializable;
import lombok.Data;
import lombok.NoArgsConstructor;
+import java.io.Serializable;
+
/**
* 商店订单价格信息
*
@@ -13,54 +14,97 @@
@Data
@NoArgsConstructor
public class OrderPriceInfo implements Serializable {
-
private static final long serialVersionUID = 5216506688949493432L;
- /** 商品总价,单位为分 */
+
+ /**
+ * 商品总价,单位为分
+ */
@JsonProperty("product_price")
private Integer productPrice;
- /** 订单金额,单位为分 */
+ /**
+ * 订单金额,单位为分
+ */
@JsonProperty("order_price")
private Integer orderPrice;
- /** 运费,单位为分 */
+ /**
+ * 运费,单位为分
+ */
@JsonProperty("freight")
private Integer freight;
- /** 优惠金额,单位为分 */
+ /**
+ * 优惠金额,单位为分
+ */
@JsonProperty("discounted_price")
private Integer discountedPrice;
- /** 是否有优惠 */
+ /**
+ * 是否有优惠
+ */
@JsonProperty("is_discounted")
private Boolean isDiscounted;
- /** 订单原始价格,单位为分 */
+ /**
+ * 订单原始价格,单位为分
+ */
@JsonProperty("original_order_price")
private Integer originalOrderPrice;
- /** 商品预估价格,单位为分 */
+ /**
+ * 商品预估价格,单位为分
+ */
@JsonProperty("estimate_product_price")
private Integer estimateProductPrice;
- /** 改价后降低金额,单位为分 */
+ /**
+ * 改价后降低金额,单位为分
+ */
@JsonProperty("change_down_price")
private Integer changeDownPrice;
- /** 改价后运费,单位为分 */
+ /**
+ * 改价后运费,单位为分
+ */
@JsonProperty("change_freight")
private Integer changeFreight;
- /** 是否修改运费 */
+ /**
+ * 是否修改运费
+ */
@JsonProperty("is_change_freight")
private Boolean changeFreighted;
- /** 是否使用了会员积分抵扣 */
+ /**
+ * 是否使用了会员积分抵扣
+ */
@JsonProperty("use_deduction")
private Boolean useDeduction;
- /** 会员积分抵扣金额,单位为分 */
+ /**
+ * 会员积分抵扣金额,单位为分
+ */
@JsonProperty("deduction_price")
private Integer deductionPrice;
+ /**
+ * 商家实收金额,单位为分
+ * merchant_receieve_price=original_order_price-discounted_price-deduction_price-change_down_price
+ */
+ @JsonProperty("merchant_receieve_price")
+ private Integer merchant_receive_price;
+
+ /**
+ * 商家优惠金额,单位为分,含义同discounted_price,必填
+ */
+ @JsonProperty("merchant_discounted_price")
+ private Integer merchant_discounted_price;
+
+ /**
+ * 达人优惠金额,单位为分
+ */
+ @JsonProperty("finder_discounted_price")
+ private Integer finder_discounted_price;
+
}
From 577f2e6a0bcb8bb54ac5362aa1ac7a255c0d1bf1 Mon Sep 17 00:00:00 2001
From: Binary Wang
Date: Wed, 27 Nov 2024 10:07:37 +0800
Subject: [PATCH 004/326] =?UTF-8?q?:arrow=5Fup:=20=E5=8D=87=E7=BA=A7xstrea?=
=?UTF-8?q?m=E7=89=88=E6=9C=AC=E5=88=B01.4.21?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index e66b89b436..586f45d59b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -193,7 +193,7 @@
com.thoughtworks.xstream
xstream
- 1.4.20
+ 1.4.21
com.google.guava
From c6a38ae7dd63aaaff159f8ece1c7ec8788a6acdf Mon Sep 17 00:00:00 2001
From: je45 <23151789+je45@users.noreply.github.com>
Date: Fri, 29 Nov 2024 16:29:37 +0800
Subject: [PATCH 005/326] =?UTF-8?q?:art:=20#3288=E3=80=90=E5=BE=AE?=
=?UTF-8?q?=E4=BF=A1=E6=94=AF=E4=BB=98=E3=80=91=E4=BF=AE=E5=A4=8D=E7=94=B1?=
=?UTF-8?q?=E4=BA=8E=E5=BE=AE=E4=BF=A1=E7=AD=BE=E5=90=8D=E6=8E=A2=E6=B5=8B?=
=?UTF-8?q?=E5=AF=BC=E8=87=B4=E7=9A=84=E9=AA=8C=E7=AD=BE=E9=94=99=E8=AF=AF?=
=?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../wxpay/exception/WxSignTestException.java | 31 +++++++++++++++++++
.../service/impl/BaseWxPayServiceImpl.java | 7 ++++-
.../service/impl/PayScoreServiceImpl.java | 7 ++++-
3 files changed, 43 insertions(+), 2 deletions(-)
create mode 100644 weixin-java-pay/src/main/java/com/github/binarywang/wxpay/exception/WxSignTestException.java
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/exception/WxSignTestException.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/exception/WxSignTestException.java
new file mode 100644
index 0000000000..97a0182adb
--- /dev/null
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/exception/WxSignTestException.java
@@ -0,0 +1,31 @@
+package com.github.binarywang.wxpay.exception;
+
+/**
+ *
+ * 微信支付签名探测异常类
+ *
+ * @author je45
+ * @date 2024/11/27 9:35
+ */
+public class WxSignTestException extends WxPayException {
+ private static final long serialVersionUID = -303371909244098058L;
+
+ /**
+ * Instantiates a new Wx pay exception.
+ *
+ * @param customErrorMsg the custom error msg
+ */
+ public WxSignTestException(String customErrorMsg) {
+ super(customErrorMsg);
+ }
+
+ /**
+ * Instantiates a new Wx pay exception.
+ *
+ * @param customErrorMsg the custom error msg
+ * @param tr the tr
+ */
+ public WxSignTestException(String customErrorMsg, Throwable tr) {
+ super(customErrorMsg, tr);
+ }
+}
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java
index 851040dd13..c9fc1e7bd2 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java
@@ -17,6 +17,7 @@
import com.github.binarywang.wxpay.constant.WxPayConstants.SignType;
import com.github.binarywang.wxpay.constant.WxPayConstants.TradeType;
import com.github.binarywang.wxpay.exception.WxPayException;
+import com.github.binarywang.wxpay.exception.WxSignTestException;
import com.github.binarywang.wxpay.service.*;
import com.github.binarywang.wxpay.util.SignUtils;
import com.github.binarywang.wxpay.util.XmlConfig;
@@ -343,7 +344,11 @@ public WxPayOrderNotifyResult parseOrderNotifyResult(String xmlData, String sign
* @param data 通知数据
* @return true:校验通过 false:校验不通过
*/
- private boolean verifyNotifySign(SignatureHeader header, String data) {
+ private boolean verifyNotifySign(SignatureHeader header, String data) throws WxSignTestException {
+ String wxPaySign = header.getSignature();
+ if(wxPaySign.startsWith("WECHATPAY/SIGNTEST/")){
+ throw new WxSignTestException("微信支付签名探测流量");
+ }
String beforeSign = String.format("%s\n%s\n%s\n",
header.getTimeStamp(),
header.getNonce(),
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/PayScoreServiceImpl.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/PayScoreServiceImpl.java
index ed36bd7f08..249cfa3f56 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/PayScoreServiceImpl.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/PayScoreServiceImpl.java
@@ -7,6 +7,7 @@
import com.github.binarywang.wxpay.bean.payscore.WxPayScoreResult;
import com.github.binarywang.wxpay.config.WxPayConfig;
import com.github.binarywang.wxpay.exception.WxPayException;
+import com.github.binarywang.wxpay.exception.WxSignTestException;
import com.github.binarywang.wxpay.service.PayScoreService;
import com.github.binarywang.wxpay.service.WxPayService;
import com.github.binarywang.wxpay.v3.util.AesUtils;
@@ -327,7 +328,11 @@ public WxPayScoreResult decryptNotifyDataResource(PayScoreNotifyData data) throw
* @param data 通知数据
* @return true:校验通过 false:校验不通过
*/
- private boolean verifyNotifySign(SignatureHeader header, String data) {
+ private boolean verifyNotifySign(SignatureHeader header, String data) throws WxSignTestException {
+ String wxPaySign = header.getSigned();
+ if(wxPaySign.startsWith("WECHATPAY/SIGNTEST/")){
+ throw new WxSignTestException("微信支付签名探测流量");
+ }
String beforeSign = String.format("%s\n%s\n%s\n", header.getTimeStamp(), header.getNonce(), data);
return payService.getConfig().getVerifier().verify(header.getSerialNo(),
beforeSign.getBytes(StandardCharsets.UTF_8), header.getSigned());
From 524ff805228d7f364c19e6af5f45e1f40697d318 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=A0=88=E7=83=9F?=
Date: Sat, 30 Nov 2024 00:39:06 +0800
Subject: [PATCH 006/326] =?UTF-8?q?:new:=20#3402=20=E3=80=90=E5=BE=AE?=
=?UTF-8?q?=E4=BF=A1=E6=94=AF=E4=BB=98=E3=80=91=E6=94=AF=E6=8C=81=E9=85=8D?=
=?UTF-8?q?=E7=BD=AE=E5=BE=AE=E4=BF=A1=E6=94=AF=E4=BB=98=E5=85=AC=E9=92=A5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../binarywang/wxpay/config/WxPayConfig.java | 67 ++++++--
.../v3/auth/PublicCertificateVerifier.java | 39 +++++
.../wxpay/v3/auth/X509PublicCertificate.java | 150 ++++++++++++++++++
.../binarywang/wxpay/v3/util/PemUtils.java | 29 +++-
.../src/test/resources/test-config.sample.xml | 1 +
5 files changed, 267 insertions(+), 19 deletions(-)
create mode 100644 weixin-java-pay/src/main/java/com/github/binarywang/wxpay/v3/auth/PublicCertificateVerifier.java
create mode 100644 weixin-java-pay/src/main/java/com/github/binarywang/wxpay/v3/auth/X509PublicCertificate.java
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java
index 637d46e986..857b937d8e 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java
@@ -6,26 +6,26 @@
import com.github.binarywang.wxpay.v3.WxPayV3HttpClientBuilder;
import com.github.binarywang.wxpay.v3.auth.*;
import com.github.binarywang.wxpay.v3.util.PemUtils;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.SneakyThrows;
-import lombok.ToString;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.lang3.RegExUtils;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.http.impl.client.CloseableHttpClient;
-import org.apache.http.ssl.SSLContexts;
-
-import javax.net.ssl.SSLContext;
import java.io.*;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.security.KeyStore;
import java.security.PrivateKey;
+import java.security.PublicKey;
import java.security.cert.Certificate;
import java.security.cert.X509Certificate;
import java.util.Base64;
import java.util.Optional;
+import javax.net.ssl.SSLContext;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.SneakyThrows;
+import lombok.ToString;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.RegExUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.ssl.SSLContexts;
/**
* 微信支付配置
@@ -138,6 +138,25 @@ public class WxPayConfig {
*/
private byte[] privateCertContent;
+ /**
+ * 公钥ID
+ */
+ private String publicKeyId;
+
+ /**
+ * pub_key.pem证书base64编码
+ */
+ private String publicKeyString;
+
+ /**
+ * pub_key.pem证书文件的绝对路径或者以classpath:开头的类路径.
+ */
+ private String publicKeyPath;
+
+ /**
+ * pub_key.pem证书文件内容的字节数组.
+ */
+ private byte[] publicKeyContent;
/**
* apiV3 秘钥值.
*/
@@ -241,7 +260,7 @@ public SSLContext initSSLContext() throws WxPayException {
}
try (InputStream inputStream = this.loadConfigInputStream(this.keyString, this.getKeyPath(),
- this.keyContent, "p12证书");) {
+ this.keyContent, "p12证书")) {
KeyStore keystore = KeyStore.getInstance("PKCS12");
char[] partnerId2charArray = this.getMchId().toCharArray();
keystore.load(inputStream, partnerId2charArray);
@@ -284,7 +303,6 @@ public CloseableHttpClient initApiV3HttpClient() throws WxPayException {
this.privateKeyContent, "privateKeyPath")) {
merchantPrivateKey = PemUtils.loadPrivateKey(keyInputStream);
}
-
}
if (certificate == null && StringUtils.isBlank(this.getCertSerialNo())) {
try (InputStream certInputStream = this.loadConfigInputStream(this.getPrivateCertString(), this.getPrivateCertPath(),
@@ -293,13 +311,28 @@ public CloseableHttpClient initApiV3HttpClient() throws WxPayException {
}
this.certSerialNo = certificate.getSerialNumber().toString(16).toUpperCase();
}
+ PublicKey publicKey = null;
+ if (this.getPublicKeyString() != null || this.getPublicKeyPath() != null || this.publicKeyContent != null) {
+ try (InputStream pubInputStream =
+ this.loadConfigInputStream(this.getPublicKeyString(), this.getPublicKeyPath(),
+ this.publicKeyContent, "publicKeyPath")) {
+ publicKey = PemUtils.loadPublicKey(pubInputStream);
+ }
+ }
//构造Http Proxy正向代理
WxPayHttpProxy wxPayHttpProxy = getWxPayHttpProxy();
- AutoUpdateCertificatesVerifier certificatesVerifier = new AutoUpdateCertificatesVerifier(
- new WxPayCredentials(mchId, new PrivateKeySigner(certSerialNo, merchantPrivateKey)),
- this.getApiV3Key().getBytes(StandardCharsets.UTF_8), this.getCertAutoUpdateTime(), this.getPayBaseUrl(), wxPayHttpProxy);
+ Verifier certificatesVerifier;
+ if (publicKey == null) {
+ certificatesVerifier =
+ new AutoUpdateCertificatesVerifier(
+ new WxPayCredentials(mchId, new PrivateKeySigner(certSerialNo, merchantPrivateKey)),
+ this.getApiV3Key().getBytes(StandardCharsets.UTF_8), this.getCertAutoUpdateTime(),
+ this.getPayBaseUrl(), wxPayHttpProxy);
+ } else {
+ certificatesVerifier = new PublicCertificateVerifier(publicKey, publicKeyId);
+ }
WxPayV3HttpClientBuilder wxPayV3HttpClientBuilder = WxPayV3HttpClientBuilder.create()
.withMerchant(mchId, certSerialNo, merchantPrivateKey)
@@ -422,7 +455,7 @@ private Object[] p12ToPem() {
// 分解p12证书文件
try (InputStream inputStream = this.loadConfigInputStream(this.keyString, this.getKeyPath(),
- this.keyContent, "p12证书");) {
+ this.keyContent, "p12证书")) {
KeyStore keyStore = KeyStore.getInstance("PKCS12");
keyStore.load(inputStream, key.toCharArray());
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/v3/auth/PublicCertificateVerifier.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/v3/auth/PublicCertificateVerifier.java
new file mode 100644
index 0000000000..9344fc6f83
--- /dev/null
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/v3/auth/PublicCertificateVerifier.java
@@ -0,0 +1,39 @@
+package com.github.binarywang.wxpay.v3.auth;
+
+import java.security.*;
+import java.security.cert.X509Certificate;
+import java.util.Base64;
+import me.chanjar.weixin.common.error.WxRuntimeException;
+
+public class PublicCertificateVerifier implements Verifier{
+
+ private final PublicKey publicKey;
+
+ private final X509PublicCertificate publicCertificate;
+
+ public PublicCertificateVerifier(PublicKey publicKey, String publicId) {
+ this.publicKey = publicKey;
+ this.publicCertificate = new X509PublicCertificate(publicKey, publicId);
+ }
+
+ @Override
+ public boolean verify(String serialNumber, byte[] message, String signature) {
+ try {
+ Signature sign = Signature.getInstance("SHA256withRSA");
+ sign.initVerify(publicKey);
+ sign.update(message);
+ return sign.verify(Base64.getDecoder().decode(signature));
+ } catch (NoSuchAlgorithmException e) {
+ throw new WxRuntimeException("当前Java环境不支持SHA256withRSA", e);
+ } catch (SignatureException e) {
+ throw new WxRuntimeException("签名验证过程发生了错误", e);
+ } catch (InvalidKeyException e) {
+ throw new WxRuntimeException("无效的证书", e);
+ }
+ }
+
+ @Override
+ public X509Certificate getValidCertificate() {
+ return this.publicCertificate;
+ }
+}
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/v3/auth/X509PublicCertificate.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/v3/auth/X509PublicCertificate.java
new file mode 100644
index 0000000000..39d147c6ac
--- /dev/null
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/v3/auth/X509PublicCertificate.java
@@ -0,0 +1,150 @@
+package com.github.binarywang.wxpay.v3.auth;
+
+import java.math.BigInteger;
+import java.security.*;
+import java.security.cert.*;
+import java.util.Collections;
+import java.util.Date;
+import java.util.Set;
+
+public class X509PublicCertificate extends X509Certificate {
+
+ private final PublicKey publicKey;
+
+ private final String publicId;
+
+ public X509PublicCertificate(PublicKey publicKey, String publicId) {
+ this.publicKey = publicKey;
+ this.publicId = publicId;
+ }
+
+ @Override
+ public PublicKey getPublicKey() {
+ return this.publicKey;
+ }
+
+ @Override
+ public BigInteger getSerialNumber() {
+ return new BigInteger(publicId.replace("PUB_KEY_ID_", ""), 16);
+ }
+
+ @Override
+ public void checkValidity() throws CertificateExpiredException, CertificateNotYetValidException {
+ }
+
+ @Override
+ public void checkValidity(Date date) throws CertificateExpiredException, CertificateNotYetValidException {
+
+ }
+
+ @Override
+ public int getVersion() {
+ return 0;
+ }
+
+ @Override
+ public Principal getIssuerDN() {
+ return null;
+ }
+
+ @Override
+ public Principal getSubjectDN() {
+ return null;
+ }
+
+ @Override
+ public Date getNotBefore() {
+ return null;
+ }
+
+ @Override
+ public Date getNotAfter() {
+ return null;
+ }
+
+ @Override
+ public byte[] getTBSCertificate() throws CertificateEncodingException {
+ return new byte[0];
+ }
+
+ @Override
+ public byte[] getSignature() {
+ return new byte[0];
+ }
+
+ @Override
+ public String getSigAlgName() {
+ return "";
+ }
+
+ @Override
+ public String getSigAlgOID() {
+ return "";
+ }
+
+ @Override
+ public byte[] getSigAlgParams() {
+ return new byte[0];
+ }
+
+ @Override
+ public boolean[] getIssuerUniqueID() {
+ return new boolean[0];
+ }
+
+ @Override
+ public boolean[] getSubjectUniqueID() {
+ return new boolean[0];
+ }
+
+ @Override
+ public boolean[] getKeyUsage() {
+ return new boolean[0];
+ }
+
+ @Override
+ public int getBasicConstraints() {
+ return 0;
+ }
+
+ @Override
+ public byte[] getEncoded() throws CertificateEncodingException {
+ return new byte[0];
+ }
+
+ @Override
+ public void verify(PublicKey key) throws CertificateException, NoSuchAlgorithmException, InvalidKeyException, NoSuchProviderException, SignatureException {
+
+ }
+
+ @Override
+ public void verify(PublicKey key, String sigProvider) throws CertificateException, NoSuchAlgorithmException, InvalidKeyException, NoSuchProviderException, SignatureException {
+
+ }
+
+ @Override
+ public String toString() {
+ return "";
+ }
+
+
+ @Override
+ public boolean hasUnsupportedCriticalExtension() {
+ return false;
+ }
+
+ @Override
+ public Set getCriticalExtensionOIDs() {
+ return Collections.emptySet();
+ }
+
+ @Override
+ public Set getNonCriticalExtensionOIDs() {
+ return Collections.emptySet();
+ }
+
+ @Override
+ public byte[] getExtensionValue(String oid) {
+ return new byte[0];
+ }
+}
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/v3/util/PemUtils.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/v3/util/PemUtils.java
index 1983fb3387..a885ea0950 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/v3/util/PemUtils.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/v3/util/PemUtils.java
@@ -1,13 +1,12 @@
package com.github.binarywang.wxpay.v3.util;
-import me.chanjar.weixin.common.error.WxRuntimeException;
-
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.security.KeyFactory;
import java.security.NoSuchAlgorithmException;
import java.security.PrivateKey;
+import java.security.PublicKey;
import java.security.cert.CertificateException;
import java.security.cert.CertificateExpiredException;
import java.security.cert.CertificateFactory;
@@ -15,7 +14,9 @@
import java.security.cert.X509Certificate;
import java.security.spec.InvalidKeySpecException;
import java.security.spec.PKCS8EncodedKeySpec;
+import java.security.spec.X509EncodedKeySpec;
import java.util.Base64;
+import me.chanjar.weixin.common.error.WxRuntimeException;
public class PemUtils {
@@ -59,4 +60,28 @@ public static X509Certificate loadCertificate(InputStream inputStream) {
throw new WxRuntimeException("无效的证书", e);
}
}
+
+ public static PublicKey loadPublicKey(InputStream inputStream){
+ try {
+ ByteArrayOutputStream array = new ByteArrayOutputStream();
+ byte[] buffer = new byte[1024];
+ int length;
+ while ((length = inputStream.read(buffer)) != -1) {
+ array.write(buffer, 0, length);
+ }
+
+ String publicKey = array.toString("utf-8")
+ .replace("-----BEGIN PUBLIC KEY-----", "")
+ .replace("-----END PUBLIC KEY-----", "")
+ .replaceAll("\\s+", "");
+ return KeyFactory.getInstance("RSA")
+ .generatePublic(new X509EncodedKeySpec(Base64.getDecoder().decode(publicKey)));
+ } catch (NoSuchAlgorithmException e) {
+ throw new WxRuntimeException("当前Java环境不支持RSA", e);
+ } catch (InvalidKeySpecException e) {
+ throw new WxRuntimeException("无效的密钥格式");
+ } catch (IOException e) {
+ throw new WxRuntimeException("无效的密钥");
+ }
+ }
}
diff --git a/weixin-java-pay/src/test/resources/test-config.sample.xml b/weixin-java-pay/src/test/resources/test-config.sample.xml
index a63cd8dc30..e9d383dd19 100644
--- a/weixin-java-pay/src/test/resources/test-config.sample.xml
+++ b/weixin-java-pay/src/test/resources/test-config.sample.xml
@@ -18,6 +18,7 @@
apiV3 证书序列号值
apiclient_key.pem证书文件的绝对路径或者以classpath:开头的类路径.
apiclient_cert.pem证书文件的绝对路径或者以classpath:开头的类路径.
+ pub_key.pem证书文件的绝对路径或者以classpath:开头的类路径.
某个openId
From f72f748cda62c29810dbc3c9980f19c8c5922a63 Mon Sep 17 00:00:00 2001
From: Zeyes Lee
Date: Sat, 30 Nov 2024 00:40:57 +0800
Subject: [PATCH 007/326] =?UTF-8?q?:art:=20#3426=E3=80=90=E8=A7=86?=
=?UTF-8?q?=E9=A2=91=E5=8F=B7=E3=80=91=E6=9B=B4=E6=96=B0=E8=A7=86=E9=A2=91?=
=?UTF-8?q?=E5=8F=B7=E5=B0=8F=E5=BA=97/=E5=BE=AE=E4=BF=A1=E5=B0=8F?=
=?UTF-8?q?=E5=BA=97=E7=B1=BB=E7=9B=AE=E3=80=81=E8=AE=A2=E5=8D=95=E3=80=81?=
=?UTF-8?q?=E5=95=86=E5=93=81=E3=80=81=E4=B8=BB=E9=A1=B5=E7=AE=A1=E7=90=86?=
=?UTF-8?q?=E7=AD=89=E7=9B=B8=E5=85=B3=E6=8E=A5=E5=8F=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../AbstractWxChannelConfiguration.java | 8 +-
...ctWxChannelConfigStorageConfiguration.java | 1 +
.../properties/WxChannelProperties.java | 5 +
.../AbstractWxChannelConfiguration.java | 8 +-
.../README.md | 103 ++++++
...ctWxChannelConfigStorageConfiguration.java | 1 +
.../properties/WxChannelProperties.java | 5 +
weixin-java-channel/pom.xml | 4 +-
.../api/BaseWxChannelMessageService.java | 56 ++-
.../channel/api/BaseWxChannelService.java | 3 +-
.../channel/api/WxChannelCategoryService.java | 35 +-
.../channel/api/WxChannelOrderService.java | 36 ++
.../channel/api/WxChannelProductService.java | 79 ++++
.../weixin/channel/api/WxChannelService.java | 8 +-
.../channel/api/WxChannelVipService.java | 4 +-
.../channel/api/WxStoreHomePageService.java | 188 ++++++++++
.../impl/BaseWxChannelMessageServiceImpl.java | 51 ++-
.../api/impl/BaseWxChannelServiceImpl.java | 41 ++-
.../impl/WxChannelCategoryServiceImpl.java | 21 +-
.../api/impl/WxChannelOrderServiceImpl.java | 26 ++
.../api/impl/WxChannelProductServiceImpl.java | 63 ++++
.../impl/WxChannelServiceHttpClientImpl.java | 62 +---
.../api/impl/WxChannelServiceImpl.java | 23 +-
.../api/impl/WxChannelServiceOkHttpImpl.java | 135 +++----
.../api/impl/WxChannelVipServiceImpl.java | 24 +-
.../api/impl/WxStoreHomePageServiceImpl.java | 164 +++++++++
.../channel/bean/audit/CategoryAuditInfo.java | 44 ++-
.../channel/bean/audit/CategoryBrand.java | 23 ++
.../weixin/channel/bean/audit/CatsV2.java | 22 ++
.../bean/category/CategoryDetailResult.java | 124 ++++++-
.../bean/category/CategoryQualification.java | 13 +-
.../CategoryQualificationResponse.java | 3 +
.../bean/category/QualificationInfo.java | 4 +
.../channel/bean/category/ShopCategory.java | 4 +
.../bean/category/ShopCategoryResponse.java | 4 +-
.../bean/delivery/FreshInspectParam.java | 31 ++
.../bean/delivery/PackageAuditInfo.java | 32 ++
.../background/BackgroundApplyResponse.java | 25 ++
.../background/BackgroundApplyResult.java | 35 ++
.../background/BackgroundGetResponse.java | 28 ++
.../bean/home/banner/BannerApplyDetail.java | 33 ++
.../bean/home/banner/BannerApplyInfo.java | 35 ++
.../bean/home/banner/BannerApplyParam.java | 28 ++
.../bean/home/banner/BannerApplyResponse.java | 25 ++
.../bean/home/banner/BannerGetResponse.java | 28 ++
.../channel/bean/home/banner/BannerInfo.java | 31 ++
.../channel/bean/home/banner/BannerItem.java | 41 +++
.../bean/home/banner/BannerItemDetail.java | 33 ++
.../bean/home/banner/BannerItemFinder.java | 29 ++
.../banner/BannerItemOfficialAccount.java | 25 ++
.../bean/home/banner/BannerItemProduct.java | 25 ++
.../channel/bean/home/tree/CatTreeNode.java | 32 ++
.../channel/bean/home/tree/LevelTreeInfo.java | 23 ++
.../bean/home/tree/OneLevelTreeNode.java | 24 ++
.../bean/home/tree/TreeAuditResult.java | 27 ++
.../bean/home/tree/TreeAuditResultDetail.java | 27 ++
.../bean/home/tree/TreeProductEditInfo.java | 33 ++
.../bean/home/tree/TreeProductEditParam.java | 25 ++
.../bean/home/tree/TreeProductListInfo.java | 36 ++
.../bean/home/tree/TreeProductListParam.java | 24 ++
.../home/tree/TreeProductListResponse.java | 24 ++
.../bean/home/tree/TreeProductListResult.java | 31 ++
.../bean/home/tree/TreeShowGetResponse.java | 20 ++
.../channel/bean/home/tree/TreeShowInfo.java | 103 ++++++
.../channel/bean/home/tree/TreeShowParam.java | 24 ++
.../bean/home/tree/TreeShowSetResponse.java | 20 ++
.../home/window/WindowProductIndexParam.java | 28 ++
.../home/window/WindowProductListParam.java | 26 ++
.../home/window/WindowProductSetting.java | 34 ++
.../window/WindowProductSettingResponse.java | 33 ++
.../bean/message/store/CloseStoreMessage.java | 38 ++
.../message/store/NicknameUpdateMessage.java | 43 +++
.../channel/bean/order/DecodeAddressInfo.java | 22 ++
.../order/DecodeSensitiveInfoResponse.java | 28 ++
.../channel/bean/order/OrderDeliveryInfo.java | 12 +
.../bean/order/OrderSearchCondition.java | 23 +-
.../bean/order/QualityInsepctInfo.java | 22 ++
.../channel/bean/order/RechargeInfo.java | 28 ++
.../channel/bean/order/VirtualNumberInfo.java | 30 ++
.../bean/order/VirtualTelNumberResponse.java | 30 ++
.../bean/product/ExtraServiceInfo.java | 16 +
.../channel/bean/product/ProductQuaInfo.java | 29 ++
.../bean/product/ProductSaleLimitInfo.java | 30 ++
.../channel/bean/product/SkuFastInfo.java | 52 +++
.../weixin/channel/bean/product/SkuInfo.java | 2 +-
.../bean/product/SkuStockBatchList.java | 23 ++
.../bean/product/SkuStockBatchParam.java | 24 ++
.../bean/product/SkuStockBatchResponse.java | 24 ++
.../channel/bean/product/SkuStockInfo.java | 9 +-
.../bean/product/SkuStockResponse.java | 2 +
.../channel/bean/product/SpuFastInfo.java | 28 ++
.../channel/bean/product/SpuGetResponse.java | 4 +
.../weixin/channel/bean/product/SpuInfo.java | 20 +-
.../channel/bean/product/SpuSimpleInfo.java | 2 +-
.../channel/bean/product/SpuSizeChart.java | 27 ++
.../bean/product/SpuSizeChartItem.java | 55 +++
.../channel/bean/product/SpuStockInfo.java | 25 ++
.../channel/bean/product/SpuUpdateInfo.java | 24 ++
.../bean/product/WarehouseStockInfo.java | 6 +
.../product/link/ProductH5UrlResponse.java | 22 ++
.../product/link/ProductQrCodeResponse.java | 22 ++
.../product/link/ProductTagLinkResponse.java | 22 ++
...StableToken.java => StableTokenParam.java} | 2 +-
.../{VipParam.java => VipOpenIdParam.java} | 2 +-
.../weixin/channel/common/ChannelWxError.java | 2 +
.../channel/config/WxChannelConfig.java | 8 +
.../impl/WxChannelDefaultConfigImpl.java | 11 +
.../constant/MessageEventConstants.java | 6 +
.../constant/WxChannelApiUrlConstants.java | 58 +++
.../weixin/channel/enums/BannerType.java | 37 ++
.../channel/enums/PackageAuditItemType.java | 37 ++
.../weixin/channel/enums/ShareScene.java | 13 +-
.../channel/enums/WxChannelErrorMsgEnum.java | 2 +
.../impl/WxChannelBasicServiceImplTest.java | 12 +
.../WxChannelCategoryServiceImplTest.java | 84 ++++-
.../impl/WxChannelOrderServiceImplTest.java | 35 ++
.../impl/WxChannelProductServiceImplTest.java | 56 ++-
.../api/impl/WxChannelVipServiceImplTest.java | 32 ++
.../impl/WxStoreHomePageServiceImplTest.java | 339 ++++++++++++++++++
.../message/WxChannelMessageRouterTest.java | 56 +++
.../weixin/channel/test/ApiTestModule.java | 1 +
.../src/test/resources/test-config.sample.xml | 1 +
.../common/error/WxChannelErrorMsgEnum.java | 172 +++++++++
.../chanjar/weixin/common/error/WxError.java | 7 +
124 files changed, 3961 insertions(+), 229 deletions(-)
create mode 100644 spring-boot-starters/wx-java-channel-spring-boot-starter/README.md
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxStoreHomePageService.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxStoreHomePageServiceImpl.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/audit/CategoryBrand.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/audit/CatsV2.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/delivery/FreshInspectParam.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/delivery/PackageAuditInfo.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/background/BackgroundApplyResponse.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/background/BackgroundApplyResult.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/background/BackgroundGetResponse.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/banner/BannerApplyDetail.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/banner/BannerApplyInfo.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/banner/BannerApplyParam.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/banner/BannerApplyResponse.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/banner/BannerGetResponse.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/banner/BannerInfo.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/banner/BannerItem.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/banner/BannerItemDetail.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/banner/BannerItemFinder.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/banner/BannerItemOfficialAccount.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/banner/BannerItemProduct.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/CatTreeNode.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/LevelTreeInfo.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/OneLevelTreeNode.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/TreeAuditResult.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/TreeAuditResultDetail.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/TreeProductEditInfo.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/TreeProductEditParam.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/TreeProductListInfo.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/TreeProductListParam.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/TreeProductListResponse.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/TreeProductListResult.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/TreeShowGetResponse.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/TreeShowInfo.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/TreeShowParam.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/TreeShowSetResponse.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/window/WindowProductIndexParam.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/window/WindowProductListParam.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/window/WindowProductSetting.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/window/WindowProductSettingResponse.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/message/store/CloseStoreMessage.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/message/store/NicknameUpdateMessage.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/DecodeAddressInfo.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/DecodeSensitiveInfoResponse.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/QualityInsepctInfo.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/RechargeInfo.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/VirtualNumberInfo.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/VirtualTelNumberResponse.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/ProductQuaInfo.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/ProductSaleLimitInfo.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/SkuFastInfo.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/SkuStockBatchList.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/SkuStockBatchParam.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/SkuStockBatchResponse.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/SpuFastInfo.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/SpuSizeChart.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/SpuSizeChartItem.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/SpuStockInfo.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/SpuUpdateInfo.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/link/ProductH5UrlResponse.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/link/ProductQrCodeResponse.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/link/ProductTagLinkResponse.java
rename weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/token/{StableToken.java => StableTokenParam.java} (93%)
rename weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/vip/{VipParam.java => VipOpenIdParam.java} (90%)
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/enums/BannerType.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/enums/PackageAuditItemType.java
create mode 100644 weixin-java-channel/src/test/java/me/chanjar/weixin/channel/api/impl/WxChannelVipServiceImplTest.java
create mode 100644 weixin-java-channel/src/test/java/me/chanjar/weixin/channel/api/impl/WxStoreHomePageServiceImplTest.java
create mode 100644 weixin-java-common/src/main/java/me/chanjar/weixin/common/error/WxChannelErrorMsgEnum.java
diff --git a/solon-plugins/wx-java-channel-multi-solon-plugin/src/main/java/com/binarywang/solon/wxjava/channel/configuration/services/AbstractWxChannelConfiguration.java b/solon-plugins/wx-java-channel-multi-solon-plugin/src/main/java/com/binarywang/solon/wxjava/channel/configuration/services/AbstractWxChannelConfiguration.java
index 5521dff86a..8531d92658 100644
--- a/solon-plugins/wx-java-channel-multi-solon-plugin/src/main/java/com/binarywang/solon/wxjava/channel/configuration/services/AbstractWxChannelConfiguration.java
+++ b/solon-plugins/wx-java-channel-multi-solon-plugin/src/main/java/com/binarywang/solon/wxjava/channel/configuration/services/AbstractWxChannelConfiguration.java
@@ -59,7 +59,7 @@ protected WxChannelMultiServices wxChannelMultiServices(WxChannelMultiProperties
WxChannelDefaultConfigImpl storage = this.wxChannelConfigStorage(wxChannelMultiProperties);
this.configApp(storage, wxChannelSingleProperties);
this.configHttp(storage, wxChannelMultiProperties.getConfigStorage());
- WxChannelService wxChannelService = this.wxChannelService(storage, wxChannelMultiProperties, wxChannelSingleProperties.isUseStableAccessToken());
+ WxChannelService wxChannelService = this.wxChannelService(storage, wxChannelMultiProperties);
services.addWxChannelService(tenantId, wxChannelService);
}
return services;
@@ -73,7 +73,7 @@ protected WxChannelMultiServices wxChannelMultiServices(WxChannelMultiProperties
*/
protected abstract WxChannelDefaultConfigImpl wxChannelConfigStorage(WxChannelMultiProperties wxChannelMultiProperties);
- public WxChannelService wxChannelService(WxChannelConfig wxChannelConfig, WxChannelMultiProperties wxChannelMultiProperties, boolean useStableAccessToken) {
+ public WxChannelService wxChannelService(WxChannelConfig wxChannelConfig, WxChannelMultiProperties wxChannelMultiProperties) {
WxChannelMultiProperties.ConfigStorage storage = wxChannelMultiProperties.getConfigStorage();
HttpClientType httpClientType = storage.getHttpClientType();
WxChannelService wxChannelService;
@@ -82,7 +82,7 @@ public WxChannelService wxChannelService(WxChannelConfig wxChannelConfig, WxChan
// wxChannelService = new WxChannelServiceOkHttpImpl(false, false);
// break;
case HTTP_CLIENT:
- wxChannelService = new WxChannelServiceHttpClientImpl(useStableAccessToken, false);
+ wxChannelService = new WxChannelServiceHttpClientImpl();
break;
default:
wxChannelService = new WxChannelServiceImpl();
@@ -108,6 +108,7 @@ private void configApp(WxChannelDefaultConfigImpl config, WxChannelSinglePropert
String appSecret = wxChannelSingleProperties.getSecret();
String token = wxChannelSingleProperties.getToken();
String aesKey = wxChannelSingleProperties.getAesKey();
+ boolean useStableAccessToken = wxChannelSingleProperties.isUseStableAccessToken();
config.setAppid(appId);
config.setSecret(appSecret);
@@ -117,6 +118,7 @@ private void configApp(WxChannelDefaultConfigImpl config, WxChannelSinglePropert
if (StringUtils.isNotBlank(aesKey)) {
config.setAesKey(aesKey);
}
+ config.setStableAccessToken(useStableAccessToken);
}
private void configHttp(WxChannelDefaultConfigImpl config, WxChannelMultiProperties.ConfigStorage storage) {
diff --git a/solon-plugins/wx-java-channel-solon-plugin/src/main/java/com/binarywang/solon/wxjava/channel/config/storage/AbstractWxChannelConfigStorageConfiguration.java b/solon-plugins/wx-java-channel-solon-plugin/src/main/java/com/binarywang/solon/wxjava/channel/config/storage/AbstractWxChannelConfigStorageConfiguration.java
index 41d002b419..2df3dbf23f 100644
--- a/solon-plugins/wx-java-channel-solon-plugin/src/main/java/com/binarywang/solon/wxjava/channel/config/storage/AbstractWxChannelConfigStorageConfiguration.java
+++ b/solon-plugins/wx-java-channel-solon-plugin/src/main/java/com/binarywang/solon/wxjava/channel/config/storage/AbstractWxChannelConfigStorageConfiguration.java
@@ -15,6 +15,7 @@ protected WxChannelDefaultConfigImpl config(WxChannelDefaultConfigImpl config, W
config.setToken(StringUtils.trimToNull(properties.getToken()));
config.setAesKey(StringUtils.trimToNull(properties.getAesKey()));
config.setMsgDataFormat(StringUtils.trimToNull(properties.getMsgDataFormat()));
+ config.setStableAccessToken(properties.isUseStableAccessToken());
WxChannelProperties.ConfigStorage configStorageProperties = properties.getConfigStorage();
config.setHttpProxyHost(configStorageProperties.getHttpProxyHost());
diff --git a/solon-plugins/wx-java-channel-solon-plugin/src/main/java/com/binarywang/solon/wxjava/channel/properties/WxChannelProperties.java b/solon-plugins/wx-java-channel-solon-plugin/src/main/java/com/binarywang/solon/wxjava/channel/properties/WxChannelProperties.java
index f40aa82115..6562a02e9d 100644
--- a/solon-plugins/wx-java-channel-solon-plugin/src/main/java/com/binarywang/solon/wxjava/channel/properties/WxChannelProperties.java
+++ b/solon-plugins/wx-java-channel-solon-plugin/src/main/java/com/binarywang/solon/wxjava/channel/properties/WxChannelProperties.java
@@ -42,6 +42,11 @@ public class WxChannelProperties {
*/
private String msgDataFormat = "JSON";
+ /**
+ * 是否使用稳定版 Access Token
+ */
+ private boolean useStableAccessToken = false;
+
/**
* 存储策略
*/
diff --git a/spring-boot-starters/wx-java-channel-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/channel/configuration/services/AbstractWxChannelConfiguration.java b/spring-boot-starters/wx-java-channel-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/channel/configuration/services/AbstractWxChannelConfiguration.java
index 2e3f92a5f4..fab65363c4 100644
--- a/spring-boot-starters/wx-java-channel-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/channel/configuration/services/AbstractWxChannelConfiguration.java
+++ b/spring-boot-starters/wx-java-channel-multi-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/channel/configuration/services/AbstractWxChannelConfiguration.java
@@ -59,7 +59,7 @@ protected WxChannelMultiServices wxChannelMultiServices(WxChannelMultiProperties
WxChannelDefaultConfigImpl storage = this.wxChannelConfigStorage(wxChannelMultiProperties);
this.configApp(storage, wxChannelSingleProperties);
this.configHttp(storage, wxChannelMultiProperties.getConfigStorage());
- WxChannelService wxChannelService = this.wxChannelService(storage, wxChannelMultiProperties, wxChannelSingleProperties.isUseStableAccessToken());
+ WxChannelService wxChannelService = this.wxChannelService(storage, wxChannelMultiProperties);
services.addWxChannelService(tenantId, wxChannelService);
}
return services;
@@ -73,7 +73,7 @@ protected WxChannelMultiServices wxChannelMultiServices(WxChannelMultiProperties
*/
protected abstract WxChannelDefaultConfigImpl wxChannelConfigStorage(WxChannelMultiProperties wxChannelMultiProperties);
- public WxChannelService wxChannelService(WxChannelConfig wxChannelConfig, WxChannelMultiProperties wxChannelMultiProperties, boolean useStableAccessToken) {
+ public WxChannelService wxChannelService(WxChannelConfig wxChannelConfig, WxChannelMultiProperties wxChannelMultiProperties) {
WxChannelMultiProperties.ConfigStorage storage = wxChannelMultiProperties.getConfigStorage();
HttpClientType httpClientType = storage.getHttpClientType();
WxChannelService wxChannelService;
@@ -82,7 +82,7 @@ public WxChannelService wxChannelService(WxChannelConfig wxChannelConfig, WxChan
// wxChannelService = new WxChannelServiceOkHttpImpl(false, false);
// break;
case HTTP_CLIENT:
- wxChannelService = new WxChannelServiceHttpClientImpl(useStableAccessToken, false);
+ wxChannelService = new WxChannelServiceHttpClientImpl();
break;
default:
wxChannelService = new WxChannelServiceImpl();
@@ -108,6 +108,7 @@ private void configApp(WxChannelDefaultConfigImpl config, WxChannelSinglePropert
String appSecret = wxChannelSingleProperties.getSecret();
String token = wxChannelSingleProperties.getToken();
String aesKey = wxChannelSingleProperties.getAesKey();
+ boolean useStableAccessToken = wxChannelSingleProperties.isUseStableAccessToken();
config.setAppid(appId);
config.setSecret(appSecret);
@@ -117,6 +118,7 @@ private void configApp(WxChannelDefaultConfigImpl config, WxChannelSinglePropert
if (StringUtils.isNotBlank(aesKey)) {
config.setAesKey(aesKey);
}
+ config.setStableAccessToken(useStableAccessToken);
}
private void configHttp(WxChannelDefaultConfigImpl config, WxChannelMultiProperties.ConfigStorage storage) {
diff --git a/spring-boot-starters/wx-java-channel-spring-boot-starter/README.md b/spring-boot-starters/wx-java-channel-spring-boot-starter/README.md
new file mode 100644
index 0000000000..058a957359
--- /dev/null
+++ b/spring-boot-starters/wx-java-channel-spring-boot-starter/README.md
@@ -0,0 +1,103 @@
+# wx-java-channel-spring-boot-starter
+
+## 快速开始
+1. 引入依赖
+ ```xml
+
+
+ com.github.binarywang
+ wx-java-channel-multi-spring-boot-starter
+ ${version}
+
+
+
+
+ redis.clients
+ jedis
+ ${jedis.version}
+
+
+
+
+ org.redisson
+ redisson
+ ${redisson.version}
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter-data-redis
+
+
+ ```
+2. 添加配置(application.properties)
+ ```properties
+ # 视频号配置(必填)
+ ## 视频号小店的appId和secret
+ wx.channel.app-id=@appId
+ wx.channel.secret=@secret
+ # 视频号配置 选填
+ ## 设置视频号小店消息服务器配置的token
+ wx.channel.token=@token
+ ## 设置视频号小店消息服务器配置的EncodingAESKey
+ wx.channel.aes-key=
+ ## 支持JSON或者XML格式,默认JSON
+ wx.channel.msg-data-format=JSON
+ ## 是否使用稳定版 Access Token
+ wx.channel.use-stable-access-token=false
+
+
+ # ConfigStorage 配置(选填)
+ ## 配置类型: memory(默认), jedis, redisson, redis_template
+ wx.channel.config-storage.type=memory
+ ## 相关redis前缀配置: wx:channel(默认)
+ wx.channel.config-storage.key-prefix=wx:channel
+ wx.channel.config-storage.redis.host=127.0.0.1
+ wx.channel.config-storage.redis.port=6379
+ wx.channel.config-storage.redis.password=123456
+
+ # redis_template 方式使用spring data redis配置
+ spring.data.redis.database=0
+ spring.data.redis.host=127.0.0.1
+ spring.data.redis.password=123456
+ spring.data.redis.port=6379
+
+ # http 客户端配置(选填)
+ ## # http客户端类型: http_client(默认)
+ wx.channel.config-storage.http-client-type=http_client
+ wx.channel.config-storage.http-proxy-host=
+ wx.channel.config-storage.http-proxy-port=
+ wx.channel.config-storage.http-proxy-username=
+ wx.channel.config-storage.http-proxy-password=
+ ## 最大重试次数,默认:5 次,如果小于 0,则为 0
+ wx.channel.config-storage.max-retry-times=5
+ ## 重试时间间隔步进,默认:1000 毫秒,如果小于 0,则为 1000
+ wx.channel.config-storage.retry-sleep-millis=1000
+ ```
+3. 自动注入的类型
+- `WxChannelService`
+- `WxChannelConfig`
+4. 使用样例
+```java
+import me.chanjar.weixin.channel.api.WxChannelService;
+import me.chanjar.weixin.channel.bean.shop.ShopInfoResponse;
+import me.chanjar.weixin.channel.util.JsonUtils;
+import me.chanjar.weixin.common.error.WxErrorException;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class DemoService {
+ @Autowired
+ private WxChannelService wxChannelService;
+
+ public String getShopInfo() throws WxErrorException {
+ // 获取店铺基本信息
+ ShopInfoResponse response = wxChannelService.getBasicService().getShopInfo();
+ // 此处为演示,如果要返回response的结果,建议自己封装一个VO,避免直接返回response
+ return JsonUtils.encode(response);
+ }
+}
+```
+
diff --git a/spring-boot-starters/wx-java-channel-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/channel/config/storage/AbstractWxChannelConfigStorageConfiguration.java b/spring-boot-starters/wx-java-channel-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/channel/config/storage/AbstractWxChannelConfigStorageConfiguration.java
index a87028a1cd..d554c31eca 100644
--- a/spring-boot-starters/wx-java-channel-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/channel/config/storage/AbstractWxChannelConfigStorageConfiguration.java
+++ b/spring-boot-starters/wx-java-channel-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/channel/config/storage/AbstractWxChannelConfigStorageConfiguration.java
@@ -15,6 +15,7 @@ protected WxChannelDefaultConfigImpl config(WxChannelDefaultConfigImpl config, W
config.setToken(StringUtils.trimToNull(properties.getToken()));
config.setAesKey(StringUtils.trimToNull(properties.getAesKey()));
config.setMsgDataFormat(StringUtils.trimToNull(properties.getMsgDataFormat()));
+ config.setStableAccessToken(properties.isUseStableAccessToken());
WxChannelProperties.ConfigStorage configStorageProperties = properties.getConfigStorage();
config.setHttpProxyHost(configStorageProperties.getHttpProxyHost());
diff --git a/spring-boot-starters/wx-java-channel-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/channel/properties/WxChannelProperties.java b/spring-boot-starters/wx-java-channel-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/channel/properties/WxChannelProperties.java
index 98f1f3b723..f2628b2ec3 100644
--- a/spring-boot-starters/wx-java-channel-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/channel/properties/WxChannelProperties.java
+++ b/spring-boot-starters/wx-java-channel-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/channel/properties/WxChannelProperties.java
@@ -41,6 +41,11 @@ public class WxChannelProperties {
*/
private String msgDataFormat = "JSON";
+ /**
+ * 是否使用稳定版 Access Token
+ */
+ private boolean useStableAccessToken = false;
+
/**
* 存储策略
*/
diff --git a/weixin-java-channel/pom.xml b/weixin-java-channel/pom.xml
index 8bce32841f..c8a2668747 100644
--- a/weixin-java-channel/pom.xml
+++ b/weixin-java-channel/pom.xml
@@ -11,10 +11,10 @@
weixin-java-channel
WxJava - Channel Java SDK
- 微信视频号 Java SDK
+ 微信视频号/微信小店 Java SDK
- 2.15.0
+ 2.18.1
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/BaseWxChannelMessageService.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/BaseWxChannelMessageService.java
index a4a2c4240e..c107cc85cd 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/BaseWxChannelMessageService.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/BaseWxChannelMessageService.java
@@ -20,6 +20,8 @@
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.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;
@@ -55,6 +57,7 @@ Object route(final WxChannelMessage message, final String content, final String
* 订单下单
*
* @param message 消息
+ * @param content 消息原始内容
* @param appId appId
* @param context 上下文
* @param sessionManager session管理器
@@ -66,6 +69,7 @@ void orderNew(final OrderIdMessage message, final String content, final String a
* 订单取消
*
* @param message 消息
+ * @param content 消息原始内容
* @param appId appId
* @param context 上下文
* @param sessionManager session管理器
@@ -77,6 +81,7 @@ void orderCancel(OrderCancelMessage message, final String content, final String
* 订单支付成功
*
* @param message 消息
+ * @param content 消息原始内容
* @param appId appId
* @param context 上下文
* @param sessionManager session管理器
@@ -88,6 +93,7 @@ void orderPay(OrderPayMessage message, final String content, final String appId,
* 订单发货
*
* @param message 消息
+ * @param content 消息原始内容
* @param appId appId
* @param context 上下文
* @param sessionManager session管理器
@@ -99,6 +105,7 @@ void orderDelivery(OrderDeliveryMessage message, final String content, final Str
* 订单确认收货
*
* @param message 消息
+ * @param content 消息原始内容
* @param appId appId
* @param context 上下文
* @param sessionManager session管理器
@@ -110,6 +117,7 @@ void orderConfirm(OrderConfirmMessage message, final String content, final Strin
* 订单结算成功
*
* @param message 消息
+ * @param content 消息原始内容
* @param appId appId
* @param context 上下文
* @param sessionManager session管理器
@@ -121,6 +129,7 @@ void orderSettle(OrderSettleMessage message, final String content, final String
* 订单其他信息更新
*
* @param message 消息
+ * @param content 消息原始内容
* @param appId appId
* @param context 上下文
* @param sessionManager session管理器
@@ -132,6 +141,7 @@ void orderExtInfoUpdate(OrderExtMessage message, final String content, final Str
* 订单状态更新
*
* @param message 消息
+ * @param content 消息原始内容
* @param appId appId
* @param context 上下文
* @param sessionManager session管理器
@@ -143,6 +153,7 @@ void orderStatusUpdate(OrderStatusMessage message, final String content, final S
* 商品审核结果
*
* @param message 消息
+ * @param content 消息原始内容
* @param appId appId
* @param context 上下文
* @param sessionManager session管理器
@@ -154,6 +165,7 @@ void spuAudit(SpuAuditMessage message, final String content, final String appId,
* 商品系统下架通知
*
* @param message 消息
+ * @param content 消息原始内容
* @param appId appId
* @param context 上下文
* @param sessionManager session管理器
@@ -165,6 +177,7 @@ void spuStatusUpdate(SpuAuditMessage message, final String content, final String
* 商品更新通知
*
* @param message 消息
+ * @param content 消息原始内容
* @param appId appId
* @param context 上下文
* @param sessionManager session管理器
@@ -176,6 +189,7 @@ void spuUpdate(SpuAuditMessage message, final String content, final String appId
* 类目审核结果
*
* @param message 消息
+ * @param content 消息原始内容
* @param appId appId
* @param context 上下文
* @param sessionManager session管理器
@@ -187,6 +201,7 @@ void categoryAudit(CategoryAuditMessage message, final String content, final Str
* 品牌更新
*
* @param message 消息
+ * @param content 消息原始内容
* @param appId appId
* @param context 上下文
* @param sessionManager session管理器
@@ -198,6 +213,7 @@ void brandUpdate(BrandMessage message, final String content, final String appId,
* 售后单状态更新
*
* @param message 消息
+ * @param content 消息原始内容
* @param appId appId
* @param context 上下文
* @param sessionManager session管理器
@@ -209,6 +225,7 @@ void afterSaleStatusUpdate(AfterSaleMessage message, final String content, final
* 纠纷回调
*
* @param message 消息
+ * @param content 消息原始内容
* @param appId appId
* @param context 上下文
* @param sessionManager session管理器
@@ -220,6 +237,7 @@ void complaintNotify(ComplaintMessage message, final String content, final Strin
* 用户领券通知
*
* @param message 消息
+ * @param content 消息原始内容
* @param appId appId
* @param context 上下文
* @param sessionManager session管理器
@@ -231,6 +249,7 @@ void couponReceive(CouponReceiveMessage message, final String content, final Str
* 创建优惠券通知
*
* @param message 消息
+ * @param content 消息原始内容
* @param appId appId
* @param context 上下文
* @param sessionManager session管理器
@@ -242,6 +261,7 @@ void couponCreate(CouponActionMessage message, final String content, final Strin
* 优惠券删除通知
*
* @param message 消息
+ * @param content 消息原始内容
* @param appId appId
* @param context 上下文
* @param sessionManager session管理器
@@ -253,6 +273,7 @@ void couponDelete(CouponActionMessage message, final String content, final Strin
* 优惠券过期通知
*
* @param message 消息
+ * @param content 消息原始内容
* @param appId appId
* @param context 上下文
* @param sessionManager session管理器
@@ -264,6 +285,7 @@ void couponExpire(CouponActionMessage message, final String content, final Strin
* 更新优惠券信息通知
*
* @param message 消息
+ * @param content 消息原始内容
* @param appId appId
* @param context 上下文
* @param sessionManager session管理器
@@ -275,6 +297,7 @@ void couponUpdate(CouponActionMessage message, final String content, final Strin
* 优惠券作废通知
*
* @param message 消息
+ * @param content 消息原始内容
* @param appId appId
* @param context 上下文
* @param sessionManager session管理器
@@ -286,6 +309,7 @@ void couponInvalid(CouponActionMessage message, final String content, final Stri
* 用户优惠券过期通知
*
* @param message 消息
+ * @param content 消息原始内容
* @param appId appId
* @param context 上下文
* @param sessionManager session管理器
@@ -297,6 +321,7 @@ void userCouponExpire(UserCouponExpireMessage message, final String content, fin
* 用户优惠券使用通知
*
* @param message 消息
+ * @param content 消息原始内容
* @param appId appId
* @param context 上下文
* @param sessionManager session管理器
@@ -308,6 +333,7 @@ void userCouponUse(UserCouponExpireMessage message, final String content, final
* 用户优惠券返还通知
*
* @param message 消息
+ * @param content 消息原始内容
* @param appId appId
* @param context 上下文
* @param sessionManager session管理器
@@ -319,6 +345,7 @@ void userCouponUnuse(UserCouponExpireMessage message, final String content, fina
* 结算账户变更回调
*
* @param message 消息
+ * @param content 消息原始内容
* @param appId appId
* @param context 上下文
* @param sessionManager session管理器
@@ -330,6 +357,7 @@ void accountNotify(AccountNotifyMessage message, final String content, final Str
* 提现回调
*
* @param message 消息
+ * @param content 消息原始内容
* @param appId appId
* @param context 上下文
* @param sessionManager session管理器
@@ -341,6 +369,7 @@ void withdrawNotify(WithdrawNotifyMessage message, final String content, final S
* 提现二维码回调
*
* @param message 消息
+ * @param content 消息原始内容
* @param appId appId
* @param context 上下文
* @param sessionManager session管理器
@@ -352,6 +381,7 @@ void qrNotify(QrNotifyMessage message, final String content, final String appId,
* 团长商品变更
*
* @param message 消息
+ * @param content 消息原始内容
* @param appId appId
* @param context 上下文
* @param sessionManager session管理器
@@ -420,12 +450,36 @@ void vipScoreUpdate(UserInfoMessage message, final String content, final String
void vipScoreExchange(ExchangeInfoMessage message, final String content, final String appId,
final Map context, final WxSessionManager sessionManager);
+ /**
+ * 小店注销
+ *
+ * @param message 消息
+ * @param content 消息原始内容
+ * @param appId appId
+ * @param context 上下文
+ * @param sessionManager session管理器
+ */
+ void closeStore(CloseStoreMessage message, final String content, final String appId,
+ final Map context, final WxSessionManager sessionManager);
+
+
+ /**
+ * 小店修改名称
+ *
+ * @param message 消息
+ * @param content 消息原始内容
+ * @param appId appId
+ * @param context 上下文
+ * @param sessionManager session管理器
+ */
+ void updateNickname(NicknameUpdateMessage message, final String content, final String appId,
+ final Map context, final WxSessionManager sessionManager);
/**
* 默认消息处理
*
* @param message 消息
- * @param content 内容
+ * @param content 消息原始内容
* @param appId appId
* @param context 上下文
* @param sessionManager session管理器
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/BaseWxChannelService.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/BaseWxChannelService.java
index f745ff3e41..f9f4cbed68 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/BaseWxChannelService.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/BaseWxChannelService.java
@@ -41,8 +41,7 @@ public interface BaseWxChannelService extends WxService {
*
* 获取access_token,本方法线程安全.
* 且在多线程同时刷新时只刷新一次,避免超出2000次/日的调用次数上限
- *
- * 另:本service的所有方法都会在access_token过期是调用此方法
+ * 使用【稳定版接口】获取access_token时,限制【20次/日】,连续使用该模式时,请保证调用时间隔至少为30s,否则不会刷新
*
* 程序员在非必要情况下尽量不要主动调用此方法
*
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..0b357a5d1c 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,17 +4,20 @@
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.ShopCategoryResponse;
import me.chanjar.weixin.common.error.WxErrorException;
/**
* 视频号小店 商品类目相关接口
*
* @author Zeyes
+ * @see 新旧类目树差异
*/
public interface WxChannelCategoryService {
@@ -30,12 +33,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 +76,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;
+
/**
* 取消类目提审
*
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 6179510e78..d426a39805 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,17 @@
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.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.VirtualTelNumberResponse;
import me.chanjar.weixin.common.error.WxErrorException;
/**
@@ -143,4 +146,37 @@ 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;
}
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..7064adf70f 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,21 +1,29 @@
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.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 商品状态流转图
*/
public interface WxChannelProductService {
@@ -27,6 +35,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 +66,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 +170,42 @@ 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;
+
/**
* 添加限时抢购任务
*
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 48d82206b3..89f6b00964 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
@@ -91,6 +91,13 @@ public interface WxChannelService extends BaseWxChannelService {
*/
WxChannelFundService getFundService();
+ /**
+ * 主页管理服务
+ *
+ * @return 主页管理服务
+ */
+ WxStoreHomePageService getHomePageService();
+
/**
* 优选联盟-团长合作达人管理服务
*
@@ -140,7 +147,6 @@ public interface WxChannelService extends BaseWxChannelService {
*/
WxAssistantService getAssistantService();
-
/**
* 会员功能
*
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
index 0909844f06..4100659200 100644
--- 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
@@ -45,11 +45,11 @@ public interface WxChannelVipService {
*
* @param needPhoneNumber the need phone number
* @param pageNum the page num
- * @param PageSize the page size
+ * @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;
+ VipListResponse getVipList(Boolean needPhoneNumber, Integer pageNum, Integer pageSize) 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..bd11e471b3
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxStoreHomePageService.java
@@ -0,0 +1,188 @@
+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
+ */
+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/impl/BaseWxChannelMessageServiceImpl.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/BaseWxChannelMessageServiceImpl.java
index 46837deba8..200021b37d 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
@@ -24,6 +24,8 @@
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.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;
@@ -111,7 +113,6 @@ protected void addDefaultRule() {
/* 团长 */
this.addRule(SupplierItemMessage.class, SUPPLIER_ITEM_UPDATE, this::supplierItemUpdate);
-
/* 用户加入会员 */
this.addRule(UserInfoMessage.class, USER_VIP_JOIN, false, this::vipJoin);
/* 用户注销会员 */
@@ -123,9 +124,13 @@ protected void addDefaultRule() {
/* 用户积分兑换 */
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);
}
/**
@@ -344,22 +349,44 @@ public void sharerChange(WxChannelMessage message, String content, String appId,
}
@Override
- public abstract void vipJoin(UserInfoMessage message, String content, String appId,
- Map context, WxSessionManager sessionManager);
+ 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 abstract void vipClose(UserInfoMessage message, String content, String appId,
- Map context, WxSessionManager sessionManager);
+ public void vipScoreUpdate(UserInfoMessage message, String content, String appId,
+ Map context, WxSessionManager sessionManager) {
+ log.info("用户积分更新:{}", JsonUtils.encode(message));
+ }
@Override
- public abstract void vipGradeUpdate(UserInfoMessage message, String content, String appId,
- Map context, WxSessionManager sessionManager);
+ public void vipScoreExchange(ExchangeInfoMessage message, String content, String appId,
+ Map context, WxSessionManager sessionManager) {
+ log.info("用户积分兑换:{}", JsonUtils.encode(message));
+ }
@Override
- public abstract void vipScoreUpdate(UserInfoMessage message, String content, String appId,
- Map context, WxSessionManager sessionManager);
+ public void closeStore(CloseStoreMessage message, String content, String appId,
+ Map context, WxSessionManager sessionManager) {
+ log.info("小店注销:{}", JsonUtils.encode(message));
+ }
@Override
- public abstract void vipScoreExchange(ExchangeInfoMessage message, String content, String appId,
- Map context, WxSessionManager sessionManager);
+ 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 c9f874c99e..ee4625c1a3 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
@@ -47,6 +47,7 @@ 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 WxLeagueWindowService leagueWindowService = null;
private WxLeagueSupplierService leagueSupplierService = null;
private WxLeaguePromoterService leaguePromoterService = null;
@@ -54,7 +55,7 @@ public abstract class BaseWxChannelServiceImpl implements WxChannelService
private WxLeadComponentService leadComponentService = null;
private WxFinderLiveService finderLiveService = null;
private WxAssistantService assistantService = null;
- private WxChannelVipService vipService = new WxChannelVipServiceImpl(this);
+ private WxChannelVipService vipService = null;
private final WxChannelCompassFinderService compassFinderService =
new WxChannelCompassFinderServiceImpl(this);
private final WxChannelLiveDashboardService liveDashboardService =
@@ -99,9 +100,14 @@ 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 (WxErrorException | InterruptedException e) {
+ } catch (IOException | InterruptedException e) {
throw new WxRuntimeException(e);
} finally {
if (locked) {
@@ -113,10 +119,18 @@ 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 doGetAccessTokenRequest() throws WxErrorException;
+ protected abstract String doGetStableAccessTokenRequest(boolean forceRefresh) throws IOException;
@Override
public String get(String url, String queryParam) throws WxErrorException {
@@ -262,9 +276,9 @@ protected T executeInternal(RequestExecutor executor, String uri, E
* @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);
}
@@ -354,6 +368,14 @@ public WxChannelFundService getFundService() {
return fundService;
}
+ @Override
+ public synchronized WxStoreHomePageService getHomePageService() {
+ if (homePageService == null) {
+ homePageService = new WxStoreHomePageServiceImpl(this);
+ }
+ return homePageService;
+ }
+
@Override
public synchronized WxLeagueWindowService getLeagueWindowService() {
if (leagueWindowService == null) {
@@ -413,6 +435,9 @@ public WxAssistantService getAssistantService() {
@Override
public WxChannelVipService getVipService() {
+ if (vipService == null) {
+ vipService = new WxChannelVipServiceImpl(this);
+ }
return vipService;
}
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..e5940e9879 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
@@ -66,6 +66,14 @@ 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;
@@ -89,7 +97,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 +110,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 + "\"}");
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 65eec5dd29..e98294d189 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
@@ -9,10 +9,13 @@
import me.chanjar.weixin.channel.api.WxChannelOrderService;
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.delivery.DeliverySendParam;
+import me.chanjar.weixin.channel.bean.delivery.FreshInspectParam;
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.OrderIdParam;
@@ -22,6 +25,7 @@
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.VirtualTelNumberResponse;
import me.chanjar.weixin.channel.util.ResponseUtils;
import me.chanjar.weixin.common.error.WxErrorException;
@@ -122,4 +126,26 @@ 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);
+ }
}
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..bb131d2eaa 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
@@ -6,16 +6,22 @@
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.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_DELISTING_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.SPU_DEL_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_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_QRCODE_URL;
+import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.SPU_TAGLINK_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Spu.SPU_UPDATE_STOCK_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.List;
import lombok.extern.slf4j.Slf4j;
import me.chanjar.weixin.channel.api.WxChannelProductService;
import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
@@ -23,13 +29,20 @@
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.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.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;
@@ -49,6 +62,20 @@ public WxChannelProductServiceImpl(BaseWxChannelServiceImpl shopService) {
this.shopService = shopService;
}
+ @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
public SpuUpdateResponse addProduct(SpuInfo info) throws WxErrorException {
String reqJson = JsonUtils.encode(info);
@@ -63,6 +90,13 @@ 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 {
@@ -148,6 +182,35 @@ public SkuStockResponse getSkuStock(String productId, String skuId) throws WxErr
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 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 LimitTaskAddResponse addLimitTask(LimitTaskParam param) throws WxErrorException {
String reqJson = JsonUtils.encode(param);
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 e0cb767619..d4b5afde0c 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
@@ -5,22 +5,20 @@
import java.io.IOException;
import lombok.extern.slf4j.Slf4j;
-import me.chanjar.weixin.channel.api.WxChannelVipService;
-import me.chanjar.weixin.channel.bean.token.StableToken;
+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.error.WxErrorException;
import me.chanjar.weixin.common.util.http.HttpType;
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.Consts;
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.client.methods.HttpPost;
+import org.apache.http.entity.ContentType;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.BasicResponseHandler;
import org.apache.http.impl.client.CloseableHttpClient;
@@ -33,19 +31,6 @@ public class WxChannelServiceHttpClientImpl extends BaseWxChannelServiceImpl {
private OkHttpClient httpClient;
private OkHttpProxyInfo httpProxy;
- private Boolean stabled = false;
- private Boolean forceRefresh = false;
- protected final Object globalAccessTokenRefreshLock = new Object();
- /**
- * 设置调用接口参数.
- *
- * @param stabled false 表示调用AccessToken接口, true调用稳定版接口
- * @param forceRefresh stabled=true使用, true表示强制刷新模式
- */
- public WxChannelServiceOkHttpImpl(Boolean stabled, Boolean forceRefresh) {
- this.stabled = stabled;
- this.forceRefresh = forceRefresh;
+ public WxChannelServiceOkHttpImpl() {
}
@Override
@@ -79,76 +70,40 @@ public HttpType getRequestType() {
}
@Override
- protected String doGetAccessTokenRequest() throws WxErrorException {
- if (stabled) {
- return internalGetStableAccessToken(this.forceRefresh);
- } else{
- return internalGetAccessToken(forceRefresh);
- }
- }
-
- public String internalGetStableAccessToken(boolean forceRefresh) throws WxErrorException {
- if (!this.config.isAccessTokenExpired() && !forceRefresh) {
- return this.config.getAccessToken();
- } else {
- synchronized(this.globalAccessTokenRefreshLock) {
- OkHttpClient client = this.getRequestHttpClient();
-
- String url = String.format(GET_STABLE_ACCESS_TOKEN_URL, config.getAppid(), config.getSecret());
+ 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;
- StableToken stableToken = new StableToken("client_credential", config.getAppid(),config.getSecret(), forceRefresh);
+ url = String.format(url, config.getAppid(), config.getSecret());
- RequestBody body = RequestBody.Companion.create(JsonUtils.encode(stableToken), MediaType.parse("application/json; charset=utf-8"));
-
- Request request = (new Request.Builder()).url(url).post(body).build();
- String resultContent = null;
- try {
- Response response = client.newCall(request).execute();
- resultContent = response.body().string();
- } catch (IOException var9) {
- log.error(var9.getMessage(), var9);
- }
-
- WxError error = WxError.fromJson(resultContent, WxType.CP);
- if (error.getErrorCode() != 0) {
- throw new WxErrorException(error);
- }
-
- WxAccessToken accessToken = WxAccessToken.fromJson(resultContent);
- this.config.updateAccessToken(accessToken.getAccessToken(), accessToken.getExpiresIn());
- }
- return this.config.getAccessToken();
+ Request request = new Request.Builder().url(url).get().build();
+ try (Response response = getRequestHttpClient().newCall(request).execute()) {
+ return Objects.requireNonNull(response.body()).string();
}
}
- public String internalGetAccessToken(boolean forceRefresh) throws WxErrorException {
- if (!this.config.isAccessTokenExpired() && !forceRefresh) {
- return this.config.getAccessToken();
- } else {
- synchronized(this.globalAccessTokenRefreshLock) {
- OkHttpClient client = this.getRequestHttpClient();
-
- String url = String.format(GET_ACCESS_TOKEN_URL, config.getAppid(), config.getSecret());
-
- Request request = (new Request.Builder()).url(url).get().build();
-
- String resultContent = null;
- try {
- Response response = client.newCall(request).execute();
- resultContent = response.body().string();
- } catch (IOException var9) {
- log.error(var9.getMessage(), var9);
- }
-
- WxError error = WxError.fromJson(resultContent, WxType.CP);
- if (error.getErrorCode() != 0) {
- throw new WxErrorException(error);
- }
-
- WxAccessToken accessToken = WxAccessToken.fromJson(resultContent);
- this.config.updateAccessToken(accessToken.getAccessToken(), accessToken.getExpiresIn());
- }
- return this.config.getAccessToken();
+ @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/WxChannelVipServiceImpl.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelVipServiceImpl.java
index 1bad47593d..c06e7ff7a4 100644
--- 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
@@ -18,51 +18,51 @@
@Slf4j
public class WxChannelVipServiceImpl implements WxChannelVipService {
- private BaseWxChannelServiceImpl vipHttpService;
+ private BaseWxChannelServiceImpl shopService;
- public WxChannelVipServiceImpl(BaseWxChannelServiceImpl vipHttpService) {
- this.vipHttpService = vipHttpService;
+ 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 = vipHttpService.post(VIP_USER_INFO_URL, param);
+ 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 = vipHttpService.post(VIP_USER_LIST_URL, param);
+ 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 {
- VipParam param = new VipParam(openId);
- String respJson = vipHttpService.post(VIP_SCORE_URL, param);
+ 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 = vipHttpService.post(SCORE_INCREASE_URL, param);
+ 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 = vipHttpService.post(SCORE_DECREASE_URL, param);
+ 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 = vipHttpService.post(GRADE_UPDATE_URL, param);
+ 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/WxStoreHomePageServiceImpl.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxStoreHomePageServiceImpl.java
new file mode 100644
index 0000000000..b5f3038e98
--- /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/bean/audit/CategoryAuditInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/audit/CategoryAuditInfo.java
index 72a84bc922..485092704d 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;
@@ -15,6 +16,7 @@
@Data
@NoArgsConstructor
@AllArgsConstructor
+@JsonInclude(JsonInclude.Include.NON_NULL)
public class CategoryAuditInfo implements Serializable {
private static final long serialVersionUID = -8792967130645424788L;
@@ -31,7 +33,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/CategoryBrand.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/audit/CategoryBrand.java
new file mode 100644
index 0000000000..632096e4d2
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/audit/CategoryBrand.java
@@ -0,0 +1,23 @@
+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
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+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..b7cc6f39bc
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/audit/CatsV2.java
@@ -0,0 +1,22 @@
+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
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+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/category/CategoryDetailResult.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/category/CategoryDetailResult.java
index 8819e94312..a59559fb6c 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
@@ -74,6 +74,34 @@ 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("product_qua_list")
+ private List productQuaList;
}
@Data
@@ -93,11 +121,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 +149,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 +173,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..40258e067f 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;
@@ -24,8 +25,18 @@ public class CategoryQualification implements Serializable {
@JsonProperty("qua")
private QualificationInfo info;
- /** 商品资质信息 */
+ /** 商品资质信息,将废弃,使用product_qua_list代替 */
@JsonProperty("product_qua")
+ @Deprecated
private QualificationInfo productInfo;
+ /** 品牌资质信息 */
+ @JsonProperty("brand_qua")
+ @Deprecated
+ private QualificationInfo brandQua;
+
+ /** 商品资质列表,替代product_qua */
+ @JsonProperty("product_qua_list")
+ private List productQuaList;
+
}
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..cbd588ebf9 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
@@ -22,4 +22,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/QualificationInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/category/QualificationInfo.java
index 197ac46528..efb7249fe3 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
@@ -29,4 +29,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/ShopCategory.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/category/ShopCategory.java
index b36edfa9e2..5dd04582f3 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
@@ -29,4 +29,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..fff7362a7a 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
@@ -23,5 +23,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/delivery/FreshInspectParam.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/delivery/FreshInspectParam.java
new file mode 100644
index 0000000000..a6db90f2f9
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/delivery/FreshInspectParam.java
@@ -0,0 +1,31 @@
+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
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@JsonInclude(Include.NON_NULL)
+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..bbb4e6c484
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/delivery/PackageAuditInfo.java
@@ -0,0 +1,32 @@
+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 Zeyes
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class PackageAuditInfo implements Serializable {
+ private static final long serialVersionUID = 1118087167138310282L;
+
+ /**
+ * 审核项名称,枚举类型参考 {@link PackageAuditItemType}
+ * 使用方法:DeliveryAuditItemType.EXPRESS_PIC.getKey()
+ */
+ @JsonProperty("item_name")
+ private String itemName;
+
+ /** 图片/视频url */
+ @JsonProperty("item_value")
+ private String itemValue;
+
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/background/BackgroundApplyResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/background/BackgroundApplyResponse.java
new file mode 100644
index 0000000000..b0d8769874
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/background/BackgroundApplyResponse.java
@@ -0,0 +1,25 @@
+package me.chanjar.weixin.channel.bean.home.background;
+
+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 BackgroundApplyResponse extends WxChannelBaseResponse {
+
+ private static final long serialVersionUID = -5627456997199822109L;
+
+ /** 申请编号 */
+ @JsonProperty("apply_id")
+ private Integer applyId;
+
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/background/BackgroundApplyResult.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/background/BackgroundApplyResult.java
new file mode 100644
index 0000000000..45ca4ac1dd
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/background/BackgroundApplyResult.java
@@ -0,0 +1,35 @@
+package me.chanjar.weixin.channel.bean.home.background;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 背景图审核信息
+ *
+ * @author Zeyes
+ */
+@Data
+@NoArgsConstructor
+public class BackgroundApplyResult implements Serializable {
+
+ private static final long serialVersionUID = 3154900058221168732L;
+
+ /** 申请编号 */
+ @JsonProperty("apply_id")
+ private Integer applyId;
+
+ /** 申请状态。1审核中 2审核驳回 */
+ @JsonProperty("state")
+ private Integer state;
+
+ /** 审核结果描述。state为审核驳回时有值。 */
+ @JsonProperty("audit_desc")
+ private String auditDesc;
+
+ /** 图片url */
+ @JsonProperty("img_url")
+ private String imgUrl;
+
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/background/BackgroundGetResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/background/BackgroundGetResponse.java
new file mode 100644
index 0000000000..a0fbf33a80
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/background/BackgroundGetResponse.java
@@ -0,0 +1,28 @@
+package me.chanjar.weixin.channel.bean.home.background;
+
+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 BackgroundGetResponse extends WxChannelBaseResponse {
+
+ private static final long serialVersionUID = -9158761351220981959L;
+
+ /** 当前生效的背景图片url */
+ @JsonProperty("img_url")
+ private String imgUrl;
+
+ /** 背景图审核信息 */
+ @JsonProperty("apply")
+ private BackgroundApplyResult apply;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/banner/BannerApplyDetail.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/banner/BannerApplyDetail.java
new file mode 100644
index 0000000000..e9e58057fd
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/banner/BannerApplyDetail.java
@@ -0,0 +1,33 @@
+package me.chanjar.weixin.channel.bean.home.banner;
+
+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.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 精选展示位申请详情
+ *
+ * @author Zeyes
+ */
+@Data
+@NoArgsConstructor
+@JsonInclude(Include.NON_NULL)
+public class BannerApplyDetail implements Serializable {
+
+ private static final long serialVersionUID = -4622897527243343862L;
+
+ /** 审核状态。 1-审核中;2-审核驳回 */
+ @JsonProperty("audit_state")
+ private Integer auditState;
+
+ /** 审核结果描述。audit_state为驳回时有值。 */
+ @JsonProperty("audit_desc")
+ private String auditDesc;
+
+ /** 精选展示位申请明细 */
+ @JsonProperty("banner")
+ private BannerItem banner;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/banner/BannerApplyInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/banner/BannerApplyInfo.java
new file mode 100644
index 0000000000..651c5c76fe
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/banner/BannerApplyInfo.java
@@ -0,0 +1,35 @@
+package me.chanjar.weixin.channel.bean.home.banner;
+
+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 BannerApplyInfo implements Serializable {
+
+ private static final long serialVersionUID = 72190625450999960L;
+
+ /** 申请编号 */
+ @JsonProperty("apply_id")
+ private Integer applyId;
+
+ /** 申请状态 1-审核中;2-审核驳回 */
+ @JsonProperty("state")
+ private Integer state;
+
+ /** 展示位的展示样式 1-小图模式;2-大图模式 */
+ @JsonProperty("scale")
+ private Integer scale;
+
+ /** 精选展示位申请明细 */
+ @JsonProperty("banner")
+ private List banner;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/banner/BannerApplyParam.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/banner/BannerApplyParam.java
new file mode 100644
index 0000000000..04c7abc2a7
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/banner/BannerApplyParam.java
@@ -0,0 +1,28 @@
+package me.chanjar.weixin.channel.bean.home.banner;
+
+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;
+
+/**
+ * 精选展示位申请参数
+ *
+ * @author Zeyes
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@JsonInclude(Include.NON_NULL)
+public class BannerApplyParam implements Serializable {
+
+ private static final long serialVersionUID = 9083668032979490150L;
+
+ /** banner */
+ @JsonProperty("banner")
+ private BannerInfo banner;
+
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/banner/BannerApplyResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/banner/BannerApplyResponse.java
new file mode 100644
index 0000000000..f83f119d13
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/banner/BannerApplyResponse.java
@@ -0,0 +1,25 @@
+package me.chanjar.weixin.channel.bean.home.banner;
+
+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 BannerApplyResponse extends WxChannelBaseResponse {
+
+ private static final long serialVersionUID = -2194587734444499201L;
+
+ /** 申请编号 */
+ @JsonProperty("apply_id")
+ private Integer applyId;
+
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/banner/BannerGetResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/banner/BannerGetResponse.java
new file mode 100644
index 0000000000..1c6a920636
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/banner/BannerGetResponse.java
@@ -0,0 +1,28 @@
+package me.chanjar.weixin.channel.bean.home.banner;
+
+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 BannerGetResponse extends WxChannelBaseResponse {
+
+ private static final long serialVersionUID = -1563254921362215934L;
+
+ /** 当前生效的展示位 */
+ @JsonProperty("banner")
+ private BannerInfo banner;
+
+ /** 最近一次流程中的申请。不返回已生效或已撤销的申请 */
+ @JsonProperty("apply")
+ private BannerApplyInfo apply;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/banner/BannerInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/banner/BannerInfo.java
new file mode 100644
index 0000000000..24b501a97d
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/banner/BannerInfo.java
@@ -0,0 +1,31 @@
+package me.chanjar.weixin.channel.bean.home.banner;
+
+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;
+
+/**
+ * 精选展示位
+ *
+ * @author Zeyes
+ */
+@Data
+@NoArgsConstructor
+@JsonInclude(Include.NON_NULL)
+public class BannerInfo implements Serializable {
+
+ private static final long serialVersionUID = -2003175482038217418L;
+
+ /** 展示位的展示样式 1-小图模式;2-大图模式 */
+ @JsonProperty("scale")
+ private Integer scale;
+
+ /** 精选展示位明细 */
+ @JsonProperty("banner")
+ private List banner;
+
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/banner/BannerItem.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/banner/BannerItem.java
new file mode 100644
index 0000000000..9a5cad9649
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/banner/BannerItem.java
@@ -0,0 +1,41 @@
+package me.chanjar.weixin.channel.bean.home.banner;
+
+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.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 精选展示位明细
+ *
+ * @author Zeyes
+ */
+@Data
+@NoArgsConstructor
+@JsonInclude(Include.NON_NULL)
+public class BannerItem implements Serializable {
+
+ private static final long serialVersionUID = 6982412458700854481L;
+
+ /** 展示位类型 1-商品 3-视频号 4-公众号 {@link me.chanjar.weixin.channel.enums.BannerType} */
+ @JsonProperty("type")
+ private Integer type;
+
+ /** 展示位信息 */
+ @JsonProperty("banner")
+ private BannerItemDetail banner;
+
+ /** 商品 */
+ @JsonProperty("product")
+ private BannerItemProduct product;
+
+ /** 视频号 */
+ @JsonProperty("finder")
+ private BannerItemFinder finder;
+
+ /** 公众号 */
+ @JsonProperty("official_account")
+ private BannerItemOfficialAccount officialAccount;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/banner/BannerItemDetail.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/banner/BannerItemDetail.java
new file mode 100644
index 0000000000..b5cfb4a38c
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/banner/BannerItemDetail.java
@@ -0,0 +1,33 @@
+package me.chanjar.weixin.channel.bean.home.banner;
+
+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.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 精选展示位明细中的明细
+ *
+ * @author Zeyes
+ */
+@Data
+@NoArgsConstructor
+@JsonInclude(Include.NON_NULL)
+public class BannerItemDetail implements Serializable {
+
+ private static final long serialVersionUID = 5975434996207526173L;
+
+ /** 图片url */
+ @JsonProperty("img_url")
+ private String imgUrl;
+
+ /** 标题 */
+ @JsonProperty("title")
+ private String title;
+
+ /** 描述 */
+ @JsonProperty("description")
+ private String description;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/banner/BannerItemFinder.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/banner/BannerItemFinder.java
new file mode 100644
index 0000000000..735a2038da
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/banner/BannerItemFinder.java
@@ -0,0 +1,29 @@
+package me.chanjar.weixin.channel.bean.home.banner;
+
+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.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 精选展示位明细中的视频号数据
+ *
+ * @author Zeyes
+ */
+@Data
+@NoArgsConstructor
+@JsonInclude(Include.NON_NULL)
+public class BannerItemFinder implements Serializable {
+
+ private static final long serialVersionUID = -7397790079913284012L;
+
+ /** 视频号ID */
+ @JsonProperty("finder_user_name")
+ private String finderUserName;
+
+ /** 视频号视频的唯一标识 */
+ @JsonProperty("feed_id")
+ private String feedId;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/banner/BannerItemOfficialAccount.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/banner/BannerItemOfficialAccount.java
new file mode 100644
index 0000000000..0488829642
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/banner/BannerItemOfficialAccount.java
@@ -0,0 +1,25 @@
+package me.chanjar.weixin.channel.bean.home.banner;
+
+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.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 精选展示位明细中的公众号数据
+ *
+ * @author Zeyes
+ */
+@Data
+@NoArgsConstructor
+@JsonInclude(Include.NON_NULL)
+public class BannerItemOfficialAccount implements Serializable {
+
+ private static final long serialVersionUID = -5596947592282082891L;
+
+ /** 公众号文章url */
+ @JsonProperty("url")
+ private String url;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/banner/BannerItemProduct.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/banner/BannerItemProduct.java
new file mode 100644
index 0000000000..87a51823f0
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/banner/BannerItemProduct.java
@@ -0,0 +1,25 @@
+package me.chanjar.weixin.channel.bean.home.banner;
+
+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.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 精选展示位明细中的商品
+ *
+ * @author Zeyes
+ */
+@Data
+@NoArgsConstructor
+@JsonInclude(Include.NON_NULL)
+public class BannerItemProduct implements Serializable {
+
+ private static final long serialVersionUID = 8034487065591522594L;
+
+ /** 商品id */
+ @JsonProperty("product_id")
+ private Long productId;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/CatTreeNode.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/CatTreeNode.java
new file mode 100644
index 0000000000..fda794428c
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/CatTreeNode.java
@@ -0,0 +1,32 @@
+package me.chanjar.weixin.channel.bean.home.tree;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.Serializable;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 主页分类信息
+ *
+ * @author Zeyes
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class CatTreeNode implements Serializable {
+
+ private static final long serialVersionUID = 3154219180098003510L;
+
+ /** 分类id */
+ @JsonProperty("id")
+ private Integer id;
+
+ /** 分类名字 */
+ @JsonProperty("name")
+ private String name;
+
+ /** 是否在用户端展示该分类。1为是,0为否 */
+ @JsonProperty("is_displayed")
+ private Integer displayed;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/LevelTreeInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/LevelTreeInfo.java
new file mode 100644
index 0000000000..c74fff1246
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/LevelTreeInfo.java
@@ -0,0 +1,23 @@
+package me.chanjar.weixin.channel.bean.home.tree;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.Serializable;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 分类信息
+ *
+ * @author Zeyes
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class LevelTreeInfo implements Serializable {
+
+ /** 一级分类 */
+ @JsonProperty("level1")
+ private OneLevelTreeNode level1;
+
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/OneLevelTreeNode.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/OneLevelTreeNode.java
new file mode 100644
index 0000000000..74103e2b89
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/OneLevelTreeNode.java
@@ -0,0 +1,24 @@
+package me.chanjar.weixin.channel.bean.home.tree;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+
+/**
+ * 一级分类
+ *
+ * @author Zeyes
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+public class OneLevelTreeNode extends CatTreeNode {
+
+ /** 二级分类 */
+ @JsonProperty("level2")
+ private CatTreeNode level2;
+
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/TreeAuditResult.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/TreeAuditResult.java
new file mode 100644
index 0000000000..b85dda46dd
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/TreeAuditResult.java
@@ -0,0 +1,27 @@
+package me.chanjar.weixin.channel.bean.home.tree;
+
+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 TreeAuditResult implements Serializable {
+
+ private static final long serialVersionUID = 8142657614529852121L;
+
+ /** 版本号。设置分类树的接口会用到 */
+ @JsonProperty("version")
+ private Integer version;
+
+ /** 展示在店铺主页的商品分类 */
+ @JsonProperty("audit_results")
+ private List auditResults;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/TreeAuditResultDetail.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/TreeAuditResultDetail.java
new file mode 100644
index 0000000000..92df865061
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/TreeAuditResultDetail.java
@@ -0,0 +1,27 @@
+package me.chanjar.weixin.channel.bean.home.tree;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 分类审核结果
+ *
+ * @author Zeyes
+ */
+@Data
+@NoArgsConstructor
+public class TreeAuditResultDetail implements Serializable {
+
+ private static final long serialVersionUID = -6085892397971684732L;
+
+ /** 该分类ID的审核结果 */
+ @JsonProperty("level_id")
+ private Integer level_id;
+
+ /** 审核结果枚举。1:不通过;2:通过 */
+ @JsonProperty("result_code")
+ private Integer result_code;
+
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/TreeProductEditInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/TreeProductEditInfo.java
new file mode 100644
index 0000000000..d7dd831c3d
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/TreeProductEditInfo.java
@@ -0,0 +1,33 @@
+package me.chanjar.weixin.channel.bean.home.tree;
+
+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
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class TreeProductEditInfo implements Serializable {
+
+ private static final long serialVersionUID = -5596947592282082891L;
+
+ /** 一级分类id */
+ @JsonProperty("level_1_id")
+ private Integer level1Id;
+
+ /** 二级分类id */
+ @JsonProperty("level_2_id")
+ private Integer level2Id;
+
+ /** 商品id列表 */
+ @JsonProperty("product_ids")
+ private List productIds;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/TreeProductEditParam.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/TreeProductEditParam.java
new file mode 100644
index 0000000000..fb42162ca6
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/TreeProductEditParam.java
@@ -0,0 +1,25 @@
+package me.chanjar.weixin.channel.bean.home.tree;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.Serializable;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 添加/删除分类关联的商品 参数
+ *
+ * @author Zeyes
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class TreeProductEditParam implements Serializable {
+
+ private static final long serialVersionUID = -4906016235749892703L;
+
+ /** 参数 */
+ @JsonProperty("req")
+ private TreeProductEditInfo req;
+
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/TreeProductListInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/TreeProductListInfo.java
new file mode 100644
index 0000000000..a37e784d14
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/TreeProductListInfo.java
@@ -0,0 +1,36 @@
+package me.chanjar.weixin.channel.bean.home.tree;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.Serializable;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 查询分类关联的商品 参数
+ *
+ * @author Zeyes
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class TreeProductListInfo implements Serializable {
+
+ private static final long serialVersionUID = 2774682583380930076L;
+
+ /** 一级分类id */
+ @JsonProperty("level_1_id")
+ private Integer level1Id;
+
+ /** 二级分类id */
+ @JsonProperty("level_2_id")
+ private Integer level2Id;
+
+ /** 分页大小 */
+ @JsonProperty("page_size")
+ private Integer pageSize;
+
+ /** 从头拉取填空。翻页拉取的话填resp返回的值 */
+ @JsonProperty("page_context")
+ private String pageContext;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/TreeProductListParam.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/TreeProductListParam.java
new file mode 100644
index 0000000000..7bb6a700e2
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/TreeProductListParam.java
@@ -0,0 +1,24 @@
+package me.chanjar.weixin.channel.bean.home.tree;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.Serializable;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 查询分类关联的商品 参数
+ *
+ * @author Zeyes
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class TreeProductListParam implements Serializable {
+
+ private static final long serialVersionUID = -8444106841479328711L;
+
+ /** 参数 */
+ @JsonProperty("req")
+ private TreeProductListInfo req;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/TreeProductListResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/TreeProductListResponse.java
new file mode 100644
index 0000000000..ed0081d70c
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/TreeProductListResponse.java
@@ -0,0 +1,24 @@
+package me.chanjar.weixin.channel.bean.home.tree;
+
+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 TreeProductListResponse extends WxChannelBaseResponse {
+
+ private static final long serialVersionUID = 4566848209585635054L;
+
+ /** 结果 */
+ @JsonProperty("resp")
+ private TreeProductListResult resp;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/TreeProductListResult.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/TreeProductListResult.java
new file mode 100644
index 0000000000..6e0fdfea6c
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/TreeProductListResult.java
@@ -0,0 +1,31 @@
+package me.chanjar.weixin.channel.bean.home.tree;
+
+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 TreeProductListResult implements Serializable {
+
+ private static final long serialVersionUID = 4566848209585635054L;
+
+ /** 关联的商品ID。如果返回为空,返回翻页到底了 */
+ @JsonProperty("product_ids")
+ private List productIds;
+
+ /** 总条数 */
+ @JsonProperty("total_count")
+ private Integer totalCount;
+
+ /** 拉取下一页的话,需要把这个值填到req的page_context里面 */
+ @JsonProperty("page_context")
+ private String pageContext;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/TreeShowGetResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/TreeShowGetResponse.java
new file mode 100644
index 0000000000..f3784c48fb
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/TreeShowGetResponse.java
@@ -0,0 +1,20 @@
+package me.chanjar.weixin.channel.bean.home.tree;
+
+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 TreeShowGetResponse extends WxChannelBaseResponse {
+
+ /** resp */
+ @JsonProperty("resp")
+ private TreeShowInfo resp;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/TreeShowInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/TreeShowInfo.java
new file mode 100644
index 0000000000..485d29ce15
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/TreeShowInfo.java
@@ -0,0 +1,103 @@
+package me.chanjar.weixin.channel.bean.home.tree;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+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
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class TreeShowInfo implements Serializable {
+
+ /** 分类树 */
+ @JsonProperty("tree")
+ private LevelTreeInfo tree;
+
+ /** 版本号。通过获取商品分类树或者本接口得到 */
+ @JsonProperty("version")
+ private Integer version;
+
+ /** 表示有哪一些分类ID清空关联得商品,如果不清空,那么分类ID和商品得关联关系会一直存在。如果是一级分类,就填"1"。如果是二级分类,就填"1.2"。 */
+ @JsonProperty("classification_id_deleted")
+ private List classificationIdDeleted;
+
+ // 一些自定义的方法
+
+ /**
+ * 创建Tree节点
+ *
+ * @return Tree节点
+ */
+ protected LevelTreeInfo createTree() {
+ if (tree == null) {
+ tree = new LevelTreeInfo();
+ }
+ return tree;
+ }
+
+ /**
+ * 创建一级分类节点
+ *
+ * @return 一级分类节点
+ */
+ protected OneLevelTreeNode createLevel1() {
+ this.createTree();
+ if (tree.getLevel1() == null) {
+ tree.setLevel1(new OneLevelTreeNode());
+ }
+ return tree.getLevel1();
+ }
+
+ /**
+ * 创建二级分类节点
+ *
+ * @return 二级分类节点
+ */
+ protected CatTreeNode createLevel2() {
+ OneLevelTreeNode level1 = this.createLevel1();
+ if (level1.getLevel2() == null) {
+ level1.setLevel2(new CatTreeNode());
+ }
+ return level1.getLevel2();
+ }
+
+
+ @JsonIgnore
+ public void setLevel1Id(Integer id) {
+ createLevel1().setId(id);
+ }
+
+ @JsonIgnore
+ public void setLevel1Name(String name) {
+ createLevel1().setName(name);
+ }
+
+ @JsonIgnore
+ public void setLevel1Displayed(Integer displayed) {
+ createLevel1().setDisplayed(displayed);
+ }
+
+ @JsonIgnore
+ public void setLevel2Id(Integer id) {
+ createLevel2().setId(id);
+ }
+
+ @JsonIgnore
+ public void setLevel2Name(String name) {
+ createLevel2().setName(name);
+ }
+
+ @JsonIgnore
+ public void setLevel2Displayed(Integer displayed) {
+ createLevel2().setDisplayed(displayed);
+ }
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/TreeShowParam.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/TreeShowParam.java
new file mode 100644
index 0000000000..7277c528f4
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/TreeShowParam.java
@@ -0,0 +1,24 @@
+package me.chanjar.weixin.channel.bean.home.tree;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.Serializable;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 设置展示在店铺主页的商品分类 参数
+ *
+ * @author Zeyes
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class TreeShowParam implements Serializable {
+
+ private static final long serialVersionUID = -1577647561992899360L;
+
+ /** 分类信息 */
+ @JsonProperty("req")
+ private TreeShowInfo req;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/TreeShowSetResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/TreeShowSetResponse.java
new file mode 100644
index 0000000000..ad65332644
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/TreeShowSetResponse.java
@@ -0,0 +1,20 @@
+package me.chanjar.weixin.channel.bean.home.tree;
+
+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 TreeShowSetResponse extends WxChannelBaseResponse {
+
+ /** resp */
+ @JsonProperty("resp")
+ private TreeAuditResult resp;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/window/WindowProductIndexParam.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/window/WindowProductIndexParam.java
new file mode 100644
index 0000000000..fcc16bd0f6
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/window/WindowProductIndexParam.java
@@ -0,0 +1,28 @@
+package me.chanjar.weixin.channel.bean.home.window;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.Serializable;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 主页商品排序参数
+ *
+ * @author Zeyes
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class WindowProductIndexParam implements Serializable {
+
+ private static final long serialVersionUID = 1370480140179330908L;
+
+ /** 商品id */
+ @JsonProperty("product_id")
+ private String productId;
+
+ /** 商品重新排序后的新序号,最大移动步长为500(即新序号与当前序号的距离小于500) */
+ @JsonProperty("index_num")
+ private Integer indexNum;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/window/WindowProductListParam.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/window/WindowProductListParam.java
new file mode 100644
index 0000000000..9245df9887
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/window/WindowProductListParam.java
@@ -0,0 +1,26 @@
+package me.chanjar.weixin.channel.bean.home.window;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.Serializable;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 获取主页展示商品列表 参数
+ *
+ * @author Zeyes
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class WindowProductListParam implements Serializable {
+
+ /** 每页数量(默认10,不超过30) */
+ @JsonProperty("page_size")
+ private Integer pageSize;
+
+ /** 由上次请求返回,记录翻页的上下文。传入时会从上次返回的结果往后翻一页,不传默认获取第一页数据。 */
+ @JsonProperty("next_key")
+ private String nextKey;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/window/WindowProductSetting.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/window/WindowProductSetting.java
new file mode 100644
index 0000000000..725470b912
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/window/WindowProductSetting.java
@@ -0,0 +1,34 @@
+package me.chanjar.weixin.channel.bean.home.window;
+
+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
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class WindowProductSetting implements Serializable {
+
+ private static final long serialVersionUID = -5931781905709862287L;
+
+ /** 商品id */
+ @JsonProperty("product_id")
+ private String productId;
+
+ /** 是否隐藏,设置为隐藏的商品只在首页不可见,并不代表下架。 */
+ @JsonProperty("is_set_hide")
+ private Integer setHide;
+
+ /** 是否置顶 */
+ @JsonProperty("is_set_top")
+ private Integer setTop;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/window/WindowProductSettingResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/window/WindowProductSettingResponse.java
new file mode 100644
index 0000000000..495910e37d
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/window/WindowProductSettingResponse.java
@@ -0,0 +1,33 @@
+package me.chanjar.weixin.channel.bean.home.window;
+
+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 WindowProductSettingResponse extends WxChannelBaseResponse {
+
+ private static final long serialVersionUID = 1L;
+
+ /** 商品信息 */
+ @JsonProperty("products")
+ private List products;
+
+ /** 本次翻页的上下文,用于请求下一页 */
+ @JsonProperty("next_key")
+ private String nextKey;
+
+ /** 商品总数 */
+ @JsonProperty("total_num")
+ private Integer totalNum;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/message/store/CloseStoreMessage.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/message/store/CloseStoreMessage.java
new file mode 100644
index 0000000000..2a43483354
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/message/store/CloseStoreMessage.java
@@ -0,0 +1,38 @@
+package me.chanjar.weixin.channel.bean.message.store;
+
+/**
+ * @author Zeyes
+ */
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import me.chanjar.weixin.channel.message.WxChannelMessage;
+
+/**
+ * 小店注销消息
+ *
+ * @author Zeyes
+ */
+@Data
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+@JacksonXmlRootElement(localName = "xml")
+public class CloseStoreMessage extends WxChannelMessage {
+
+ private static final long serialVersionUID = 7619787772418774020L;
+
+ /** appid */
+ @JsonProperty("appid")
+ @JacksonXmlProperty(localName = "appid")
+ private String appid;
+
+ /** Unix时间戳,即格林威治时间1970年01月01日00时00分00秒(北京时间1970年01月01日08时00分00秒)起至现在的总秒数 */
+ @JsonProperty("close_timestamp")
+ @JacksonXmlProperty(localName = "close_timestamp")
+ private Long closeTimestamp;
+
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/message/store/NicknameUpdateMessage.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/message/store/NicknameUpdateMessage.java
new file mode 100644
index 0000000000..e6665497e0
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/message/store/NicknameUpdateMessage.java
@@ -0,0 +1,43 @@
+package me.chanjar.weixin.channel.bean.message.store;
+
+/**
+ * @author Zeyes
+ */
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import me.chanjar.weixin.channel.message.WxChannelMessage;
+
+/**
+ * 小店修改名称消息
+ *
+ * @author Zeyes
+ */
+@Data
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+@JacksonXmlRootElement(localName = "xml")
+public class NicknameUpdateMessage extends WxChannelMessage {
+
+ private static final long serialVersionUID = 7619787772418774020L;
+
+ /** appid */
+ @JsonProperty("appid")
+ @JacksonXmlProperty(localName = "appid")
+ private String appid;
+
+ /** 小店旧昵称 */
+ @JsonProperty("old_nickname")
+ @JacksonXmlProperty(localName = "old_nickname")
+ private String oldNickname;
+
+ /** 小店新昵称 */
+ @JsonProperty("new_nickname")
+ @JacksonXmlProperty(localName = "new_nickname")
+ private String newNickname;
+
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/DecodeAddressInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/DecodeAddressInfo.java
new file mode 100644
index 0000000000..3aa6622eeb
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/DecodeAddressInfo.java
@@ -0,0 +1,22 @@
+package me.chanjar.weixin.channel.bean.order;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import me.chanjar.weixin.channel.bean.base.AddressInfo;
+
+/**
+ * 解码地址数据
+ *
+ * @author Zeyes
+ */
+@Data
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+public class DecodeAddressInfo extends AddressInfo {
+
+ /** 虚拟发货订单联系方式,在发货方式为无需快递(deliver_method=1)时返回 */
+ @JsonProperty("virtual_order_tel_number")
+ private String virtualOrderTelNumber;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/DecodeSensitiveInfoResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/DecodeSensitiveInfoResponse.java
new file mode 100644
index 0000000000..c0431a8fd6
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/DecodeSensitiveInfoResponse.java
@@ -0,0 +1,28 @@
+package me.chanjar.weixin.channel.bean.order;
+
+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 DecodeSensitiveInfoResponse extends WxChannelBaseResponse {
+
+ private static final long serialVersionUID = 935829924760021624L;
+
+ /** 收货信息 */
+ @JsonProperty("address_info")
+ private DecodeAddressInfo addressInfo;
+
+ /** 虚拟号信息 */
+ @JsonProperty("virtual_number_info")
+ private VirtualNumberInfo virtualNumberInfo;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/OrderDeliveryInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/OrderDeliveryInfo.java
index 9f3d72feac..ebe6bb8dc2 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/OrderDeliveryInfo.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/OrderDeliveryInfo.java
@@ -44,4 +44,16 @@ public class OrderDeliveryInfo implements Serializable {
@JsonProperty("ewaybill_order_code")
private String ewaybillOrderCode;
+ /** 订单质检类型 2生鲜类质检 1珠宝玉石类质检 0不需要;不传递本字段表示不需要 */
+ @JsonProperty("quality_inspect_type")
+ private String qualityInspectType;
+
+ /** 质检信息 */
+ @JsonProperty("quality_inspect_info")
+ private QualityInsepctInfo qualityInspectInfo;
+
+ /** 虚拟商品充值账户信息 */
+ @JsonProperty("recharge_info")
+ private RechargeInfo rechargeInfo;
+
}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/OrderSearchCondition.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/OrderSearchCondition.java
index 012b0fca49..a4c8373cec 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/OrderSearchCondition.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/OrderSearchCondition.java
@@ -30,12 +30,33 @@ public class OrderSearchCondition implements Serializable {
@JsonProperty("user_name")
private String userName;
- /** 收件人电话 */
+ /**
+ * 收件人电话
+ * @deprecated 当前字段已经废弃,请勿使用,如果原本填手机后四位,可正常使用,否则接口报错
+ */
@JsonProperty("tel_number")
+ @Deprecated
private String telNumber;
+ /**
+ * 收件人电话后四位
+ */
+ @JsonProperty("tel_number_last4")
+ private String telNumberLast4;
+
/** 选填,只搜一个订单时使用 */
@JsonProperty("order_id")
private String orderId;
+ /** 商家备注 */
+ @JsonProperty("merchant_notes")
+ private String merchantNotes;
+
+ /** 买家备注 */
+ @JsonProperty("customer_notes")
+ private String customerNotes;
+
+ /** 申请修改地址审核中 */
+ @JsonProperty("address_under_review")
+ private Boolean addressUnderReview;
}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/QualityInsepctInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/QualityInsepctInfo.java
new file mode 100644
index 0000000000..64c1102bb2
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/QualityInsepctInfo.java
@@ -0,0 +1,22 @@
+package me.chanjar.weixin.channel.bean.order;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 质检信息
+ *
+ * @author Zeyes
+ */
+@Data
+@NoArgsConstructor
+public class QualityInsepctInfo implements Serializable {
+
+ private static final long serialVersionUID = 8109819414306253475L;
+
+ /** 质检状态 */
+ @JsonProperty("inspect_status")
+ private Integer inspectStatus;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/RechargeInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/RechargeInfo.java
new file mode 100644
index 0000000000..452dd0677c
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/RechargeInfo.java
@@ -0,0 +1,28 @@
+package me.chanjar.weixin.channel.bean.order;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 虚拟商品充值账户信息
+ *
+ * @author Zeyes
+ */
+@Data
+@NoArgsConstructor
+public class RechargeInfo implements Serializable {
+
+ /** 虚拟商品充值账号,当account_type=qq或phone_number或mail的时候返回 */
+ @JsonProperty("account_no")
+ private String accountNo;
+
+ /** 账号充值类型,可选项: weixin(微信号),qq(qq),phone_number(电话号码),mail(邮箱) */
+ @JsonProperty("account_type")
+ private String accountType;
+
+ /** 当account_type="weixin"的时候返回 */
+ @JsonProperty("wx_openid")
+ private String wxOpenId;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/VirtualNumberInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/VirtualNumberInfo.java
new file mode 100644
index 0000000000..217908e27c
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/VirtualNumberInfo.java
@@ -0,0 +1,30 @@
+package me.chanjar.weixin.channel.bean.order;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 虚拟号信息
+ *
+ * @author Zeyes
+ */
+@Data
+@NoArgsConstructor
+public class VirtualNumberInfo implements Serializable {
+
+ private static final long serialVersionUID = -372834823737476644L;
+
+ /** 虚拟号 */
+ @JsonProperty("virtual_number")
+ private String virtualNumber;
+
+ /** 分机号 */
+ @JsonProperty("extension")
+ private String extension;
+
+ /** 过期时间戳 */
+ @JsonProperty("expiration")
+ private Long expiration;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/VirtualTelNumberResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/VirtualTelNumberResponse.java
new file mode 100644
index 0000000000..92f09b59ab
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/VirtualTelNumberResponse.java
@@ -0,0 +1,30 @@
+package me.chanjar.weixin.channel.bean.order;
+
+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 VirtualTelNumberResponse extends WxChannelBaseResponse {
+
+ /** 虚拟号码 */
+ @JsonProperty("virtual_tel_number")
+ private String virtualTelNumber;
+
+ /** 虚拟号码过期时间 */
+ @JsonProperty("virtual_tel_expire_time")
+ private Long virtualTelExpireTime;
+
+ /** 兑换虚拟号码次数 */
+ @JsonProperty("get_virtual_tel_cnt")
+ private Integer getVirtualTelCnt;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/ExtraServiceInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/ExtraServiceInfo.java
index aeaf1a8cd6..4e9559c565 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/ExtraServiceInfo.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/ExtraServiceInfo.java
@@ -20,4 +20,20 @@ public class ExtraServiceInfo implements Serializable {
*/
@JsonProperty("seven_day_return")
private Integer sevenDayReturn;
+
+ /** 先用后付,0-不支持先用后付,1-支持先用后付。若店铺已开通先用后付,支持先用后付的类目商品将在上架后自动打开先用后付。 */
+ @JsonProperty("pay_after_use")
+ private Integer payAfterUse;
+
+ /** 是否支持运费险,0-不支持运费险,1-支持运费险。需要商户开通运费险服务,且当前类目支持运费险才会生效。 */
+ @JsonProperty("freight_insurance")
+ private Integer freightInsurance;
+
+ /** 是否支持假一赔三,0-不支持假一赔三,1-支持假一赔三。 */
+ @JsonProperty("fake_one_pay_three")
+ private Integer fakeOnePayThree;
+
+ /** 是否支持坏损包退,0-不支持坏损包退,1-支持坏损包退。 */
+ @JsonProperty("damage_guarantee")
+ private Integer damageGuarantee;
}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/ProductQuaInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/ProductQuaInfo.java
new file mode 100644
index 0000000000..b411ebe80f
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/ProductQuaInfo.java
@@ -0,0 +1,29 @@
+package me.chanjar.weixin.channel.bean.product;
+
+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
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class ProductQuaInfo implements Serializable {
+
+ private static final long serialVersionUID = -71766140204505768L;
+
+ /** 商品资质id,对应获取类目信息中的字段product_qua_list[].qua_id */
+ @JsonProperty("qua_id")
+ private String quaId;
+
+ /** 商品资质图片列表 */
+ @JsonProperty("qua_url")
+ private List quaUrl;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/ProductSaleLimitInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/ProductSaleLimitInfo.java
new file mode 100644
index 0000000000..9c067cc329
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/ProductSaleLimitInfo.java
@@ -0,0 +1,30 @@
+package me.chanjar.weixin.channel.bean.product;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.Serializable;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 商品销售库存限制
+ *
+ * @author Zeyes
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class ProductSaleLimitInfo implements Serializable {
+
+ /** 是否受到管控,商品存在售卖限制时,固定返回1 */
+ @JsonProperty("is_limited")
+ private Integer limited;
+
+ /** 售卖限制标题 */
+ @JsonProperty("title")
+ private String title;
+
+ /** 售卖限制描述 */
+ @JsonProperty("sub_title")
+ private String subTitle;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/SkuFastInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/SkuFastInfo.java
new file mode 100644
index 0000000000..a461e6d952
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/SkuFastInfo.java
@@ -0,0 +1,52 @@
+package me.chanjar.weixin.channel.bean.product;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 免审商品更新Sku数据
+ *
+ * @author Zeyes
+ */
+@Data
+@NoArgsConstructor
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class SkuFastInfo implements Serializable {
+
+ /** sku_id */
+ @JsonProperty("sku_id")
+ private String skuId;
+
+ /** 售卖价格,以分为单位,数字类型,最大不超过10000000(1000万元) */
+ @JsonProperty("sale_price")
+ private Integer salePrice;
+
+ @JsonProperty("stock_info")
+ private StockInfo stockInfo;
+
+ /** sku发货信息 */
+ @JsonProperty("sku_deliver_info")
+ private SkuDeliverInfo skuDeliverInfo;
+
+ /** 是否要删除当前sku */
+ @JsonProperty("is_delete")
+ private Boolean delete;
+
+
+ @Data
+ @NoArgsConstructor
+ public static class StockInfo implements Serializable {
+
+ /** 修改类型。1: 增加;2:减少;3:设置 */
+ @JsonProperty("diff_type")
+ protected Integer diffType;
+
+ /** 增加、减少或者设置的库存值 */
+ @JsonProperty("num")
+ protected Integer num;
+ }
+
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/SkuInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/SkuInfo.java
index 3b46708039..22e75d7afc 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/SkuInfo.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/SkuInfo.java
@@ -54,7 +54,7 @@ public class SkuInfo implements Serializable {
/** skuID */
@JsonProperty("sku_id")
- private Long skuId;
+ private String skuId;
public SkuInfo() {
}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/SkuStockBatchList.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/SkuStockBatchList.java
new file mode 100644
index 0000000000..71f995692f
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/SkuStockBatchList.java
@@ -0,0 +1,23 @@
+package me.chanjar.weixin.channel.bean.product;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.Serializable;
+import java.util.List;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * spu库存列表
+ *
+ * @author Zeyes
+ */
+@Data
+@NoArgsConstructor
+public class SkuStockBatchList implements Serializable {
+ private static final long serialVersionUID = -8082428962162052815L;
+
+ /** 库存信息 */
+ @JsonProperty("spu_stock_list")
+ private List spuStockList;
+
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/SkuStockBatchParam.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/SkuStockBatchParam.java
new file mode 100644
index 0000000000..93b5cca798
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/SkuStockBatchParam.java
@@ -0,0 +1,24 @@
+package me.chanjar.weixin.channel.bean.product;
+
+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
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class SkuStockBatchParam implements Serializable {
+
+ private static final long serialVersionUID = 3706326762056220559L;
+
+ /** 商品ID列表 注意这里是 productId ,序列化参数没有写错 */
+ @JsonProperty("product_id")
+ private List productIds;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/SkuStockBatchResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/SkuStockBatchResponse.java
new file mode 100644
index 0000000000..eb188bdc79
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/SkuStockBatchResponse.java
@@ -0,0 +1,24 @@
+package me.chanjar.weixin.channel.bean.product;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
+
+/**
+ * 批量查询sku库存响应
+ *
+ * @author Zeyes
+ */
+@Data
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+public class SkuStockBatchResponse extends WxChannelBaseResponse {
+
+ private static final long serialVersionUID = 7745444061881828137L;
+
+ /** 库存信息 */
+ @JsonProperty("data")
+ private SkuStockBatchList data;
+ }
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/SkuStockInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/SkuStockInfo.java
index a0dccb1329..a480d3249b 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/SkuStockInfo.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/SkuStockInfo.java
@@ -29,7 +29,14 @@ public class SkuStockInfo implements Serializable {
@JsonProperty("warehouse_stocks")
private List warehouseStocks;
- /** 库存总量:通用库存数量 + 限时抢购库存数量 + 区域库存总量 */
+ /**
+ * 普通查询:库存总量:通用库存数量 + 限时抢购库存数量 + 区域库存总量
+ * 批量查询:库存总量:通用库存数量 + 限时抢购库存数量 + 区域库存数量 + 达人专属计划营销库存数量
+ */
@JsonProperty("total_stock_num")
private Integer totalStockNum;
+
+ /** 达人专属计划营销库存数量 */
+ @JsonProperty("finder_stock_num")
+ private Integer finderTotalNum;
}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/SkuStockResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/SkuStockResponse.java
index 9cbd6f18c0..683aece146 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/SkuStockResponse.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/SkuStockResponse.java
@@ -1,5 +1,6 @@
package me.chanjar.weixin.channel.bean.product;
+import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
@@ -18,5 +19,6 @@ public class SkuStockResponse extends WxChannelBaseResponse {
private static final long serialVersionUID = -2156342792354605826L;
/** 库存信息 */
+ @JsonProperty("data")
private SkuStockInfo data;
}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/SpuFastInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/SpuFastInfo.java
new file mode 100644
index 0000000000..05e107779b
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/SpuFastInfo.java
@@ -0,0 +1,28 @@
+package me.chanjar.weixin.channel.bean.product;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.Serializable;
+import java.util.List;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 商品免审更新参数
+ *
+ * @author Zeyes
+ */
+@Data
+@NoArgsConstructor
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class SpuFastInfo implements Serializable {
+
+ /** 商品ID */
+ @JsonProperty("product_id")
+ protected String productId;
+
+ /** SKU列表 */
+ @JsonProperty("skus")
+ protected List skus;
+
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/SpuGetResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/SpuGetResponse.java
index b01682802f..ff15cbf0cb 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/SpuGetResponse.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/SpuGetResponse.java
@@ -25,4 +25,8 @@ public class SpuGetResponse extends WxChannelBaseResponse {
/** 商品草稿数据,入参data_type==1时不返回该字段 */
@JsonProperty("edit_product")
private SpuInfo editProduct;
+
+ /** 当日售卖上限提醒,当店铺受到售卖管控时返回,没有返回本字段表示没有无额外限制 */
+ @JsonProperty("sale_limit_info")
+ private ProductSaleLimitInfo saleLimitInfo;
}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/SpuInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/SpuInfo.java
index 9db4c50f70..7b29194731 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/SpuInfo.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/SpuInfo.java
@@ -45,6 +45,10 @@ public class SpuInfo extends SpuSimpleInfo {
@JsonProperty("cats")
private List cats;
+ /** 新类目树,商家需要先申请可使用类目 */
+ @JsonProperty("cats_v2")
+ private List catsV2;
+
/** 商品参数 */
@JsonProperty("attrs")
private List attrs;
@@ -107,10 +111,24 @@ public class SpuInfo extends SpuSimpleInfo {
@JsonProperty("product_type")
private Integer productType;
-
/**
* 商品的售后信息
*/
@JsonProperty("after_sale_info")
private AfterSaleInfo afterSaleInfo;
+
+ /**
+ * 当商品类型位福袋抽奖商品(即product_type==2)且该抽奖商品由橱窗的自营商品导入生成时有值,
+ * 表示导入的来源商品id,其他场景下该字段无值或者值为0
+ */
+ @JsonProperty("src_product_id")
+ private String srcProductId;
+
+ /** 商品资质列表 */
+ @JsonProperty("product_qua_infos")
+ private List productQuaInfos;
+
+ /** 尺码表信息 */
+ @JsonProperty("size_chart")
+ private SpuSizeChart sizeChart;
}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/SpuSimpleInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/SpuSimpleInfo.java
index b1ab3febe7..3e84bb1492 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/SpuSimpleInfo.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/SpuSimpleInfo.java
@@ -15,7 +15,7 @@ public class SpuSimpleInfo implements Serializable {
private static final long serialVersionUID = 5583726432139404883L;
- /** 交易组件平台内部商品ID */
+ /** 商品ID */
@JsonProperty("product_id")
protected String productId;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/SpuSizeChart.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/SpuSizeChart.java
new file mode 100644
index 0000000000..4e34ccfac8
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/SpuSizeChart.java
@@ -0,0 +1,27 @@
+package me.chanjar.weixin.channel.bean.product;
+
+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 SpuSizeChart implements Serializable {
+
+ private static final long serialVersionUID = -5019617420608575610L;
+
+ /** 是否支持尺码表 */
+ @JsonProperty("enable")
+ private Boolean enable;
+
+ /** 尺码表 */
+ @JsonProperty("specification_list")
+ private List specificationList;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/SpuSizeChartItem.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/SpuSizeChartItem.java
new file mode 100644
index 0000000000..7ea4d0a66b
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/SpuSizeChartItem.java
@@ -0,0 +1,55 @@
+package me.chanjar.weixin.channel.bean.product;
+
+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 SpuSizeChartItem implements Serializable {
+
+ private static final long serialVersionUID = -3757716378584654974L;
+
+ /** 尺码属性名称 */
+ @JsonProperty("name")
+ private String name;
+
+ /** 尺码属性值的单位 */
+ @JsonProperty("unit")
+ private String unit;
+
+ /** 尺码属性值是否为区间 */
+ @JsonProperty("is_range")
+ private Boolean range;
+
+ /** 尺码值与尺码属性值的映射列表 */
+ @JsonProperty("value_list")
+ private List valueList;
+
+ @Data
+ @NoArgsConstructor
+ public static class ValueRange implements Serializable {
+ /** 尺码值 */
+ @JsonProperty("key")
+ private String key;
+
+ /** 尺码属性值;尺码属性值为非区间时返回 */
+ @JsonProperty("value")
+ private String value;
+
+ /** 尺码属性值的左边界;尺码属性值为区间时返回 */
+ @JsonProperty("left")
+ private String left;
+
+ /** 尺码属性值的右边界;尺码属性值为区间时返回 */
+ @JsonProperty("right")
+ private String right;
+ }
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/SpuStockInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/SpuStockInfo.java
new file mode 100644
index 0000000000..4564f069b8
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/SpuStockInfo.java
@@ -0,0 +1,25 @@
+package me.chanjar.weixin.channel.bean.product;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.Serializable;
+import java.util.List;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * SPU库存信息
+ *
+ * @author Zeyes
+ */
+@Data
+@NoArgsConstructor
+public class SpuStockInfo implements Serializable {
+
+ /** 商品ID */
+ @JsonProperty("product_id")
+ protected String productId;
+
+ /** sku库存 */
+ @JsonProperty("sku_stock")
+ private List skuStock;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/SpuUpdateInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/SpuUpdateInfo.java
new file mode 100644
index 0000000000..f6214c5d78
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/SpuUpdateInfo.java
@@ -0,0 +1,24 @@
+package me.chanjar.weixin.channel.bean.product;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+
+/**
+ * 商品更新数据
+ *
+ * @author Zeyes
+ */
+@Data
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class SpuUpdateInfo extends SpuInfo {
+
+ /** 添加完成后是否立即上架。1:是;0:否;默认0 */
+ @JsonProperty("listing")
+ private Integer listing;
+
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/WarehouseStockInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/WarehouseStockInfo.java
index bb239c9492..b0235534bb 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/WarehouseStockInfo.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/WarehouseStockInfo.java
@@ -6,6 +6,8 @@
import lombok.NoArgsConstructor;
/**
+ * 区域库存
+ *
* @author Zeyes
*/
@Data
@@ -21,4 +23,8 @@ public class WarehouseStockInfo implements Serializable {
/** 区域库存数量 */
@JsonProperty("num")
private Integer num;
+
+ /** 区域库存的锁定库存(已下单未支付的库存)数量 */
+ @JsonProperty("lock_stock")
+ private Integer lockStock;
}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/link/ProductH5UrlResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/link/ProductH5UrlResponse.java
new file mode 100644
index 0000000000..0dee49f165
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/link/ProductH5UrlResponse.java
@@ -0,0 +1,22 @@
+package me.chanjar.weixin.channel.bean.product.link;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
+
+/**
+ * 商品H5短链 结果
+ *
+ * @author Zeyes
+ */
+@Data
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+public class ProductH5UrlResponse extends WxChannelBaseResponse {
+
+ /** 商品H5短链 */
+ @JsonProperty("product_h5url")
+ private String productH5url;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/link/ProductQrCodeResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/link/ProductQrCodeResponse.java
new file mode 100644
index 0000000000..a6876b78f1
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/link/ProductQrCodeResponse.java
@@ -0,0 +1,22 @@
+package me.chanjar.weixin.channel.bean.product.link;
+
+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 ProductQrCodeResponse extends WxChannelBaseResponse {
+
+ /** 商品二维码 */
+ @JsonProperty("product_qrcode")
+ private String productQrcode;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/link/ProductTagLinkResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/link/ProductTagLinkResponse.java
new file mode 100644
index 0000000000..59712130d8
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/link/ProductTagLinkResponse.java
@@ -0,0 +1,22 @@
+package me.chanjar.weixin.channel.bean.product.link;
+
+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 ProductTagLinkResponse extends WxChannelBaseResponse {
+
+ /** 商品口令 */
+ @JsonProperty("product_taglink")
+ private String productTaglink;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/token/StableToken.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/token/StableTokenParam.java
similarity index 93%
rename from weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/token/StableToken.java
rename to weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/token/StableTokenParam.java
index 72ce83d077..8bcacb649b 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/token/StableToken.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/token/StableTokenParam.java
@@ -17,7 +17,7 @@
@NoArgsConstructor
@AllArgsConstructor
@JsonInclude(JsonInclude.Include.NON_NULL)
-public class StableToken implements Serializable {
+public class StableTokenParam implements Serializable {
private static final long serialVersionUID = 6849364823232834171L;
@JsonProperty("grant_type")
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/vip/VipParam.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/vip/VipOpenIdParam.java
similarity index 90%
rename from weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/vip/VipParam.java
rename to weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/vip/VipOpenIdParam.java
index e439641ed9..8f52ded878 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/vip/VipParam.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/vip/VipOpenIdParam.java
@@ -17,7 +17,7 @@
@NoArgsConstructor
@JsonInclude(JsonInclude.Include.NON_NULL)
@AllArgsConstructor
-public class VipParam implements Serializable {
+public class VipOpenIdParam implements Serializable {
private static final long serialVersionUID = -7924178026258012317L;
@JsonProperty("openid")
private String openId;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/common/ChannelWxError.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/common/ChannelWxError.java
index eb8cda4996..705eacc898 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/common/ChannelWxError.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/common/ChannelWxError.java
@@ -7,7 +7,9 @@
* 微信视频号错误码
*
* @author Zeyes
+ * @deprecated 请使用 {@link me.chanjar.weixin.common.error.WxError} 替代
*/
+@Deprecated
public class ChannelWxError extends WxError {
private static final long serialVersionUID = -2638512715814977441L;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/config/WxChannelConfig.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/config/WxChannelConfig.java
index ad24234fb0..64344dae58 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/config/WxChannelConfig.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/config/WxChannelConfig.java
@@ -19,6 +19,14 @@ public interface WxChannelConfig {
*/
String getAccessToken();
+ /**
+ * Is use stable access token api
+ *
+ * @link 获取稳定版AccessToken
+ * @return the boolean
+ */
+ boolean isStableAccessToken();
+
/**
* Gets access token lock.
*
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/config/impl/WxChannelDefaultConfigImpl.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/config/impl/WxChannelDefaultConfigImpl.java
index e32bcad83e..1c3930caf5 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/config/impl/WxChannelDefaultConfigImpl.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/config/impl/WxChannelDefaultConfigImpl.java
@@ -33,6 +33,8 @@ public class WxChannelDefaultConfigImpl implements WxChannelConfig {
private volatile int httpProxyPort;
private volatile String httpProxyUsername;
private volatile String httpProxyPassword;
+ /** 是否使用稳定版获取accessToken接口 */
+ private volatile boolean stableAccessToken;
private volatile int retrySleepMillis = 1000;
private volatile int maxRetryTimes = 5;
@@ -63,6 +65,15 @@ public void setAccessToken(String accessToken) {
this.accessToken = accessToken;
}
+ @Override
+ public boolean isStableAccessToken() {
+ return stableAccessToken;
+ }
+
+ public void setStableAccessToken(boolean stableAccessToken) {
+ this.stableAccessToken = stableAccessToken;
+ }
+
@Override
public Lock getAccessTokenLock() {
return this.accessTokenLock;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/constant/MessageEventConstants.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/constant/MessageEventConstants.java
index 48cf268b06..bee0263a25 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/constant/MessageEventConstants.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/constant/MessageEventConstants.java
@@ -83,4 +83,10 @@ public interface MessageEventConstants {
// 分享员相关
/** 分享员变更 **/
String SHARER_CHANGE = "channels_ec_sharer_change";
+
+ // 店铺相关
+ /** 小店注销 */
+ String CLOSE_STORE = "channels_ec_close_store";
+ /** 小店修改 */
+ String SET_SHOP_NICKNAME = "set_shop_nickname";
}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/constant/WxChannelApiUrlConstants.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/constant/WxChannelApiUrlConstants.java
index 1fddd1de84..35cb6d2140 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/constant/WxChannelApiUrlConstants.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/constant/WxChannelApiUrlConstants.java
@@ -55,6 +55,48 @@ public interface Category {
String LIST_PASS_CATEGORY_URL = "https://api.weixin.qq.com/channels/ec/category/list/get";
}
+ /** 主页管理相关接口 */
+ public interface HomePage {
+
+ /** 添加分类关联的商品 */
+ String ADD_TREE_PRODUCT_URL = "https://api.weixin.qq.com/channels/ec/store/classification/tree/product/add";
+ /** 删除分类关联的商品 */
+ String DEL_TREE_PRODUCT_URL = "https://api.weixin.qq.com/channels/ec/store/classification/tree/product/del";
+ /** 获取分类关联的商品ID列表 */
+ String LIST_TREE_PRODUCT_URL = "https://api.weixin.qq.com/channels/ec/store/classification/tree/product/get";
+ /** 设置展示在店铺主页的商品分类 */
+ String SET_SHOW_TREE_URL = "https://api.weixin.qq.com/channels/ec/store/classification/tree/set";
+ /** 获取在店铺主页展示的商品分类 */
+ String GET_SHOW_TREE_URL = "https://api.weixin.qq.com/channels/ec/store/classification/tree/get";
+
+ /** 获取主页展示商品列表 */
+ String LIST_WINDOW_PRODUCT_URL = "https://api.weixin.qq.com/channels/ec/store/window/product/list/get";
+ /** 重新排序主页展示商品 */
+ String REORDER_WINDOW_PRODUCT_URL = "https://api.weixin.qq.com/channels/ec/store/window/product/reorder";
+ /** 隐藏小店主页商品 */
+ String HIDE_WINDOW_PRODUCT_URL = "https://api.weixin.qq.com/channels/ec/store/window/product/hide";
+ /** 置顶小店主页商品 */
+ String TOP_WINDOW_PRODUCT_URL = "https://api.weixin.qq.com/channels/ec/store/window/product/settop";
+
+ /** 提交主页背景图申请 */
+ String APPLY_BACKGROUND_URL = "https://api.weixin.qq.com/channels/ec/basics/homepage/background/apply/submit";
+ /** 查询主页背景图 */
+ String GET_BACKGROUND_URL = "https://api.weixin.qq.com/channels/ec/basics/homepage/background/get";
+ /** 撤销主页背景图申请 */
+ String CANCEL_BACKGROUND_URL = "https://api.weixin.qq.com/channels/ec/basics/homepage/background/apply/cancel";
+ /** 清空主页背景图并撤销流程中的申请 */
+ String REMOVE_BACKGROUND_URL = "https://api.weixin.qq.com/channels/ec/basics/homepage/background/remove";
+
+ /** 提交精选展示位申请 */
+ String APPLY_BANNER_URL = "https://api.weixin.qq.com/channels/ec/basics/homepage/banner/apply/submit";
+ /** 查询精选展示位 */
+ String GET_BANNER_URL = "https://api.weixin.qq.com/channels/ec/basics/homepage/banner/get";
+ /** 撤销精选展示位申请 */
+ String CANCEL_BANNER_URL = "https://api.weixin.qq.com/channels/ec/basics/homepage/banner/apply/cancel";
+ /** 清空精选展示位并撤销流程中的申请 */
+ String REMOVE_BANNER_URL = "https://api.weixin.qq.com/channels/ec/basics/homepage/banner/remove";
+ }
+
/** 品牌资质相关接口 */
public interface Brand {
@@ -89,14 +131,24 @@ public interface Spu {
String SPU_LIST_URL = "https://api.weixin.qq.com/channels/ec/product/list/get";
/** 更新商品 */
String SPU_UPDATE_URL = "https://api.weixin.qq.com/channels/ec/product/update";
+ /** 更新商品 */
+ String SPU_AUDIT_FREE_UPDATE_URL = "https://api.weixin.qq.com/channels/ec/product/auditfree";
/** 上架商品 */
String SPU_LISTING_URL = "https://api.weixin.qq.com/channels/ec/product/listing";
/** 下架商品 */
String SPU_DELISTING_URL = "https://api.weixin.qq.com/channels/ec/product/delisting";
/** 撤回商品审核 */
String CANCEL_AUDIT_URL = "https://api.weixin.qq.com/channels/ec/product/audit/cancel";
+ /** 获取商品H5短链 */
+ String SPU_H5URL_URL = "https://api.weixin.qq.com/channels/ec/product/h5url/get";
+ /** 获取商品二维码 */
+ String SPU_QRCODE_URL = "https://api.weixin.qq.com/channels/ec/product/qrcode/get";
+ /** 获取商品口令 */
+ String SPU_TAGLINK_URL = "https://api.weixin.qq.com/channels/ec/product/taglink/get";
/** 获取实时库存 */
String SPU_GET_STOCK_URL = "https://api.weixin.qq.com/channels/ec/product/stock/get";
+ /** 获取实时库存 */
+ String SPU_GET_STOCK_BATCH_URL = "https://api.weixin.qq.com/channels/ec/product/stock/batchget";
/** 更新商品库存 */
String SPU_UPDATE_STOCK_URL = "https://api.weixin.qq.com/channels/ec/product/stock/update";
/** 添加限时抢购任务 */
@@ -155,6 +207,12 @@ public interface Order {
String REJECT_ADDRESS_MODIFY_URL = "https://api.weixin.qq.com/channels/ec/order/addressmodify/reject";
/** 订单搜索 */
String ORDER_SEARCH_URL = "https://api.weixin.qq.com/channels/ec/order/search";
+ /** 上传生鲜质检信息 */
+ String UPLOAD_FRESH_INSPECT_URL = "https://api.weixin.qq.com/channels/ec/order/freshinspect/submit";
+ /** 兑换虚拟号 */
+ String VIRTUAL_TEL_NUMBER_URL = "https://api.weixin.qq.com/channels/ec/order/virtualtelnumber/get";
+ /** 解码订单包含的敏感数据 */
+ String DECODE_SENSITIVE_INFO_URL = "https://api.weixin.qq.com/channels/ec/order/sensitiveinfo/decode";
}
/** 售后相关接口 */
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/enums/BannerType.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/enums/BannerType.java
new file mode 100644
index 0000000000..7cf11eb9ce
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/enums/BannerType.java
@@ -0,0 +1,37 @@
+package me.chanjar.weixin.channel.enums;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+/**
+ * 展示位类型
+ *
+ * @author Zeyes
+ */
+@JsonFormat(shape = JsonFormat.Shape.OBJECT)
+public enum BannerType {
+
+ /** 1 商品 */
+ PRODUCT(1, "商品"),
+ /** 3 视频号 */
+ CHANNEL(3, "视频号"),
+ /** 4 公众号 */
+ MP(4, "公众号");
+
+ ;
+
+ private final int key;
+ private final String value;
+
+ BannerType(int key, String value) {
+ this.key = key;
+ this.value = value;
+ }
+
+ public int getKey() {
+ return key;
+ }
+
+ public String getValue() {
+ return value;
+ }
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/enums/PackageAuditItemType.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/enums/PackageAuditItemType.java
new file mode 100644
index 0000000000..2929b2d381
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/enums/PackageAuditItemType.java
@@ -0,0 +1,37 @@
+package me.chanjar.weixin.channel.enums;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+/**
+ * 商品打包审核项
+ *
+ * @author Zeyes
+ */
+@JsonFormat(shape = JsonFormat.Shape.OBJECT)
+public enum PackageAuditItemType {
+ /** 商品快递单图片url */
+ EXPRESS_PIC("product_express_pic_url", "商品快递单图片url"),
+ /** 商品包装箱图片url */
+ BOX_PIC("product_packaging_box_pic_url", "商品包装箱图片url"),
+ /** 商品开箱图片url */
+ UNBOXING_PIC("product_unboxing_pic_url", "商品开箱图片url"),
+ /** 商品单个细节图片url */
+ DETAIL_PIC("single_product_detail_pic_url", "商品单个细节图片url"),
+ ;
+
+ public final String key;
+ public final String value;
+
+ PackageAuditItemType(String key, String value) {
+ this.key = key;
+ this.value = value;
+ }
+
+ public String getKey() {
+ return key;
+ }
+
+ public String getValue() {
+ return value;
+ }
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/enums/ShareScene.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/enums/ShareScene.java
index b4428dbb24..e2fb09d132 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/enums/ShareScene.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/enums/ShareScene.java
@@ -19,7 +19,18 @@ public enum ShareScene {
CHANNEL_HOME(4, "视频号主页"),
/** 5 商品详情页 */
PRODUCT_DETAIL(5, "商品详情页"),
-
+ /** 6 带商品的公众号文章 */
+ MP_ARTICLE(6, "带商品的公众号文章"),
+ /** 7 商品链接 */
+ PRODUCT_LINK(7, "商品链接"),
+ /** 8 商品二维码 */
+ PRODUCT_QR_CODE(8, "商品二维码"),
+ /** 9 商品口令 */
+ PRODUCT_TAG_LINK(9, "商品口令"),
+ /** 12 视频号橱窗链接 */
+ WINDOW_LINK(12, "视频号橱窗链接"),
+ /** 13 视频号橱窗二维码 */
+ WINDOW_QR_CODE(13, "视频号橱窗二维码"),
;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/enums/WxChannelErrorMsgEnum.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/enums/WxChannelErrorMsgEnum.java
index 4a699c20d0..18e88c0b08 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/enums/WxChannelErrorMsgEnum.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/enums/WxChannelErrorMsgEnum.java
@@ -8,7 +8,9 @@
* 微信视频号全局返回码
*
* @author Zeyes
+ * @deprecated 请使用 {@link me.chanjar.weixin.common.error.WxChannelErrorMsgEnum} 替代
*/
+@Deprecated
@Getter
public enum WxChannelErrorMsgEnum {
/**
diff --git a/weixin-java-channel/src/test/java/me/chanjar/weixin/channel/api/impl/WxChannelBasicServiceImplTest.java b/weixin-java-channel/src/test/java/me/chanjar/weixin/channel/api/impl/WxChannelBasicServiceImplTest.java
index 5673d85439..120e11245a 100644
--- a/weixin-java-channel/src/test/java/me/chanjar/weixin/channel/api/impl/WxChannelBasicServiceImplTest.java
+++ b/weixin-java-channel/src/test/java/me/chanjar/weixin/channel/api/impl/WxChannelBasicServiceImplTest.java
@@ -20,6 +20,8 @@
import me.chanjar.weixin.channel.util.JsonUtils;
import me.chanjar.weixin.common.error.WxErrorException;
import org.apache.commons.io.FileUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.testng.annotations.Guice;
import org.testng.annotations.Test;
@@ -29,9 +31,19 @@
@Guice(modules = ApiTestModule.class)
public class WxChannelBasicServiceImplTest {
+ private static final Logger log = LoggerFactory.getLogger(WxChannelBasicServiceImplTest.class);
+
@Inject
private WxChannelService channelService;
+ @Test
+ public void testGetAccessToken() throws WxErrorException {
+ String accessToken = channelService.getAccessToken();
+ assertNotNull(accessToken);
+ log.info("accessToken: \n{}\n\n", accessToken);
+ System.out.println(accessToken);
+ }
+
@Test
public void testGetShopInfo() throws WxErrorException {
WxChannelBasicService basicService = channelService.getBasicService();
diff --git a/weixin-java-channel/src/test/java/me/chanjar/weixin/channel/api/impl/WxChannelCategoryServiceImplTest.java b/weixin-java-channel/src/test/java/me/chanjar/weixin/channel/api/impl/WxChannelCategoryServiceImplTest.java
index 9b1a62ada3..125e061cd8 100644
--- a/weixin-java-channel/src/test/java/me/chanjar/weixin/channel/api/impl/WxChannelCategoryServiceImplTest.java
+++ b/weixin-java-channel/src/test/java/me/chanjar/weixin/channel/api/impl/WxChannelCategoryServiceImplTest.java
@@ -4,18 +4,24 @@
import static org.testng.Assert.assertTrue;
import com.google.inject.Inject;
-import java.util.ArrayList;
import java.util.List;
+import lombok.extern.slf4j.Slf4j;
import me.chanjar.weixin.channel.api.WxChannelCategoryService;
import me.chanjar.weixin.channel.api.WxChannelService;
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.audit.CategoryAuditRequest;
import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
+import me.chanjar.weixin.channel.bean.category.CategoryAndQualificationList;
import me.chanjar.weixin.channel.bean.category.CategoryDetailResult;
+import me.chanjar.weixin.channel.bean.category.CategoryQualification;
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.test.ApiTestModule;
+import me.chanjar.weixin.channel.util.JsonUtils;
import me.chanjar.weixin.common.error.WxErrorException;
import org.testng.annotations.Guice;
import org.testng.annotations.Test;
@@ -24,6 +30,7 @@
/**
* @author Zeyes
*/
+@Slf4j
@Guice(modules = ApiTestModule.class)
public class WxChannelCategoryServiceImplTest {
@@ -36,21 +43,40 @@ public void testListAllCategory() throws WxErrorException {
CategoryQualificationResponse response = categoryService.listAllCategory();
assertNotNull(response);
assertTrue(response.isSuccess());
- System.out.println(response);
+ //System.out.println(response);
+ // 测试分类:7231 瑜伽服上衣
+ for (CategoryAndQualificationList cat : response.getCatsV2()) {
+ if (cat.getList() == null) {
+ continue;
+ }
+ for (CategoryQualification qua : cat.getList()) {
+ if (qua.getCategory() == null) {
+ log.error("category is null");
+ }
+ if ("7231".equals(qua.getCategory().getId())) {
+ log.info("qua: {}", JsonUtils.encode(qua));
+ }
+ }
+ }
}
@Test
- public void testListAvailableCategory() throws WxErrorException {
+ public void testListAvailableCategories() throws WxErrorException {
WxChannelCategoryService categoryService = channelService.getCategoryService();
- List shopCategories = categoryService.listAvailableCategory("0");
- assertTrue(CollectionUtils.hasElements(shopCategories));
- shopCategories.forEach(System.out::println);
+ ShopCategoryResponse response = categoryService.listAvailableCategories("0");
+ assertNotNull(response);
+ assertTrue(response.isSuccess());
+ List v1 = response.getCategories();
+ List v2 = response.getCatListV2();
+ assertTrue(CollectionUtils.hasElements(v1) || CollectionUtils.hasElements(v2));
+ v1.forEach(System.out::println);
+ v2.forEach(System.out::println);
}
@Test
public void testGetCategoryDetail() throws WxErrorException {
WxChannelCategoryService categoryService = channelService.getCategoryService();
- CategoryDetailResult categoryDetail = categoryService.getCategoryDetail("1602");
+ CategoryDetailResult categoryDetail = categoryService.getCategoryDetail("7231");
assertNotNull(categoryDetail);
assertTrue(categoryDetail.isSuccess());
System.out.println(categoryDetail);
@@ -58,11 +84,47 @@ public void testGetCategoryDetail() throws WxErrorException {
@Test
public void testAddCategory() throws WxErrorException {
+// WxChannelCategoryService categoryService = channelService.getCategoryService();
+// List certificates = new ArrayList<>();
+// certificates.add(
+// "hWNith8iZSrxfN7W2tXOoWSXYWi1qADRJxwImvQl2DC6wqqJrl4g8i/UEZfd59yiiEKAnqy0WETFrOcGZFcJDfpH2ccmNZddzesR1/OpAC7bbfmEiDFBK2QL7MBjhR2m");
+// AuditApplyResponse response = categoryService.addCategory("1001", "1002", "1005", certificates);
+// assertNotNull(response);
+// assertTrue(response.isSuccess());
+// System.out.println(response);
+ String json = "{\n"
+ + " \"category_info\": {\n"
+ + " \"cats_v2\":[\n"
+ + " {\n"
+ + " \"cat_id\": 6033\n"
+ + " },\n"
+ + " {\n"
+ + " \"cat_id\": 6057\n"
+ + " },\n"
+ + " {\n"
+ + " \"cat_id\": 6091\n"
+ + " },\n"
+ + " {\n"
+ + " \"cat_id\": 6093\n"
+ + " }\n"
+ + " ],\n"
+ + " \"certificate\": [\n"
+ + " \"THE_FILE_ID_1\",\n"
+ + " \"THE_FILE_ID_2\"\n"
+ + " ],\n"
+ + " \"brand_list\" : [\n"
+ + " { \"brand_id\": 1001 },\n"
+ + " { \"brand_id\": 1002 }\n"
+ + " ]\n"
+ + " }\n"
+ + "}";
+ CategoryAuditRequest param = JsonUtils.decode(json, CategoryAuditRequest.class);
+ CategoryAuditInfo info = null;
+ if (info != null) {
+ info = param.getCategoryInfo();
+ }
WxChannelCategoryService categoryService = channelService.getCategoryService();
- List certificates = new ArrayList<>();
- certificates.add(
- "hWNith8iZSrxfN7W2tXOoWSXYWi1qADRJxwImvQl2DC6wqqJrl4g8i/UEZfd59yiiEKAnqy0WETFrOcGZFcJDfpH2ccmNZddzesR1/OpAC7bbfmEiDFBK2QL7MBjhR2m");
- AuditApplyResponse response = categoryService.addCategory("1001", "1002", "1005", certificates);
+ AuditApplyResponse response = categoryService.addCategory(info);
assertNotNull(response);
assertTrue(response.isSuccess());
System.out.println(response);
diff --git a/weixin-java-channel/src/test/java/me/chanjar/weixin/channel/api/impl/WxChannelOrderServiceImplTest.java b/weixin-java-channel/src/test/java/me/chanjar/weixin/channel/api/impl/WxChannelOrderServiceImplTest.java
index 2eb14b062e..78bd13e7d6 100644
--- a/weixin-java-channel/src/test/java/me/chanjar/weixin/channel/api/impl/WxChannelOrderServiceImplTest.java
+++ b/weixin-java-channel/src/test/java/me/chanjar/weixin/channel/api/impl/WxChannelOrderServiceImplTest.java
@@ -12,13 +12,16 @@
import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
import me.chanjar.weixin.channel.bean.delivery.DeliveryCompanyResponse;
import me.chanjar.weixin.channel.bean.delivery.DeliveryInfo;
+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.OrderAddressInfo;
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.VirtualTelNumberResponse;
import me.chanjar.weixin.channel.test.ApiTestModule;
import me.chanjar.weixin.common.error.WxErrorException;
import org.testng.annotations.Guice;
@@ -148,4 +151,36 @@ public void testDeliveryOrder() throws WxErrorException {
assertNotNull(response);
assertTrue(response.isSuccess());
}
+
+ @Test
+ public void testUploadFreshInspect() throws WxErrorException {
+ WxChannelOrderService orderService = channelService.getOrderService();
+ String orderId = "123";
+ List items = new ArrayList<>();
+ items.add(new PackageAuditInfo("product_express_pic_url", "https://store.mp.video.tencent-cloud.com/x"));
+ items.add(new PackageAuditInfo("product_packaging_box_panoramic_video_url", "https://store.mp.video.tencent-cloud.com/y"));
+ items.add(new PackageAuditInfo("product_unboxing_panoramic_video_url", "https://store.mp.video.tencent-cloud.com/z"));
+ items.add(new PackageAuditInfo("single_product_detail_panoramic_video_url", "https://store.mp.video.tencent-cloud.com/a"));
+ WxChannelBaseResponse response = orderService.uploadFreshInspect(orderId, items);
+ assertNotNull(response);
+ assertTrue(response.isSuccess());
+ }
+
+ @Test
+ public void testGetVirtualTelNumber() throws WxErrorException {
+ WxChannelOrderService orderService = channelService.getOrderService();
+ String orderId = "123";
+ VirtualTelNumberResponse response = orderService.getVirtualTelNumber(orderId);
+ assertNotNull(response);
+ assertTrue(response.isSuccess());
+ }
+
+ @Test
+ public void testDecodeSensitiveInfo() throws WxErrorException {
+ WxChannelOrderService orderService = channelService.getOrderService();
+ String orderId = "123";
+ DecodeSensitiveInfoResponse response = orderService.decodeSensitiveInfo(orderId);
+ assertNotNull(response);
+ assertTrue(response.isSuccess());
+ }
}
diff --git a/weixin-java-channel/src/test/java/me/chanjar/weixin/channel/api/impl/WxChannelProductServiceImplTest.java b/weixin-java-channel/src/test/java/me/chanjar/weixin/channel/api/impl/WxChannelProductServiceImplTest.java
index b14bc9b3fc..ed83434ee0 100644
--- a/weixin-java-channel/src/test/java/me/chanjar/weixin/channel/api/impl/WxChannelProductServiceImplTest.java
+++ b/weixin-java-channel/src/test/java/me/chanjar/weixin/channel/api/impl/WxChannelProductServiceImplTest.java
@@ -4,17 +4,23 @@
import static org.testng.Assert.assertTrue;
import com.google.inject.Inject;
+import java.util.ArrayList;
+import java.util.List;
import me.chanjar.weixin.channel.api.WxChannelProductService;
import me.chanjar.weixin.channel.api.WxChannelService;
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.SkuStockBatchResponse;
import me.chanjar.weixin.channel.bean.product.SkuStockResponse;
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.channel.test.ApiTestModule;
import me.chanjar.weixin.common.error.WxErrorException;
import org.testng.annotations.Guice;
@@ -32,7 +38,7 @@ public class WxChannelProductServiceImplTest {
@Test
public void testAddProduct() throws WxErrorException {
WxChannelProductService productService = channelService.getProductService();
- SpuInfo spuInfo = new SpuInfo();
+ SpuUpdateInfo spuInfo = new SpuUpdateInfo();
// ...
SpuUpdateResponse response = productService.addProduct(spuInfo);
assertNotNull(response);
@@ -42,7 +48,7 @@ public void testAddProduct() throws WxErrorException {
@Test
public void testUpdateProduct() throws WxErrorException {
WxChannelProductService productService = channelService.getProductService();
- SpuInfo spuInfo = new SpuInfo();
+ SpuUpdateInfo spuInfo = new SpuUpdateInfo();
// ...
SpuUpdateResponse response = productService.updateProduct(spuInfo);
assertNotNull(response);
@@ -121,13 +127,53 @@ public void testDownProduct() throws WxErrorException {
@Test
public void testGetSkuStock() throws WxErrorException {
WxChannelProductService productService = channelService.getProductService();
- String productId = "";
- String skuId = "";
+ String productId = "10000076089602";
+ String skuId = "1918289111";
SkuStockResponse response = productService.getSkuStock(productId, skuId);
assertNotNull(response);
assertTrue(response.isSuccess());
}
+ @Test
+ public void testGetSkuStockBatch() throws WxErrorException {
+ WxChannelProductService productService = channelService.getProductService();
+ List productIds = new ArrayList<>();
+ productIds.add("123");
+ SkuStockBatchResponse response = productService.getSkuStockBatch(productIds);
+ assertNotNull(response);
+ assertTrue(response.isSuccess());
+ }
+
+ @Test
+ public void testGetProductH5Url() throws WxErrorException {
+ WxChannelProductService productService = channelService.getProductService();
+ String productId = "";
+ ProductH5UrlResponse response = productService.getProductH5Url(productId);
+ assertNotNull(response);
+ assertTrue(response.isSuccess());
+ System.out.println(response.getProductH5url());
+ }
+
+ @Test
+ public void testGetProductQrCode() throws WxErrorException {
+ WxChannelProductService productService = channelService.getProductService();
+ String productId = "";
+ ProductQrCodeResponse response = productService.getProductQrCode(productId);
+ assertNotNull(response);
+ assertTrue(response.isSuccess());
+ System.out.println(response.getProductQrcode());
+ }
+
+ @Test
+ public void testGetProductTagLink() throws WxErrorException {
+ WxChannelProductService productService = channelService.getProductService();
+ String productId = "";
+ ProductTagLinkResponse response = productService.getProductTagLink(productId);
+ assertNotNull(response);
+ assertTrue(response.isSuccess());
+ System.out.println(response.getProductTaglink());
+ }
+
@Test
public void testAddLimitTask() throws WxErrorException {
WxChannelProductService productService = channelService.getProductService();
diff --git a/weixin-java-channel/src/test/java/me/chanjar/weixin/channel/api/impl/WxChannelVipServiceImplTest.java b/weixin-java-channel/src/test/java/me/chanjar/weixin/channel/api/impl/WxChannelVipServiceImplTest.java
new file mode 100644
index 0000000000..fdcf599e90
--- /dev/null
+++ b/weixin-java-channel/src/test/java/me/chanjar/weixin/channel/api/impl/WxChannelVipServiceImplTest.java
@@ -0,0 +1,32 @@
+package me.chanjar.weixin.channel.api.impl;
+
+import static org.testng.Assert.assertNotNull;
+import static org.testng.Assert.assertTrue;
+
+import com.google.inject.Inject;
+import me.chanjar.weixin.channel.api.WxChannelService;
+import me.chanjar.weixin.channel.bean.vip.VipInfoResponse;
+import me.chanjar.weixin.channel.test.ApiTestModule;
+import me.chanjar.weixin.channel.util.JsonUtils;
+import me.chanjar.weixin.common.error.WxErrorException;
+import org.testng.annotations.Guice;
+import org.testng.annotations.Test;
+
+/**
+ * @author Zeyes
+ */
+@Guice(modules = ApiTestModule.class)
+public class WxChannelVipServiceImplTest {
+ @Inject
+ private WxChannelService channelService;
+
+ @Test
+ public void getVipInfo() throws WxErrorException {
+ String openId = "";
+ Boolean needPhoneNumber = false;
+ VipInfoResponse response = channelService.getVipService().getVipInfo(openId, needPhoneNumber);
+ System.out.println(JsonUtils.encode(response));
+ assertNotNull(response);
+ assertTrue(response.isSuccess());
+ }
+}
diff --git a/weixin-java-channel/src/test/java/me/chanjar/weixin/channel/api/impl/WxStoreHomePageServiceImplTest.java b/weixin-java-channel/src/test/java/me/chanjar/weixin/channel/api/impl/WxStoreHomePageServiceImplTest.java
new file mode 100644
index 0000000000..0d6bb8c479
--- /dev/null
+++ b/weixin-java-channel/src/test/java/me/chanjar/weixin/channel/api/impl/WxStoreHomePageServiceImplTest.java
@@ -0,0 +1,339 @@
+package me.chanjar.weixin.channel.api.impl;
+
+import static org.testng.Assert.assertNotNull;
+import static org.testng.Assert.assertTrue;
+
+import com.google.inject.Inject;
+import me.chanjar.weixin.channel.api.WxStoreHomePageService;
+import me.chanjar.weixin.channel.api.WxChannelService;
+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.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.WindowProductSettingResponse;
+import me.chanjar.weixin.channel.test.ApiTestModule;
+import me.chanjar.weixin.channel.util.JsonUtils;
+import me.chanjar.weixin.common.error.WxErrorException;
+import org.testng.annotations.Guice;
+import org.testng.annotations.Test;
+
+/**
+ * @author Zeyes
+ */
+@Guice(modules = ApiTestModule.class)
+public class WxStoreHomePageServiceImplTest {
+
+ @Inject
+ private WxChannelService channelService;
+
+ @Test
+ public void testAddTreeProduct() throws WxErrorException {
+ WxStoreHomePageService service = channelService.getHomePageService();
+ // https://developers.weixin.qq.com/doc/store/API/homepage/classification/addclassificationproduct.html
+ String json = "{\n"
+ + " \"req\": {\n"
+ + " \"level_1_id\": 10000046,\n"
+ + " \"level_2_id\": 10000048,\n"
+ + " \"product_ids\": [\n"
+ + " 10000076089602\n"
+ + " ]\n"
+ + " }\n"
+ + "}";
+ TreeProductEditParam param = JsonUtils.decode(json, TreeProductEditParam.class);
+ TreeProductEditInfo info = null;
+ if (param != null) {
+ info = param.getReq();
+ }
+ WxChannelBaseResponse response = service.addTreeProduct(info);
+ assertNotNull(response);
+ assertTrue(response.isSuccess());
+ assertNotNull(info);
+ System.out.println(JsonUtils.encode(response));
+ }
+
+ @Test
+ public void testDelTreeProduct() throws WxErrorException {
+ WxStoreHomePageService service = channelService.getHomePageService();
+ String json = "{\n"
+ + " \"req\": {\n"
+ + " \"level_1_id\": 1,\n"
+ + " \"level_2_id\": 0,\n"
+ + " \"product_ids\": [\n"
+ + " 123\n"
+ + " ]\n"
+ + " }\n"
+ + "}";
+ TreeProductEditParam param = JsonUtils.decode(json, TreeProductEditParam.class);
+ TreeProductEditInfo info = null;
+ if (param != null) {
+ info = param.getReq();
+ }
+ WxChannelBaseResponse response = service.delTreeProduct(info);
+ assertNotNull(response);
+ assertTrue(response.isSuccess());
+ assertNotNull(info);
+ System.out.println(JsonUtils.encode(response));
+ }
+
+ @Test
+ public void testGetTreeProductList() throws WxErrorException {
+ WxStoreHomePageService service = channelService.getHomePageService();
+ String pageContext = "";
+ TreeProductListInfo info = new TreeProductListInfo();
+ info.setLevel1Id(1);
+ info.setLevel2Id(2);
+ info.setPageSize(10);
+ info.setPageContext(pageContext);
+ TreeProductListResponse response = service.getTreeProductList(info);
+ assertNotNull(response);
+ assertTrue(response.isSuccess());
+ assertNotNull(info);
+ System.out.println(JsonUtils.encode(response));
+ }
+
+ @Test
+ public void testSetShowTree() throws WxErrorException {
+ WxStoreHomePageService service = channelService.getHomePageService();
+ // https://developers.weixin.qq.com/doc/store/API/homepage/classification/setclassificationtree.html
+ String json = "{\n"
+ + " \"req\": {\n"
+ + " \"version\": 121,\n"
+ + " \"classification_id_deleted\": [\n"
+ + " \"1.2\"\n"
+ + " ],\n"
+ + " \"tree\": {\n"
+ + " \"level_1\": [\n"
+ + " {\n"
+ + " \"id\": 4,\n"
+ + " \"name\": \"测试7\",\n"
+ + " \"level_2\": [\n"
+ + " {\n"
+ + " \"id\": 5,\n"
+ + " \"name\": \"1\",\n"
+ + " \"is_displayed\": 1\n"
+ + " }\n"
+ + " ],\n"
+ + " \"is_displayed\": 1\n"
+ + " },\n"
+ + " {\n"
+ + " \"id\": 6,\n"
+ + " \"name\": \"测试8\",\n"
+ + " \"level_2\": [\n"
+ + " {\n"
+ + " \"id\": 7,\n"
+ + " \"name\": \"1\",\n"
+ + " \"is_displayed\": 1\n"
+ + " },\n"
+ + " {\n"
+ + " \"id\": 8,\n"
+ + " \"name\": \"2\",\n"
+ + " \"is_displayed\": 1\n"
+ + " }\n"
+ + " ],\n"
+ + " \"is_displayed\": 1\n"
+ + " }\n"
+ + " ]\n"
+ + " }\n"
+ + " }\n"
+ + "}";
+ TreeShowParam param = JsonUtils.decode(json, TreeShowParam.class);
+ TreeShowInfo info = null;
+ if (param != null) {
+ info = param.getReq();
+ }
+ TreeShowSetResponse response = service.setShowTree(info);
+ assertNotNull(response);
+ assertTrue(response.isSuccess());
+ assertNotNull(info);
+ System.out.println(JsonUtils.encode(response));
+ }
+
+ @Test
+ public void testGetShowTree() throws WxErrorException {
+ WxStoreHomePageService service = channelService.getHomePageService();
+ TreeShowGetResponse response = service.getShowTree();
+ assertNotNull(response);
+ assertTrue(response.isSuccess());
+ System.out.println(JsonUtils.encode(response));
+ }
+
+ @Test
+ public void testListWindowProduct() throws WxErrorException {
+ WxStoreHomePageService service = channelService.getHomePageService();
+ Integer pageSize = 1;
+ String nextKey = "";
+ WindowProductSettingResponse response = service.listWindowProduct(pageSize, nextKey);
+ assertNotNull(response);
+ assertTrue(response.isSuccess());
+ System.out.println(JsonUtils.encode(response));
+ }
+
+ @Test
+ public void testReorderWindowProduct() throws WxErrorException {
+ WxStoreHomePageService service = channelService.getHomePageService();
+ String productId = "";
+ Integer indexNum = 100;
+ WxChannelBaseResponse response = service.reorderWindowProduct(productId, indexNum);
+ assertNotNull(response);
+ assertTrue(response.isSuccess());
+ System.out.println(JsonUtils.encode(response));
+ }
+
+ @Test
+ public void testHideWindowProduct() throws WxErrorException {
+ WxStoreHomePageService service = channelService.getHomePageService();
+ String productId = "";
+ // 0:显示 1:隐藏
+ Integer setHide = 0;
+ WxChannelBaseResponse response = service.hideWindowProduct(productId, setHide);
+ assertNotNull(response);
+ assertTrue(response.isSuccess());
+ System.out.println(JsonUtils.encode(response));
+ }
+
+ @Test
+ public void testTopWindowProduct() throws WxErrorException {
+ WxStoreHomePageService service = channelService.getHomePageService();
+ String productId = "";
+ // 0:取消置顶 1:置顶
+ Integer setTop = 0;
+ WxChannelBaseResponse response = service.topWindowProduct(productId, setTop);
+ assertNotNull(response);
+ assertTrue(response.isSuccess());
+ System.out.println(JsonUtils.encode(response));
+ }
+
+ @Test
+ public void testApplyBackground() throws WxErrorException {
+ WxStoreHomePageService service = channelService.getHomePageService();
+ String imgUrl = "https://github.githubassets.com/images/icons/emoji/octocat.png";
+ BackgroundApplyResponse response = service.applyBackground(imgUrl);
+ assertNotNull(response);
+ assertTrue(response.isSuccess());
+ System.out.println(JsonUtils.encode(response));
+ }
+
+ @Test
+ public void testGetBackground() throws WxErrorException {
+ WxStoreHomePageService service = channelService.getHomePageService();
+ BackgroundGetResponse response = service.getBackground();
+ assertNotNull(response);
+ assertTrue(response.isSuccess());
+ System.out.println(JsonUtils.encode(response));
+ }
+
+ @Test
+ public void testCancelBackground() throws WxErrorException {
+ Integer applyId = 1;
+ WxStoreHomePageService service = channelService.getHomePageService();
+ WxChannelBaseResponse response = service.cancelBackground(applyId);
+ assertNotNull(response);
+ assertTrue(response.isSuccess());
+ System.out.println(JsonUtils.encode(response));
+ }
+
+ @Test
+ public void testRemoveBackground() throws WxErrorException {
+ WxStoreHomePageService service = channelService.getHomePageService();
+ WxChannelBaseResponse response = service.removeBackground();
+ assertNotNull(response);
+ assertTrue(response.isSuccess());
+ System.out.println(JsonUtils.encode(response));
+ }
+
+ @Test
+ public void testApplyBanner() throws WxErrorException {
+ WxStoreHomePageService service = channelService.getHomePageService();
+ // https://developers.weixin.qq.com/doc/store/API/homepage/banner/submit_banner_apply.html
+ String json = "{\n"
+ + " \"banner\": {\n"
+ + " \"scale\": 2,\n"
+ + " \"banner\": [\n"
+ + " {\n"
+ + " \"type\": 1,\n"
+ + " \"product\": {\n"
+ + " \"product_id\": 123\n"
+ + " },\n"
+ + " \"banner\": {\n"
+ + " \"description\": \"测试商品精品展示位描述\",\n"
+ + " \"img_url\": \"https://store.mp.video.tencent-cloud.com/abc\",\n"
+ + " \"title\": \"测试商品精品展示位标题\"\n"
+ + " }\n"
+ + " },\n"
+ + " {\n"
+ + " \"type\": 3,\n"
+ + " \"finder\": {\n"
+ + " \"feed_id\": \"export/abc\",\n"
+ + " \"finder_user_name\": \"sphabc\"\n"
+ + " },\n"
+ + " \"banner\": {\n"
+ + " \"description\": \"测试视频号视频精品展示位描述\",\n"
+ + " \"img_url\": \"https://store.mp.video.tencent-cloud.com/abc\",\n"
+ + " \"title\": \"测试视频号视频精品展示位标题\"\n"
+ + " }\n"
+ + " },\n"
+ + " {\n"
+ + " \"type\": 4,\n"
+ + " \"official_account\": {\n"
+ + " \"url\": \"https://mp.weixin.qq.com/abc\"\n"
+ + " },\n"
+ + " \"banner\": {\n"
+ + " \"description\": \"测试公众号文章精品展示位描述\",\n"
+ + " \"img_url\": \"https://store.mp.video.tencent-cloud.com/abc\",\n"
+ + " \"title\": \"测试公众号文章精品展示位标题\"\n"
+ + " }\n"
+ + " }\n"
+ + " ]\n"
+ + " }\n"
+ + "}";
+ BannerApplyParam param = JsonUtils.decode(json, BannerApplyParam.class);
+ BannerInfo info = null;
+ if (param != null) {
+ info = param.getBanner();
+ }
+ BannerApplyResponse response = service.applyBanner(info);
+ assertNotNull(response);
+ assertTrue(response.isSuccess());
+ assertNotNull(info);
+ System.out.println(JsonUtils.encode(response));
+ }
+
+ @Test
+ public void testGetBanner() throws WxErrorException {
+ WxStoreHomePageService service = channelService.getHomePageService();
+ BannerGetResponse response = service.getBanner();
+ assertNotNull(response);
+ assertTrue(response.isSuccess());
+ System.out.println(JsonUtils.encode(response));
+ }
+
+ @Test
+ public void testCancelBanner() throws WxErrorException {
+ Integer applyId = 1;
+ WxStoreHomePageService service = channelService.getHomePageService();
+ WxChannelBaseResponse response = service.cancelBanner(applyId);
+ assertNotNull(response);
+ assertTrue(response.isSuccess());
+ System.out.println(JsonUtils.encode(response));
+ }
+
+ @Test
+ public void testRemoveBanner() throws WxErrorException {
+ WxStoreHomePageService service = channelService.getHomePageService();
+ WxChannelBaseResponse response = service.removeBanner();
+ assertNotNull(response);
+ assertTrue(response.isSuccess());
+ System.out.println(JsonUtils.encode(response));
+ }
+}
diff --git a/weixin-java-channel/src/test/java/me/chanjar/weixin/channel/message/WxChannelMessageRouterTest.java b/weixin-java-channel/src/test/java/me/chanjar/weixin/channel/message/WxChannelMessageRouterTest.java
index 755886fa4b..4c39d45382 100644
--- a/weixin-java-channel/src/test/java/me/chanjar/weixin/channel/message/WxChannelMessageRouterTest.java
+++ b/weixin-java-channel/src/test/java/me/chanjar/weixin/channel/message/WxChannelMessageRouterTest.java
@@ -1,7 +1,9 @@
package me.chanjar.weixin.channel.message;
import static me.chanjar.weixin.channel.constant.MessageEventConstants.BRAND;
+import static me.chanjar.weixin.channel.constant.MessageEventConstants.CLOSE_STORE;
import static me.chanjar.weixin.channel.constant.MessageEventConstants.PRODUCT_SPU_AUDIT;
+import static me.chanjar.weixin.channel.constant.MessageEventConstants.SET_SHOP_NICKNAME;
import static org.testng.Assert.*;
import com.google.inject.Inject;
@@ -10,6 +12,8 @@
import me.chanjar.weixin.channel.api.WxChannelService;
import me.chanjar.weixin.channel.bean.message.product.BrandMessage;
import me.chanjar.weixin.channel.bean.message.product.SpuAuditMessage;
+import me.chanjar.weixin.channel.bean.message.store.CloseStoreMessage;
+import me.chanjar.weixin.channel.bean.message.store.NicknameUpdateMessage;
import me.chanjar.weixin.channel.message.rule.HandlerConsumer;
import me.chanjar.weixin.channel.test.ApiTestModule;
import me.chanjar.weixin.channel.util.JsonUtils;
@@ -56,6 +60,48 @@ public void test1() {
}
}
+ @Test
+ public void closeStore() {
+ WxChannelMessageRouter router = new WxChannelMessageRouter();
+ /* 小店注销 */
+ this.addRule(router, CloseStoreMessage.class, CLOSE_STORE, this::closeStore);
+ /* 小店修改名称 */
+ this.addRule(router, NicknameUpdateMessage.class, SET_SHOP_NICKNAME, this::updateNickname);
+ String closeStoreJson = "{\n"
+ + " \"ToUserName\": \"gh_*\",\n"
+ + " \"FromUserName\": \"OPENID\",\n"
+ + " \"CreateTime\": 1662480000,\n"
+ + " \"MsgType\": \"event\",\n"
+ + " \"Event\": \"channels_ec_close_store\",\n"
+ + " \"appid\": \"APPID\",\n"
+ + " \"close_timestamp\": \"1662480000\"\n"
+ + "}";
+ String updateNicknameJson = "{\n"
+ + " \"ToUserName\": \"gh_*\", \n"
+ + " \"FromUserName\": \"OPENID\", \n"
+ + " \"CreateTime\": 1662480000, \n"
+ + " \"MsgType\": \"event\", \n"
+ + " \"Event\": \"set_shop_nickname\", \n"
+ + " \"appid\": \"APPID\",\n"
+ + " \"old_nickname\": \"旧昵称\",\n"
+ + " \"new_nickname\": \"新昵称\"\n"
+ + "}";
+ WxChannelMessage message1 = JsonUtils.decode(closeStoreJson, WxChannelMessage.class);
+ WxChannelMessage message2 = JsonUtils.decode(updateNicknameJson, WxChannelMessage.class);
+ Object result1 = router.route(message1, closeStoreJson, "123456", channelService);
+ if (result1 != null) {
+ log.info("result1:{}", result1);
+ } else {
+ log.info("result1 return null");
+ }
+ Object result2 = router.route(message2, updateNicknameJson, "123456", channelService);
+ if (result2 != null) {
+ log.info("result2:{}", result2);
+ } else {
+ log.info("result2 return null");
+ }
+ }
+
public void brandUpdate(BrandMessage message, String content, String appId,
Map context, WxSessionManager sessionManager) {
log.info("品牌更新:{}", JsonUtils.encode(message));
@@ -67,6 +113,16 @@ public void spuAudit(SpuAuditMessage message, String content, String appId,
log.info("商品审核:{}", JsonUtils.encode(message));
}
+ public void closeStore(CloseStoreMessage message, String content, String appId,
+ Map context, WxSessionManager sessionManager) {
+ log.info("小店注销:{}", JsonUtils.encode(message));
+ }
+
+ 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/test/java/me/chanjar/weixin/channel/test/ApiTestModule.java b/weixin-java-channel/src/test/java/me/chanjar/weixin/channel/test/ApiTestModule.java
index 8eba81a07e..ddfb3a4b8a 100644
--- a/weixin-java-channel/src/test/java/me/chanjar/weixin/channel/test/ApiTestModule.java
+++ b/weixin-java-channel/src/test/java/me/chanjar/weixin/channel/test/ApiTestModule.java
@@ -29,6 +29,7 @@ public void configure(Binder binder) {
"测试配置文件【" + TEST_CONFIG_XML + "】未找到,请参照test-config-sample.xml文件生成");
}
+ // 提示xml相关依赖不存在时,引入一下就好
TestConfig config = this.fromXml(TestConfig.class, inputStream);
WxChannelService service = new WxChannelServiceImpl();
diff --git a/weixin-java-channel/src/test/resources/test-config.sample.xml b/weixin-java-channel/src/test/resources/test-config.sample.xml
index b04a50e5a7..b84d8d9109 100644
--- a/weixin-java-channel/src/test/resources/test-config.sample.xml
+++ b/weixin-java-channel/src/test/resources/test-config.sample.xml
@@ -4,6 +4,7 @@
secret
Token
EncodingAESKey
+ false
可以不填写
可以不填写
diff --git a/weixin-java-common/src/main/java/me/chanjar/weixin/common/error/WxChannelErrorMsgEnum.java b/weixin-java-common/src/main/java/me/chanjar/weixin/common/error/WxChannelErrorMsgEnum.java
new file mode 100644
index 0000000000..3491e74dc8
--- /dev/null
+++ b/weixin-java-common/src/main/java/me/chanjar/weixin/common/error/WxChannelErrorMsgEnum.java
@@ -0,0 +1,172 @@
+package me.chanjar.weixin.common.error;
+
+import com.google.common.collect.Maps;
+import java.util.Map;
+
+/**
+ *
+ *
+ * 微信小店公共错误码.
+ * 参考文档:微信小店公共错误码
+ *
+ *
+ * @author Zeyes
+ */
+public enum WxChannelErrorMsgEnum {
+ /**
+ * 系统繁忙,此时请开发者稍候再试 system error
+ */
+ CODE_1(-1, "系统繁忙,此时请开发者稍候再试"),
+ /**
+ * 请求成功 ok
+ */
+ CODE_0(0, "请求成功"),
+ /**
+ * 获取 access_token 时 AppSecret 错误,或者 access_token 无效。请开发者认真检查 AppSecret 的正确性
+ * invalid credential, access_token is invalid or not latest, could get access_token by getStableAccessToken, more details at https://mmbizurl.cn/s/JtxxFh33r
+ */
+ CODE_40001(40001, "获取 access_token 时 AppSecret 错误,或者 access_token 无效。请开发者认真检查 AppSecret 的正确性"),
+ /**
+ * 请检查 openid 的正确性
+ * invalid openid
+ */
+ CODE_40003(40003, "请检查 openid 的正确性"),
+ /**
+ * 请检查 appid 的正确性,避免异常字符,注意大小写
+ * invalid appid
+ */
+ CODE_40013(40013, "请检查 appid 的正确性,避免异常字符,注意大小写"),
+ /**
+ * 请检查API的URL是否与文档一致
+ * invalid url
+ */
+ CODE_40066(40066, "请检查API的URL是否与文档一致"),
+ /**
+ * 缺少 access_token 参数
+ * access_token missing
+ */
+ CODE_41001(41001, "缺少 access_token 参数"),
+ /**
+ * 请检查URL参数中是否有 ?appid=
+ * appid missing
+ */
+ CODE_41002(41002, "请检查URL参数中是否有 ?appid="),
+ /**
+ * 请检查POST json中是否包含component_ appid宇段
+ * missing component_appid
+ */
+ CODE_41018(41018, "请检查POST json中是否包含component_ appid宇段"),
+ /**
+ * access_token失效,需要重新获取新的access_token
+ * access_token expired
+ */
+ CODE_42001(42001, "access_token失效,需要重新获取新的access_token"),
+ /**
+ * 请检查发起API请求的Method是否为POST
+ * require POST method
+ */
+ CODE_43002(43002, "请检查发起API请求的Method是否为POST"),
+ /**
+ * 请使用HTTPS方式清求,不要使用HTTP方式
+ * require https
+ */
+ CODE_43003(43003, "请使用HTTPS方式清求,不要使用HTTP方式"),
+ /**
+ * POST 的数据包为空
+ * empty post data
+ */
+ CODE_44002(44002, "POST 的数据包为空"),
+ /**
+ * 请对数据进行压缩
+ * content size out of limit
+ */
+ CODE_45002(45002, "请对数据进行压缩"),
+ /**
+ * 查看调用次数是否符合预期,可通过get_api_quota接口获取每天的调用quota;用完后可通过clear_quota进行清空
+ * reach max api daily quota limit
+ */
+ CODE_45009(45009, "查看调用次数是否符合预期,可通过get_api_quota接口获取每天的调用quota;用完后可通过clear_quota进行清空"),
+ /**
+ * 命中每分钟的频率限制
+ * api minute-quota reach limit must slower retry next minute
+ */
+ CODE_45011(45011, "命中每分钟的频率限制"),
+ /**
+ * 需要登录 channels.weixin.qq.com/shop 配置IP白名单
+ * access clientip is not registered, not in ip-white-list
+ */
+ CODE_45035(45035, "需要登录 channels.weixin.qq.com/shop 配置IP白名单"),
+ /**
+ * 解析 JSON/XML 内容错误
+ * data format error
+ */
+ CODE_47001(47001, "解析 JSON/XML 内容错误"),
+ /**
+ * 没有该接口权限
+ * api unauthorized
+ */
+ CODE_48001(48001, "没有该接口权限"),
+ /**
+ * 接口被禁用
+ * api forbidden for irregularities
+ */
+ CODE_48004(48004, "接口被禁用"),
+ /**
+ * 请找用户获取该api授权
+ * user unauthorized
+ */
+ CODE_50001(50001, "请找用户获取该api授权"),
+ /**
+ * 请检查封禁原因
+ * user limited
+ */
+ CODE_50002(50002, "请检查封禁原因"),
+ /**
+ * 需要登录 channels.weixin.qq.com/shop 配置IP白名单
+ * access clientip is not registered, not in ip-white-list
+ */
+ CODE_61004(61004, "需要登录 channels.weixin.qq.com/shop 配置IP白名单"),
+ /**
+ * 请检查第三方平台服务商检查已获取的授权集
+ * api is unauthorized to component
+ */
+ CODE_61007(61007, "请检查第三方平台服务商检查已获取的授权集"),
+ /**
+ * 需要登录 channels.weixin.qq.com/shop 继续完成注销
+ * 账号发起注销,进入注销公示期
+ */
+ CODE_10080000(10080000, "需要登录 channels.weixin.qq.com/shop 继续完成注销"),
+ /**
+ * 账号已注销
+ */
+ CODE_10080001(10080001, "账号已注销"),
+ /**
+ * 小店的视频号带货身份为达人号,不允许使用该功能,如需使用,请将带货身份修改为商家
+ */
+ CODE_10080002(10080002, "小店的视频号带货身份为达人号,不允许使用该功能,如需使用,请将带货身份修改为商家"),
+
+ ;
+
+ private final int code;
+ private final String msg;
+
+ WxChannelErrorMsgEnum(int code, String msg) {
+ this.code = code;
+ this.msg = msg;
+ }
+
+ static final Map valueMap = Maps.newHashMap();
+
+ static {
+ for (WxChannelErrorMsgEnum value : WxChannelErrorMsgEnum.values()) {
+ valueMap.put(value.code, value.msg);
+ }
+ }
+
+ /**
+ * 通过错误代码查找其中文含义.
+ */
+ public static String findMsgByCode(int code) {
+ return valueMap.getOrDefault(code, null);
+ }
+}
diff --git a/weixin-java-common/src/main/java/me/chanjar/weixin/common/error/WxError.java b/weixin-java-common/src/main/java/me/chanjar/weixin/common/error/WxError.java
index 1156636ea3..b45fba3411 100644
--- a/weixin-java-common/src/main/java/me/chanjar/weixin/common/error/WxError.java
+++ b/weixin-java-common/src/main/java/me/chanjar/weixin/common/error/WxError.java
@@ -91,6 +91,13 @@ public static WxError fromJson(String json, WxType type) {
}
break;
}
+ case Channel: {
+ final String msg = WxChannelErrorMsgEnum.findMsgByCode(wxError.getErrorCode());
+ if (msg != null) {
+ wxError.setErrorMsg(msg);
+ }
+ break;
+ }
default:
return wxError;
}
From fae5cad6942bee8fddab7398d5eb16ee5b8c8207 Mon Sep 17 00:00:00 2001
From: Zeyes Lee
Date: Sun, 1 Dec 2024 23:22:26 +0800
Subject: [PATCH 008/326] =?UTF-8?q?:new:=20#3427=E3=80=90=E8=A7=86?=
=?UTF-8?q?=E9=A2=91=E5=8F=B7=E3=80=91=E6=96=B0=E5=A2=9E=E7=BD=97=E7=9B=98?=
=?UTF-8?q?=E5=95=86=E5=AE=B6=E7=89=88API=E3=80=81=E5=BE=AE=E4=BF=A1?=
=?UTF-8?q?=E5=B0=8F=E5=BA=97=E5=90=88=E4=BD=9C=E8=B4=A6=E5=8F=B7API?=
=?UTF-8?q?=E7=9B=B8=E5=85=B3=E6=8E=A5=E5=8F=A3=E4=BB=A5=E5=8F=8A=E8=AE=A2?=
=?UTF-8?q?=E5=8D=95=E5=BE=85=E5=8F=91=E8=B4=A7=E6=B6=88=E6=81=AF=E5=9B=9E?=
=?UTF-8?q?=E8=B0=83?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
README.md | 1 +
.../api/BaseWxChannelMessageService.java | 12 ++
.../api/WxChannelCompassShopService.java | 126 +++++++++++++++
.../weixin/channel/api/WxChannelService.java | 14 ++
.../api/WxStoreCooperationService.java | 70 +++++++++
.../impl/BaseWxChannelMessageServiceImpl.java | 8 +
.../api/impl/BaseWxChannelServiceImpl.java | 46 ++++--
.../WxChannelCompassFinderServiceImpl.java | 1 +
.../impl/WxChannelCompassShopServiceImpl.java | 116 ++++++++++++++
.../impl/WxStoreCooperationServiceImpl.java | 68 +++++++++
.../bean/after/AfterSaleListResponse.java | 3 +-
.../bean/category/PassCategoryResponse.java | 2 +
.../{finder => }/CompassFinderBaseParam.java | 2 +-
.../bean/compass/finder/ProductDataParam.java | 1 +
.../compass/finder/SaleProfileDataParam.java | 1 +
.../compass/shop/CompassFinderIdParam.java | 32 ++++
.../compass/shop/FinderAuthListResponse.java | 30 ++++
.../bean/compass/shop/FinderGmvData.java | 39 +++++
.../bean/compass/shop/FinderGmvItem.java | 30 ++++
.../bean/compass/shop/FinderListResponse.java | 26 ++++
.../bean/compass/shop/FinderOverallData.java | 35 +++++
.../compass/shop/FinderOverallResponse.java | 26 ++++
.../compass/shop/FinderProductListItem.java | 66 ++++++++
.../shop/FinderProductListResponse.java | 28 ++++
.../shop/FinderProductOverallResponse.java | 25 +++
.../shop/FinderProductSimpleGmvData.java | 26 ++++
.../channel/bean/compass/shop/ShopField.java | 44 ++++++
.../bean/compass/shop/ShopLiveData.java | 36 +++++
.../compass/shop/ShopLiveListResponse.java | 26 ++++
.../bean/compass/shop/ShopOverall.java | 42 +++++
.../compass/shop/ShopOverallResponse.java | 27 ++++
.../compass/shop/ShopProductCompassData.java | 143 ++++++++++++++++++
.../compass/shop/ShopProductDataParam.java | 32 ++++
.../compass/shop/ShopProductDataResponse.java | 26 ++++
.../bean/compass/shop/ShopProductInfo.java | 51 +++++++
.../compass/shop/ShopProductListResponse.java | 26 ++++
.../compass/shop/ShopSaleProfileData.java | 24 +++
.../shop/ShopSaleProfileDataParam.java | 32 ++++
.../shop/ShopSaleProfileDataResponse.java | 25 +++
.../bean/cooperation/CooperationData.java | 47 ++++++
.../cooperation/CooperationListResponse.java | 25 +++
.../bean/cooperation/CooperationQrCode.java | 23 +++
.../CooperationQrCodeResponse.java | 24 +++
.../cooperation/CooperationSharerParam.java | 30 ++++
.../bean/cooperation/CooperationStatus.java | 23 +++
.../CooperationStatusResponse.java | 24 +++
.../bean/freight/ConditionFreeDetail.java | 4 +-
.../supplier/SupplierFlowListResponse.java | 3 +-
.../channel/bean/order/OrderPriceInfo.java | 6 +-
.../channel/bean/order/OrderProductInfo.java | 18 +++
.../weixin/channel/bean/product/SpuInfo.java | 10 +-
.../constant/MessageEventConstants.java | 2 +
.../constant/WxChannelApiUrlConstants.java | 45 +++++-
.../weixin/channel/enums/FundsType.java | 19 ++-
.../weixin/channel/enums/PromoteType.java | 9 +-
.../weixin/channel/enums/SendTime.java | 6 +-
.../weixin/channel/enums/SpuEditStatus.java | 8 +-
.../weixin/channel/enums/SpuStatus.java | 12 +-
.../WxChannelCompassShopServiceImplTest.java | 125 +++++++++++++++
.../WxStoreCooperationServiceImplTest.java | 66 ++++++++
.../WxChannelMessageRouterRuleTest.java | 3 +-
.../message/WxChannelMessageRouterTest.java | 3 +-
62 files changed, 1869 insertions(+), 34 deletions(-)
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelCompassShopService.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxStoreCooperationService.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelCompassShopServiceImpl.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxStoreCooperationServiceImpl.java
rename weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/{finder => }/CompassFinderBaseParam.java (92%)
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/CompassFinderIdParam.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/FinderAuthListResponse.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/FinderGmvData.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/FinderGmvItem.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/FinderListResponse.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/FinderOverallData.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/FinderOverallResponse.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/FinderProductListItem.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/FinderProductListResponse.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/FinderProductOverallResponse.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/FinderProductSimpleGmvData.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopField.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopLiveData.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopLiveListResponse.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopOverall.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopOverallResponse.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopProductCompassData.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopProductDataParam.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopProductDataResponse.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopProductInfo.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopProductListResponse.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopSaleProfileData.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopSaleProfileDataParam.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/shop/ShopSaleProfileDataResponse.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/cooperation/CooperationData.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/cooperation/CooperationListResponse.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/cooperation/CooperationQrCode.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/cooperation/CooperationQrCodeResponse.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/cooperation/CooperationSharerParam.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/cooperation/CooperationStatus.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/cooperation/CooperationStatusResponse.java
create mode 100644 weixin-java-channel/src/test/java/me/chanjar/weixin/channel/api/impl/WxChannelCompassShopServiceImplTest.java
create mode 100644 weixin-java-channel/src/test/java/me/chanjar/weixin/channel/api/impl/WxStoreCooperationServiceImplTest.java
diff --git a/README.md b/README.md
index 0c6daaea9c..ebd8a852c7 100644
--- a/README.md
+++ b/README.md
@@ -97,6 +97,7 @@
- 微信开放平台:`weixin-java-open`
- 公众号(包括订阅号和服务号):`weixin-java-mp`
- 企业号/企业微信:`weixin-java-cp`
+ - 视频号/微信小店:`weixin-java-channel`
---------------------------------
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/BaseWxChannelMessageService.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/BaseWxChannelMessageService.java
index c107cc85cd..6f7be2f63f 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/BaseWxChannelMessageService.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/BaseWxChannelMessageService.java
@@ -89,6 +89,18 @@ void orderCancel(OrderCancelMessage message, final String content, final String
void orderPay(OrderPayMessage message, final String content, final String appId, final Map context,
final WxSessionManager sessionManager);
+ /**
+ * 订单待发货
+ *
+ * @param message 消息
+ * @param content 消息原始内容
+ * @param appId appId
+ * @param context 上下文
+ * @param sessionManager session管理器
+ */
+ void orderWaitShipping(OrderIdMessage message, final String content, final String appId, final Map context,
+ final WxSessionManager sessionManager);
+
/**
* 订单发货
*
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..aa3a85fa74
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelCompassShopService.java
@@ -0,0 +1,126 @@
+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
+ */
+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/WxChannelService.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelService.java
index 89f6b00964..50a029c196 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
@@ -98,6 +98,20 @@ public interface WxChannelService extends BaseWxChannelService {
*/
WxStoreHomePageService getHomePageService();
+ /**
+ * 合作账号服务
+ *
+ * @return 团长合作服务
+ */
+ WxStoreCooperationService getCooperationService();
+
+ /**
+ * 视频号/微信小店 罗盘商家版服务
+ *
+ * @return 罗盘商家版服务
+ */
+ WxChannelCompassShopService getCompassShopService();
+
/**
* 优选联盟-团长合作达人管理服务
*
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..96d2ff5f8d
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxStoreCooperationService.java
@@ -0,0 +1,70 @@
+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 合作账号状态机
+ */
+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/impl/BaseWxChannelMessageServiceImpl.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/BaseWxChannelMessageServiceImpl.java
index 200021b37d..ea0ee6c444 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
@@ -72,6 +72,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);
/* 订单确认收货 */
@@ -186,6 +188,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) {
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 ee4625c1a3..f85a9116c6 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
@@ -48,6 +48,8 @@ public abstract class BaseWxChannelServiceImpl implements WxChannelService
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 WxLeagueWindowService leagueWindowService = null;
private WxLeagueSupplierService leagueSupplierService = null;
private WxLeaguePromoterService leaguePromoterService = null;
@@ -56,10 +58,8 @@ public abstract class BaseWxChannelServiceImpl implements WxChannelService
private WxFinderLiveService finderLiveService = null;
private WxAssistantService assistantService = null;
private WxChannelVipService vipService = null;
- private final WxChannelCompassFinderService compassFinderService =
- new WxChannelCompassFinderServiceImpl(this);
- private final WxChannelLiveDashboardService liveDashboardService =
- new WxChannelLiveDashboardServiceImpl(this);
+ private WxChannelCompassFinderService compassFinderService = null;
+ private WxChannelLiveDashboardService liveDashboardService = null;
protected WxChannelConfig config;
private int retrySleepMillis = 1000;
@@ -376,6 +376,22 @@ public synchronized WxStoreHomePageService getHomePageService() {
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 WxLeagueWindowService getLeagueWindowService() {
if (leagueWindowService == null) {
@@ -409,7 +425,7 @@ public synchronized WxLeagueProductService getLeagueProductService() {
}
@Override
- public WxLeadComponentService getLeadComponentService() {
+ public synchronized WxLeadComponentService getLeadComponentService() {
if (leadComponentService == null) {
leadComponentService = new WxLeadComponentServiceImpl(this);
}
@@ -417,7 +433,7 @@ public WxLeadComponentService getLeadComponentService() {
}
@Override
- public WxFinderLiveService getFinderLiveService() {
+ public synchronized WxFinderLiveService getFinderLiveService() {
if (finderLiveService == null) {
finderLiveService = new WxFinderLiveServiceImpl(this);
}
@@ -425,7 +441,7 @@ public WxFinderLiveService getFinderLiveService() {
}
@Override
- public WxAssistantService getAssistantService() {
+ public synchronized WxAssistantService getAssistantService() {
if (assistantService == null) {
assistantService = new WxAssistantServiceImpl(this) {
};
@@ -434,7 +450,7 @@ public WxAssistantService getAssistantService() {
}
@Override
- public WxChannelVipService getVipService() {
+ public synchronized WxChannelVipService getVipService() {
if (vipService == null) {
vipService = new WxChannelVipServiceImpl(this);
}
@@ -442,9 +458,19 @@ public WxChannelVipService getVipService() {
}
@Override
- public WxChannelCompassFinderService getCompassFinderService() { return compassFinderService; }
+ public synchronized WxChannelCompassFinderService getCompassFinderService() {
+ if (compassFinderService == null) {
+ compassFinderService = new WxChannelCompassFinderServiceImpl(this);
+ }
+ return compassFinderService;
+ }
@Override
- public WxChannelLiveDashboardService getLiveDashboardService() { return liveDashboardService; }
+ public synchronized WxChannelLiveDashboardService getLiveDashboardService() {
+ if (liveDashboardService == null) {
+ liveDashboardService = new WxChannelLiveDashboardServiceImpl(this);
+ }
+ return liveDashboardService;
+ }
}
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
index 34bead89d6..acaad0c0c1 100644
--- 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
@@ -2,6 +2,7 @@
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;
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..36b5a23950
--- /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/WxStoreCooperationServiceImpl.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxStoreCooperationServiceImpl.java
new file mode 100644
index 0000000000..f82e35fa2f
--- /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/bean/after/AfterSaleListResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleListResponse.java
index 3ad67cffcf..dde39238a7 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
@@ -14,7 +14,7 @@
*/
@Data
@NoArgsConstructor
-@EqualsAndHashCode
+@EqualsAndHashCode(callSuper = true)
public class AfterSaleListResponse extends WxChannelBaseResponse {
private static final long serialVersionUID = 5033313416948732123L;
@@ -23,6 +23,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/category/PassCategoryResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/category/PassCategoryResponse.java
index af6f484254..6509321b88 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;
@@ -13,6 +14,7 @@
*/
@Data
@NoArgsConstructor
+@EqualsAndHashCode(callSuper = true)
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/compass/finder/CompassFinderBaseParam.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/CompassFinderBaseParam.java
similarity index 92%
rename from weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/finder/CompassFinderBaseParam.java
rename to weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/CompassFinderBaseParam.java
index 78e088f9ec..a1d5e277cc 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/finder/CompassFinderBaseParam.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/compass/CompassFinderBaseParam.java
@@ -1,4 +1,4 @@
-package me.chanjar.weixin.channel.bean.compass.finder;
+package me.chanjar.weixin.channel.bean.compass;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
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
index bddb9f3356..57a26a9794 100644
--- 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
@@ -5,6 +5,7 @@
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
+import me.chanjar.weixin.channel.bean.compass.CompassFinderBaseParam;
/**
* 获取带货商品数据请求参数
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
index 57a5854e71..abe4610785 100644
--- 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
@@ -5,6 +5,7 @@
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
+import me.chanjar.weixin.channel.bean.compass.CompassFinderBaseParam;
/**
* 获取带货人群数据请求参数
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/cooperation/CooperationData.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/cooperation/CooperationData.java
new file mode 100644
index 0000000000..41020f4993
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/cooperation/CooperationData.java
@@ -0,0 +1,47 @@
+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
+ */
+@Data
+@NoArgsConstructor
+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..1b652b64d6
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/cooperation/CooperationListResponse.java
@@ -0,0 +1,25 @@
+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
+ */
+@Data
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+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..272b9802da
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/cooperation/CooperationQrCode.java
@@ -0,0 +1,23 @@
+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
+ */
+@Data
+@NoArgsConstructor
+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..b18b2b1c85
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/cooperation/CooperationQrCodeResponse.java
@@ -0,0 +1,24 @@
+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
+ */
+@Data
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+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..4ca9bd8344
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/cooperation/CooperationSharerParam.java
@@ -0,0 +1,30 @@
+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
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@JsonInclude(JsonInclude.Include.NON_NULL)
+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..5267be6153
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/cooperation/CooperationStatus.java
@@ -0,0 +1,23 @@
+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
+ */
+@Data
+@NoArgsConstructor
+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..6507340c63
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/cooperation/CooperationStatusResponse.java
@@ -0,0 +1,24 @@
+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
+ */
+@Data
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+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/freight/ConditionFreeDetail.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/freight/ConditionFreeDetail.java
index 68cb3b146e..cd0b76990d 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/freight/ConditionFreeDetail.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/freight/ConditionFreeDetail.java
@@ -20,11 +20,11 @@ public class ConditionFreeDetail extends AddressInfoList {
@JsonProperty("min_piece")
private Integer minPiece;
- /** 最低重量 */
+ /** 最低重量,单位千克,订单商品总质量小于一千克,算作一千克 */
@JsonProperty("min_weight")
private Double minWeight;
- /** 最低金额 */
+ /** 最低金额,单位(分) */
@JsonProperty("min_amount")
private Integer minAmount;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/league/supplier/SupplierFlowListResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/league/supplier/SupplierFlowListResponse.java
index 468985fe3e..d4a04af981 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/league/supplier/SupplierFlowListResponse.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/league/supplier/SupplierFlowListResponse.java
@@ -9,8 +9,7 @@
/**
* 资金流水列表 响应
*
- * @author LiXiZe
- * @since 2023-04-16
+ * @author Zeyes
*/
@Data
@NoArgsConstructor
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/OrderPriceInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/OrderPriceInfo.java
index b1688cde5c..cad435df2b 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/OrderPriceInfo.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/OrderPriceInfo.java
@@ -93,18 +93,18 @@ public class OrderPriceInfo implements Serializable {
* merchant_receieve_price=original_order_price-discounted_price-deduction_price-change_down_price
*/
@JsonProperty("merchant_receieve_price")
- private Integer merchant_receive_price;
+ private Integer merchantReceivePrice;
/**
* 商家优惠金额,单位为分,含义同discounted_price,必填
*/
@JsonProperty("merchant_discounted_price")
- private Integer merchant_discounted_price;
+ private Integer merchantDiscountedPrice;
/**
* 达人优惠金额,单位为分
*/
@JsonProperty("finder_discounted_price")
- private Integer finder_discounted_price;
+ private Integer finderDiscountedPrice;
}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/OrderProductInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/OrderProductInfo.java
index e7edeb8912..1e49455dc4 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/OrderProductInfo.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/OrderProductInfo.java
@@ -168,4 +168,22 @@ public class OrderProductInfo implements Serializable {
*/
@JsonProperty("delivery_deadline")
private Long deliveryDeadline;
+
+ /**
+ * 商家优惠金额,单位为分
+ */
+ @JsonProperty("merchant_discounted_price")
+ private Integer merchantDiscountedPrice;
+
+ /**
+ * 商家优惠金额,单位为分
+ */
+ @JsonProperty("finder_discounted_price")
+ private Integer finderDiscountedPrice;
+
+ /**
+ * 是否赠品,非必填,赠品商品返回,1:是赠品
+ */
+ @JsonProperty("is_free_gift")
+ private Boolean freeGift;
}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/SpuInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/SpuInfo.java
index 7b29194731..a160a31373 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/SpuInfo.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/product/SpuInfo.java
@@ -33,10 +33,18 @@ public class SpuInfo extends SpuSimpleInfo {
@JsonProperty("head_imgs")
private List headImgs;
- /** 发货方式,若为无需快递(仅对部分类目开放),则无需填写运费模版id。0:快递发货;1:无需快递;默认0 */
+ /** 发货方式:0-快递发货;1-无需快递,手机号发货;3-无需快递,可选发货账号类型,默认为0,若为无需快递,则无需填写运费模版id */
@JsonProperty("deliver_method")
private Integer deliverMethod;
+ /**
+ * 发货账号:1-微信openid;2-QQ号;3-手机号;4-邮箱。
+ * 可多选,只有deliver_method=3时,本参数有意义。
+ * 且当发货账号为微信、QQ和邮箱时,需要更新订单接口读取详情字段,详情参考订单接口的说明
+ */
+ @JsonProperty("deliver_acct_type")
+ private List deliverAcctType;
+
/** 商品详情 */
@JsonProperty("desc_info")
private DescriptionInfo descInfo;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/constant/MessageEventConstants.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/constant/MessageEventConstants.java
index bee0263a25..0a945b1f35 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/constant/MessageEventConstants.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/constant/MessageEventConstants.java
@@ -22,6 +22,8 @@ public interface MessageEventConstants {
String ORDER_CANCEL = "channels_ec_order_cancel";
/** 订单支付成功 */
String ORDER_PAY = "channels_ec_order_pay";
+ /** 订单待发货 */
+ String ORDER_WAIT_SHIPPING = "channels_ec_order_wait_shipping";
/** 订单发货 */
String ORDER_DELIVER = "channels_ec_order_deliver";
/** 订单确认收货 */
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/constant/WxChannelApiUrlConstants.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/constant/WxChannelApiUrlConstants.java
index 35cb6d2140..e88f95e64b 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/constant/WxChannelApiUrlConstants.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/constant/WxChannelApiUrlConstants.java
@@ -316,6 +316,20 @@ public interface Share {
String UNBIND_SHARER_URL = "https://api.weixin.qq.com/channels/ec/sharer/unbind";
}
+ /** 合作账号相关接口 */
+ public interface Cooperation {
+ /** 获取合作账号列表 */
+ String LIST_COOPERATION_URL = "https://api.weixin.qq.com/channels/ec/cooperation/list";
+ /** 查看合作账号邀请状态 */
+ String GET_COOPERATION_STATUS_URL = "https://api.weixin.qq.com/channels/ec/cooperation/invitation/get";
+ /** 邀请合作账号 */
+ String GENERATE_QRCODE_COOPERATION_URL = "https://api.weixin.qq.com/channels/ec/cooperation/invitation/qrcode/generate";
+ /** 取消合作账号邀请 */
+ String CANCEL_COOPERATION_URL = "https://api.weixin.qq.com/channels/ec/cooperation/invitation/cancel";
+ /** 解绑合作账号 */
+ String UNBIND_COOPERATION_URL = "https://api.weixin.qq.com/channels/ec/cooperation/unbind";
+ }
+
/** 资金相关接口 */
public interface Fund {
@@ -324,9 +338,9 @@ public interface Fund {
/** 获取结算账户 */
String GET_BANK_ACCOUNT_URL = "https://api.weixin.qq.com/channels/ec/funds/getbankacct";
/** 获取资金流水详情 */
- String GET_BALANCE_FLOW_DETAIL_URL = "https://api.weixin.qq.com/channels/ec/league/funds/getfundsflowdetail";
+ String GET_BALANCE_FLOW_DETAIL_URL = "https://api.weixin.qq.com/channels/ec/funds/getfundsflowdetail";
/** 获取资金流水列表 */
- String GET_BALANCE_FLOW_LIST_URL = "https://api.weixin.qq.com/channels/ec/league/funds/getfundsflowlist";
+ String GET_BALANCE_FLOW_LIST_URL = "https://api.weixin.qq.com/channels/ec/funds/getfundsflowlist";
/** 获取提现记录 */
String GET_WITHDRAW_DETAIL_URL = "https://api.weixin.qq.com/channels/ec/funds/getwithdrawdetail";
/** 获取提现记录列表 */
@@ -526,4 +540,31 @@ public interface CompassFinder {
*/
String GET_SALE_PROFILE_DATA_URL = "https://api.weixin.qq.com/channels/ec/compass/finder/sale/profile/data/get";
}
+
+ /**
+ * 罗盘商家版API
+ */
+ public interface CompassShop {
+
+ /** 获取电商数据概览 */
+ String GET_SHOP_OVERALL_URL = "https://api.weixin.qq.com/channels/ec/compass/shop/overall/get";
+ /** 获取授权视频号列表 */
+ String FINDER_AUTH_LIST_URL = "https://api.weixin.qq.com/channels/ec/compass/shop/finder/authorization/list/get";
+ /** 获取带货达人列表 */
+ String FINDER_LIST_URL = "https://api.weixin.qq.com/channels/ec/compass/shop/finder/list/get";
+ /** 获取带货数据概览 */
+ String GET_FINDER_OVERALL_URL = "https://api.weixin.qq.com/channels/ec/compass/shop/finder/overall/get";
+ /** 获取带货达人商品列表 */
+ String GET_FINDER_PRODUCT_LIST_URL = "https://api.weixin.qq.com/channels/ec/compass/shop/finder/product/list/get";
+ /** 获取带货达人商品数据 */
+ String GET_FINDER_PRODUCT_OVERALL_URL = "https://api.weixin.qq.com/channels/ec/compass/shop/finder/product/overall/get";
+ /** 获取店铺开播列表 */
+ String GET_LIVE_LIST_URL = "https://api.weixin.qq.com/channels/ec/compass/shop/live/list/get";
+ /** 获取商品详细信息 */
+ String GET_SHOP_PRODUCT_DATA_URL = "https://api.weixin.qq.com/channels/ec/compass/shop/product/data/get";
+ /** 获取商品列表 */
+ String GET_SHOP_PRODUCT_LIST_URL = "https://api.weixin.qq.com/channels/ec/compass/shop/product/list/get";
+ /** 获取店铺人群数据 */
+ String GET_SHOP_SALE_PROFILE_DATA_URL = "https://api.weixin.qq.com/channels/ec/compass/shop/sale/profile/data/get";
+ }
}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/enums/FundsType.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/enums/FundsType.java
index ea3f8873ec..125e8c39c7 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/enums/FundsType.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/enums/FundsType.java
@@ -24,12 +24,23 @@ public enum FundsType {
/** 8 运费险分账 */
FREIGHT_SHARE(8, "运费险分账"),
/** 9 联盟平台抽佣 */
- LEAGUE_COMMISSION(9, "联盟平台抽佣"),
- /** 10 小店抽佣 */
- SHOP_COMMISSION(10, "小店抽佣"),
+ LEAGUE_PLAT_COMMISSION(9, "联盟平台抽佣"),
+ /** 10 联盟抽佣 */
+ LEAGUE_COMMISSION(10, "联盟抽佣"),
+ /** 11台抽佣 */
+ PLATFORM_COMMISSION(11, "平台抽佣"),
+ /** 12 团长抽佣 */
+ LEADER_COMMISSION(12, "团长抽佣"),
+ /** 13 返佣人气卡 */
+ POPULARITY_CARD(13, "返佣人气卡"),
+ /** 14 极速退款垫资金 */
+ FAST_REFUND(14, "极速退款垫资金"),
+ /** 15 极速退款垫资回补 */
+ FAST_REFUND_REPLENISHMENT(15, "极速退款垫资回补"),
+ /** 16 运费险 */
+ FREIGHT_INSURANCE(16, "运费险"),
/** 99 分账 */
SHARE(99, "分账"),
-
;
private final int key;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/enums/PromoteType.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/enums/PromoteType.java
index fa0bd60913..c1ba1a3561 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/enums/PromoteType.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/enums/PromoteType.java
@@ -9,7 +9,14 @@
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum PromoteType {
- PROMOTE_TYPE_SHOP(1, "小店内推广");
+ /** 1 小店内推广 */
+ PROMOTE_TYPE_SHOP(1, "小店内推广"),
+ /** 9 会员券 */
+ MEMBER(9, "会员券"),
+ /** 10 会员开卡礼券 */
+ MEMBER_CARD(10, "会员开卡礼券"),
+
+ ;
private final int key;
private final String val;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/enums/SendTime.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/enums/SendTime.java
index 85e4d4f0d6..9b5bc6e809 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/enums/SendTime.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/enums/SendTime.java
@@ -23,7 +23,11 @@ public enum SendTime {
TWENTYFOUR_HOUR("SendTime_TWENTYFOUR_HOUR", "24小时内发货"),
/** 48小时内发货 */
FOUTYEIGHT_HOUR("SendTime_FOUTYEIGHT_HOUR", "48小时内发货"),
- /** 3天内发货 */
+ /**
+ * 3天内发货
+ * @deprecated 已不支持,微信小店发货管理规则调整
+ */
+ @Deprecated
THREE_DAY("SendTime_THREE_DAY", "3天内发货"),
// /** 5天内发货 */
// FIVE_DAY("SendTime_FIVE_DAY", "5天内发货"),
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/enums/SpuEditStatus.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/enums/SpuEditStatus.java
index 3d6063b8cf..71c71d5a26 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/enums/SpuEditStatus.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/enums/SpuEditStatus.java
@@ -20,7 +20,13 @@ public enum SpuEditStatus {
/** 4 审核成功 */
SUCCESS(4, "审核成功"),
/** 5 商品信息写入中 */
- WRITING(5, "商品信息写入中");
+ WRITING(5, "商品信息写入中"),
+ /** 7 商品异步提交,上传中(处于该状态的商品调用上架商品接口会返回10020067) */
+ ASYNC_WRITING(7, "商品异步提交,上传中"),
+ /** 8 商品异步提交,上传失败(请重新提交) */
+ ASYNC_FAIL(8, "商品异步提交,上传失败"),
+
+ ;
private final int status;
private final String desc;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/enums/SpuStatus.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/enums/SpuStatus.java
index a74fee6b07..8f88d5ffac 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/enums/SpuStatus.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/enums/SpuStatus.java
@@ -16,10 +16,20 @@ public enum SpuStatus {
UP(5, "上架"),
/** 6 回收站 */
TRASH(6, "回收站"),
+ /** 9 彻底删除,商品无法再进行任何操作 */
+ DELETE(9, "彻底删除"),
/** 11 自主下架 */
DOWN(11, "自主下架"),
/** 13 违规下架/风控系统下架 */
- SYSTEM_DOWN(13, "违规下架");
+ SYSTEM_DOWN(13, "违规下架/风控系统下架"),
+ /** 14 保证金不足下架 */
+ DEPOSIT_INSUFFICIENT(14, "保证金不足下架"),
+ /** 15 品牌过期下架 */
+ BRAND_EXPIRED(15, "品牌过期下架"),
+ /** 20 商品被封禁 */
+ BAN(20, "商品被封禁"),
+
+;
private final int status;
private final String desc;
diff --git a/weixin-java-channel/src/test/java/me/chanjar/weixin/channel/api/impl/WxChannelCompassShopServiceImplTest.java b/weixin-java-channel/src/test/java/me/chanjar/weixin/channel/api/impl/WxChannelCompassShopServiceImplTest.java
new file mode 100644
index 0000000000..cae4d23067
--- /dev/null
+++ b/weixin-java-channel/src/test/java/me/chanjar/weixin/channel/api/impl/WxChannelCompassShopServiceImplTest.java
@@ -0,0 +1,125 @@
+package me.chanjar.weixin.channel.api.impl;
+
+import static org.testng.Assert.assertNotNull;
+import static org.testng.Assert.assertTrue;
+
+import com.google.inject.Inject;
+import me.chanjar.weixin.channel.api.WxChannelCompassShopService;
+import me.chanjar.weixin.channel.api.WxChannelService;
+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.channel.test.ApiTestModule;
+import me.chanjar.weixin.common.error.WxErrorException;
+import org.testng.annotations.Guice;
+import org.testng.annotations.Test;
+
+/**
+ * @author Zeyes
+ */
+@Guice(modules = ApiTestModule.class)
+public class WxChannelCompassShopServiceImplTest {
+
+ @Inject
+ private WxChannelService channelService;
+
+ @Test
+ public void testGetShopOverall() throws WxErrorException {
+ WxChannelCompassShopService service = channelService.getCompassShopService();
+ String ds = "20240306";
+ ShopOverallResponse response = service.getShopOverall(ds);
+ assertNotNull(response);
+ assertTrue(response.isSuccess());
+ }
+
+ @Test
+ public void testGetFinderAuthorizationList() throws WxErrorException {
+ WxChannelCompassShopService service = channelService.getCompassShopService();
+ FinderAuthListResponse response = service.getFinderAuthorizationList();
+ assertNotNull(response);
+ assertTrue(response.isSuccess());
+ }
+
+ @Test
+ public void testGetFinderList() throws WxErrorException {
+ WxChannelCompassShopService service = channelService.getCompassShopService();
+ String ds = "20240306";
+ FinderListResponse response = service.getFinderList(ds);
+ assertNotNull(response);
+ assertTrue(response.isSuccess());
+ }
+
+ @Test
+ public void testGetFinderOverall() throws WxErrorException {
+ WxChannelCompassShopService service = channelService.getCompassShopService();
+ String ds = "20240306";
+ FinderOverallResponse response = service.getFinderOverall(ds);
+ assertNotNull(response);
+ assertTrue(response.isSuccess());
+ }
+
+ @Test
+ public void testGetFinderProductList() throws WxErrorException {
+ WxChannelCompassShopService service = channelService.getCompassShopService();
+ String ds = "";
+ String finderId = "";
+ FinderProductListResponse response = service.getFinderProductList(ds, finderId);
+ assertNotNull(response);
+ assertTrue(response.isSuccess());
+ }
+
+ @Test
+ public void testGetFinderProductOverall() throws WxErrorException {
+ WxChannelCompassShopService service = channelService.getCompassShopService();
+ String ds = "";
+ String finderId = "";
+ FinderProductOverallResponse response = service.getFinderProductOverall(ds, finderId);
+ assertNotNull(response);
+ assertTrue(response.isSuccess());
+ }
+
+ @Test
+ public void testGetShopLiveList() throws WxErrorException {
+ WxChannelCompassShopService service = channelService.getCompassShopService();
+ String ds = "";
+ String finderId = "";
+ ShopLiveListResponse response = service.getShopLiveList(ds, finderId);
+ assertNotNull(response);
+ assertTrue(response.isSuccess());
+ }
+
+ @Test
+ public void testGetShopProductData() throws WxErrorException {
+ WxChannelCompassShopService service = channelService.getCompassShopService();
+ String ds = "20240306";
+ String productId = "";
+ ShopProductDataResponse response = service.getShopProductData(ds, productId);
+ assertNotNull(response);
+ assertTrue(response.isSuccess());
+ }
+
+ @Test
+ public void testGetShopProductList() throws WxErrorException {
+ WxChannelCompassShopService service = channelService.getCompassShopService();
+ String ds = "20240306";
+ ShopProductListResponse response = service.getShopProductList(ds);
+ assertNotNull(response);
+ assertTrue(response.isSuccess());
+ }
+
+ @Test
+ public void testGetShopSaleProfileData() throws WxErrorException {
+ WxChannelCompassShopService service = channelService.getCompassShopService();
+ String ds = "20240306";
+ ShopSaleProfileDataResponse response = service.getShopSaleProfileData(ds, 3);
+ assertNotNull(response);
+ assertTrue(response.isSuccess());
+ }
+}
diff --git a/weixin-java-channel/src/test/java/me/chanjar/weixin/channel/api/impl/WxStoreCooperationServiceImplTest.java b/weixin-java-channel/src/test/java/me/chanjar/weixin/channel/api/impl/WxStoreCooperationServiceImplTest.java
new file mode 100644
index 0000000000..bf70ce3c78
--- /dev/null
+++ b/weixin-java-channel/src/test/java/me/chanjar/weixin/channel/api/impl/WxStoreCooperationServiceImplTest.java
@@ -0,0 +1,66 @@
+package me.chanjar.weixin.channel.api.impl;
+
+import static org.testng.Assert.assertNotNull;
+import static org.testng.Assert.assertTrue;
+
+import com.google.inject.Inject;
+import me.chanjar.weixin.channel.api.WxChannelService;
+import me.chanjar.weixin.channel.api.WxStoreCooperationService;
+import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
+import me.chanjar.weixin.channel.test.ApiTestModule;
+import me.chanjar.weixin.channel.util.JsonUtils;
+import me.chanjar.weixin.common.error.WxErrorException;
+import org.testng.annotations.Guice;
+import org.testng.annotations.Test;
+
+/**
+ * @author Zeyes
+ */
+@Guice(modules = ApiTestModule.class)
+public class WxStoreCooperationServiceImplTest {
+
+ @Inject
+ private WxChannelService channelService;
+
+ @Test
+ public void testListCooperation() throws WxErrorException {
+ WxStoreCooperationService service = channelService.getCooperationService();
+ Integer sharerType = 3;
+ WxChannelBaseResponse response = service.listCooperation(sharerType);
+ assertNotNull(response);
+ assertTrue(response.isSuccess());
+ System.out.println(JsonUtils.encode(response));
+ }
+
+ @Test
+ public void testGetCooperationStatus() throws WxErrorException {
+ WxStoreCooperationService service = channelService.getCooperationService();
+ WxChannelBaseResponse response = service.getCooperationStatus("sph3FZbOEY64mWQ", 2);
+ assertNotNull(response);
+ assertTrue(response.isSuccess());
+ }
+
+ @Test
+ public void testGenerateQrCode() throws WxErrorException {
+ WxStoreCooperationService service = channelService.getCooperationService();
+ WxChannelBaseResponse response = service.generateQrCode("sph3FZbOEY64mWQ", 2);
+ assertNotNull(response);
+ assertTrue(response.isSuccess());
+ }
+
+ @Test
+ public void testCancelInvitation() throws WxErrorException {
+ WxStoreCooperationService service = channelService.getCooperationService();
+ WxChannelBaseResponse response = service.cancelInvitation("sph3FZbOEY64mWQ", 2);
+ assertNotNull(response);
+ assertTrue(response.isSuccess());
+ }
+
+ @Test
+ public void testUnbind() throws WxErrorException {
+ WxStoreCooperationService service = channelService.getCooperationService();
+ WxChannelBaseResponse response = service.unbind("sph3FZbOEY64mWQ", 2);
+ assertNotNull(response);
+ assertTrue(response.isSuccess());
+ }
+}
diff --git a/weixin-java-channel/src/test/java/me/chanjar/weixin/channel/message/WxChannelMessageRouterRuleTest.java b/weixin-java-channel/src/test/java/me/chanjar/weixin/channel/message/WxChannelMessageRouterRuleTest.java
index d1e2f72174..bff360f7cc 100644
--- a/weixin-java-channel/src/test/java/me/chanjar/weixin/channel/message/WxChannelMessageRouterRuleTest.java
+++ b/weixin-java-channel/src/test/java/me/chanjar/weixin/channel/message/WxChannelMessageRouterRuleTest.java
@@ -6,8 +6,7 @@
import org.testng.annotations.Test;
/**
- * @author LiXiZe
- * @since 2023-04-20
+ * @author Zeyes
*/
public class WxChannelMessageRouterRuleTest {
diff --git a/weixin-java-channel/src/test/java/me/chanjar/weixin/channel/message/WxChannelMessageRouterTest.java b/weixin-java-channel/src/test/java/me/chanjar/weixin/channel/message/WxChannelMessageRouterTest.java
index 4c39d45382..9d683edce6 100644
--- a/weixin-java-channel/src/test/java/me/chanjar/weixin/channel/message/WxChannelMessageRouterTest.java
+++ b/weixin-java-channel/src/test/java/me/chanjar/weixin/channel/message/WxChannelMessageRouterTest.java
@@ -22,8 +22,7 @@
import org.testng.annotations.Test;
/**
- * @author LiXiZe
- * @since 2023-04-21
+ * @author Zeyes
*/
@Slf4j
@Guice(modules = ApiTestModule.class)
From 915f10157ff94445260260c0a7e7be7de12cf4d3 Mon Sep 17 00:00:00 2001
From: Binary Wang
Date: Sun, 1 Dec 2024 23:58:12 +0800
Subject: [PATCH 009/326] =?UTF-8?q?:bookmark:=20=E5=8F=91=E5=B8=83=204.6.8?=
=?UTF-8?q?.B=20=E6=B5=8B=E8=AF=95=E7=89=88=E6=9C=AC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pom.xml | 2 +-
solon-plugins/pom.xml | 2 +-
solon-plugins/wx-java-channel-multi-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-channel-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-cp-multi-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-cp-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-miniapp-multi-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-miniapp-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-mp-multi-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-mp-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-open-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-pay-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-qidian-solon-plugin/pom.xml | 2 +-
spring-boot-starters/pom.xml | 2 +-
.../wx-java-channel-multi-spring-boot-starter/pom.xml | 2 +-
.../wx-java-channel-spring-boot-starter/pom.xml | 2 +-
.../wx-java-cp-multi-spring-boot-starter/pom.xml | 2 +-
spring-boot-starters/wx-java-cp-spring-boot-starter/pom.xml | 2 +-
.../wx-java-miniapp-multi-spring-boot-starter/pom.xml | 2 +-
.../wx-java-miniapp-spring-boot-starter/pom.xml | 2 +-
.../wx-java-mp-multi-spring-boot-starter/pom.xml | 2 +-
spring-boot-starters/wx-java-mp-spring-boot-starter/pom.xml | 2 +-
spring-boot-starters/wx-java-open-spring-boot-starter/pom.xml | 2 +-
spring-boot-starters/wx-java-pay-spring-boot-starter/pom.xml | 2 +-
spring-boot-starters/wx-java-qidian-spring-boot-starter/pom.xml | 2 +-
weixin-graal/pom.xml | 2 +-
weixin-java-channel/pom.xml | 2 +-
weixin-java-common/pom.xml | 2 +-
weixin-java-cp/pom.xml | 2 +-
weixin-java-miniapp/pom.xml | 2 +-
weixin-java-mp/pom.xml | 2 +-
weixin-java-open/pom.xml | 2 +-
weixin-java-pay/pom.xml | 2 +-
weixin-java-qidian/pom.xml | 2 +-
34 files changed, 34 insertions(+), 34 deletions(-)
diff --git a/pom.xml b/pom.xml
index 586f45d59b..70f32b776d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -3,7 +3,7 @@
4.0.0
com.github.binarywang
wx-java
- 4.6.7.B
+ 4.6.8.B
pom
WxJava - Weixin/Wechat Java SDK
微信开发Java SDK
diff --git a/solon-plugins/pom.xml b/solon-plugins/pom.xml
index c6cc1c19cb..d6883a2dc0 100644
--- a/solon-plugins/pom.xml
+++ b/solon-plugins/pom.xml
@@ -6,7 +6,7 @@
com.github.binarywang
wx-java
- 4.6.7.B
+ 4.6.8.B
pom
wx-java-solon-plugins
diff --git a/solon-plugins/wx-java-channel-multi-solon-plugin/pom.xml b/solon-plugins/wx-java-channel-multi-solon-plugin/pom.xml
index 945a1bb7be..e16c3f7f23 100644
--- a/solon-plugins/wx-java-channel-multi-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-channel-multi-solon-plugin/pom.xml
@@ -5,7 +5,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.6.7.B
+ 4.6.8.B
4.0.0
diff --git a/solon-plugins/wx-java-channel-solon-plugin/pom.xml b/solon-plugins/wx-java-channel-solon-plugin/pom.xml
index 562f61e2f7..d27c59e66a 100644
--- a/solon-plugins/wx-java-channel-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-channel-solon-plugin/pom.xml
@@ -3,7 +3,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.6.7.B
+ 4.6.8.B
4.0.0
diff --git a/solon-plugins/wx-java-cp-multi-solon-plugin/pom.xml b/solon-plugins/wx-java-cp-multi-solon-plugin/pom.xml
index 24b9f65da8..9a9d66b49f 100644
--- a/solon-plugins/wx-java-cp-multi-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-cp-multi-solon-plugin/pom.xml
@@ -4,7 +4,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.6.7.B
+ 4.6.8.B
4.0.0
diff --git a/solon-plugins/wx-java-cp-solon-plugin/pom.xml b/solon-plugins/wx-java-cp-solon-plugin/pom.xml
index a9c1531e9e..fe183424b3 100644
--- a/solon-plugins/wx-java-cp-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-cp-solon-plugin/pom.xml
@@ -4,7 +4,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.6.7.B
+ 4.6.8.B
4.0.0
diff --git a/solon-plugins/wx-java-miniapp-multi-solon-plugin/pom.xml b/solon-plugins/wx-java-miniapp-multi-solon-plugin/pom.xml
index ab78bd47e1..d11cda057d 100644
--- a/solon-plugins/wx-java-miniapp-multi-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-miniapp-multi-solon-plugin/pom.xml
@@ -5,7 +5,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.6.7.B
+ 4.6.8.B
4.0.0
diff --git a/solon-plugins/wx-java-miniapp-solon-plugin/pom.xml b/solon-plugins/wx-java-miniapp-solon-plugin/pom.xml
index dd86bcba9a..a7e25ac592 100644
--- a/solon-plugins/wx-java-miniapp-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-miniapp-solon-plugin/pom.xml
@@ -4,7 +4,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.6.7.B
+ 4.6.8.B
4.0.0
diff --git a/solon-plugins/wx-java-mp-multi-solon-plugin/pom.xml b/solon-plugins/wx-java-mp-multi-solon-plugin/pom.xml
index 74cabd6fa8..88901855a4 100644
--- a/solon-plugins/wx-java-mp-multi-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-mp-multi-solon-plugin/pom.xml
@@ -5,7 +5,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.6.7.B
+ 4.6.8.B
4.0.0
diff --git a/solon-plugins/wx-java-mp-solon-plugin/pom.xml b/solon-plugins/wx-java-mp-solon-plugin/pom.xml
index f5e6d523e7..89de01770c 100644
--- a/solon-plugins/wx-java-mp-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-mp-solon-plugin/pom.xml
@@ -5,7 +5,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.6.7.B
+ 4.6.8.B
4.0.0
diff --git a/solon-plugins/wx-java-open-solon-plugin/pom.xml b/solon-plugins/wx-java-open-solon-plugin/pom.xml
index 14daefdd4a..c4303cf8f7 100644
--- a/solon-plugins/wx-java-open-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-open-solon-plugin/pom.xml
@@ -5,7 +5,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.6.7.B
+ 4.6.8.B
4.0.0
diff --git a/solon-plugins/wx-java-pay-solon-plugin/pom.xml b/solon-plugins/wx-java-pay-solon-plugin/pom.xml
index 7e95ba7376..0da704a4c7 100644
--- a/solon-plugins/wx-java-pay-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-pay-solon-plugin/pom.xml
@@ -5,7 +5,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.6.7.B
+ 4.6.8.B
4.0.0
diff --git a/solon-plugins/wx-java-qidian-solon-plugin/pom.xml b/solon-plugins/wx-java-qidian-solon-plugin/pom.xml
index d22c4b2a39..c49d9ed3ac 100644
--- a/solon-plugins/wx-java-qidian-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-qidian-solon-plugin/pom.xml
@@ -3,7 +3,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.6.7.B
+ 4.6.8.B
4.0.0
diff --git a/spring-boot-starters/pom.xml b/spring-boot-starters/pom.xml
index 6abea0da05..d5a7effae9 100644
--- a/spring-boot-starters/pom.xml
+++ b/spring-boot-starters/pom.xml
@@ -6,7 +6,7 @@
com.github.binarywang
wx-java
- 4.6.7.B
+ 4.6.8.B
pom
wx-java-spring-boot-starters
diff --git a/spring-boot-starters/wx-java-channel-multi-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-channel-multi-spring-boot-starter/pom.xml
index 336350866f..c2c72bd366 100644
--- a/spring-boot-starters/wx-java-channel-multi-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-channel-multi-spring-boot-starter/pom.xml
@@ -5,7 +5,7 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.6.7.B
+ 4.6.8.B
4.0.0
diff --git a/spring-boot-starters/wx-java-channel-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-channel-spring-boot-starter/pom.xml
index a752822853..68e4ce13c1 100644
--- a/spring-boot-starters/wx-java-channel-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-channel-spring-boot-starter/pom.xml
@@ -3,7 +3,7 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.6.7.B
+ 4.6.8.B
4.0.0
diff --git a/spring-boot-starters/wx-java-cp-multi-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-cp-multi-spring-boot-starter/pom.xml
index e7926d86e1..6947fb9e04 100644
--- a/spring-boot-starters/wx-java-cp-multi-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-cp-multi-spring-boot-starter/pom.xml
@@ -4,7 +4,7 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.6.7.B
+ 4.6.8.B
4.0.0
diff --git a/spring-boot-starters/wx-java-cp-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-cp-spring-boot-starter/pom.xml
index 5021e02dc8..6449feb3c8 100644
--- a/spring-boot-starters/wx-java-cp-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-cp-spring-boot-starter/pom.xml
@@ -4,7 +4,7 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.6.7.B
+ 4.6.8.B
4.0.0
diff --git a/spring-boot-starters/wx-java-miniapp-multi-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-miniapp-multi-spring-boot-starter/pom.xml
index 09b02e63a3..38c1a80d45 100644
--- a/spring-boot-starters/wx-java-miniapp-multi-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-miniapp-multi-spring-boot-starter/pom.xml
@@ -5,7 +5,7 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.6.7.B
+ 4.6.8.B
4.0.0
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 dd59af8b92..6983904416 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 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.6.7.B
+ 4.6.8.B
4.0.0
diff --git a/spring-boot-starters/wx-java-mp-multi-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-mp-multi-spring-boot-starter/pom.xml
index e76b4ec8b2..064a4b9d47 100644
--- a/spring-boot-starters/wx-java-mp-multi-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-mp-multi-spring-boot-starter/pom.xml
@@ -5,7 +5,7 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.6.7.B
+ 4.6.8.B
4.0.0
diff --git a/spring-boot-starters/wx-java-mp-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-mp-spring-boot-starter/pom.xml
index 53cf73f350..a784de838c 100644
--- a/spring-boot-starters/wx-java-mp-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-mp-spring-boot-starter/pom.xml
@@ -5,7 +5,7 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.6.7.B
+ 4.6.8.B
4.0.0
diff --git a/spring-boot-starters/wx-java-open-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-open-spring-boot-starter/pom.xml
index ab481021ce..81c3514e81 100644
--- a/spring-boot-starters/wx-java-open-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-open-spring-boot-starter/pom.xml
@@ -5,7 +5,7 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.6.7.B
+ 4.6.8.B
4.0.0
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 74919c49c3..b24d3ce7cf 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 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.6.7.B
+ 4.6.8.B
4.0.0
diff --git a/spring-boot-starters/wx-java-qidian-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-qidian-spring-boot-starter/pom.xml
index 27f8397a6b..7d3d7ebb11 100644
--- a/spring-boot-starters/wx-java-qidian-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-qidian-spring-boot-starter/pom.xml
@@ -3,7 +3,7 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.6.7.B
+ 4.6.8.B
4.0.0
diff --git a/weixin-graal/pom.xml b/weixin-graal/pom.xml
index c429ba6187..86bcf85cf7 100644
--- a/weixin-graal/pom.xml
+++ b/weixin-graal/pom.xml
@@ -6,7 +6,7 @@
com.github.binarywang
wx-java
- 4.6.7.B
+ 4.6.8.B
weixin-graal
diff --git a/weixin-java-channel/pom.xml b/weixin-java-channel/pom.xml
index c8a2668747..24c87e86e7 100644
--- a/weixin-java-channel/pom.xml
+++ b/weixin-java-channel/pom.xml
@@ -6,7 +6,7 @@
com.github.binarywang
wx-java
- 4.6.7.B
+ 4.6.8.B
weixin-java-channel
diff --git a/weixin-java-common/pom.xml b/weixin-java-common/pom.xml
index ba6319a8d3..f6ebeef34a 100644
--- a/weixin-java-common/pom.xml
+++ b/weixin-java-common/pom.xml
@@ -6,7 +6,7 @@
com.github.binarywang
wx-java
- 4.6.7.B
+ 4.6.8.B
weixin-java-common
diff --git a/weixin-java-cp/pom.xml b/weixin-java-cp/pom.xml
index 96fbcc8eea..a917f68236 100644
--- a/weixin-java-cp/pom.xml
+++ b/weixin-java-cp/pom.xml
@@ -7,7 +7,7 @@
com.github.binarywang
wx-java
- 4.6.7.B
+ 4.6.8.B
weixin-java-cp
diff --git a/weixin-java-miniapp/pom.xml b/weixin-java-miniapp/pom.xml
index af3b2a7c45..d0e71512e7 100644
--- a/weixin-java-miniapp/pom.xml
+++ b/weixin-java-miniapp/pom.xml
@@ -7,7 +7,7 @@
com.github.binarywang
wx-java
- 4.6.7.B
+ 4.6.8.B
weixin-java-miniapp
diff --git a/weixin-java-mp/pom.xml b/weixin-java-mp/pom.xml
index 643f4f0d0e..860654c1b7 100644
--- a/weixin-java-mp/pom.xml
+++ b/weixin-java-mp/pom.xml
@@ -7,7 +7,7 @@
com.github.binarywang
wx-java
- 4.6.7.B
+ 4.6.8.B
weixin-java-mp
diff --git a/weixin-java-open/pom.xml b/weixin-java-open/pom.xml
index e33502b6d0..1e8845ecd4 100644
--- a/weixin-java-open/pom.xml
+++ b/weixin-java-open/pom.xml
@@ -7,7 +7,7 @@
com.github.binarywang
wx-java
- 4.6.7.B
+ 4.6.8.B
weixin-java-open
diff --git a/weixin-java-pay/pom.xml b/weixin-java-pay/pom.xml
index 4d6c046228..f744e5e643 100644
--- a/weixin-java-pay/pom.xml
+++ b/weixin-java-pay/pom.xml
@@ -5,7 +5,7 @@
com.github.binarywang
wx-java
- 4.6.7.B
+ 4.6.8.B
4.0.0
diff --git a/weixin-java-qidian/pom.xml b/weixin-java-qidian/pom.xml
index 77918c72ab..2b713519b5 100644
--- a/weixin-java-qidian/pom.xml
+++ b/weixin-java-qidian/pom.xml
@@ -7,7 +7,7 @@
com.github.binarywang
wx-java
- 4.6.7.B
+ 4.6.8.B
weixin-java-qidian
From 3f3c37d286f6eb72f62fdc97ee6ab73e3a177836 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=A0=88=E7=83=9F?=
Date: Tue, 3 Dec 2024 11:51:57 +0800
Subject: [PATCH 010/326] =?UTF-8?q?:art:=20#3424=20=E3=80=90=E5=BE=AE?=
=?UTF-8?q?=E4=BF=A1=E6=94=AF=E4=BB=98=E3=80=91=E5=8A=A0=E8=BD=BD=E8=AF=81?=
=?UTF-8?q?=E4=B9=A6=E5=89=8D=E5=A2=9E=E5=8A=A0=E6=A0=A1=E9=AA=8C=EF=BC=8C?=
=?UTF-8?q?=E5=87=8F=E5=B0=91=E4=B8=8D=E5=BF=85=E8=A6=81=E7=9A=84=E5=BC=82?=
=?UTF-8?q?=E5=B8=B8=E6=97=A5=E5=BF=97=E8=BE=93=E5=87=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../java/com/github/binarywang/wxpay/config/WxPayConfig.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java
index 857b937d8e..3c260226d3 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java
@@ -449,7 +449,7 @@ private InputStream loadConfigInputStream(String configPath) throws WxPayExcepti
*/
private Object[] p12ToPem() {
String key = getMchId();
- if (StringUtils.isBlank(key)) {
+ if (StringUtils.isBlank(key) || StringUtils.isBlank(this.getKeyPath())) {
return null;
}
@@ -466,7 +466,7 @@ private Object[] p12ToPem() {
X509Certificate x509Certificate = (X509Certificate) certificate;
return new Object[]{privateKey, x509Certificate};
} catch (Exception e) {
- log.error("加载证书时发生异常", e);
+ log.error("加载p12证书时发生异常", e);
}
return null;
From 56977a65ca7b3c7c0dc837bc8ee51358492170da Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=A0=88=E7=83=9F?=
Date: Tue, 3 Dec 2024 20:13:03 +0800
Subject: [PATCH 011/326] =?UTF-8?q?:new:=20#3405=20=E3=80=90=E4=BC=81?=
=?UTF-8?q?=E4=B8=9A=E5=BE=AE=E4=BF=A1=E3=80=91=E5=A2=9E=E5=8A=A0=E8=8E=B7?=
=?UTF-8?q?=E5=8F=96=E5=B7=B2=E6=9C=8D=E5=8A=A1=E7=9A=84=E5=A4=96=E9=83=A8?=
=?UTF-8?q?=E8=81=94=E7=B3=BB=E4=BA=BA=E7=9A=84=E6=8E=A5=E5=8F=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: zhanyan
---
.../cp/api/WxCpExternalContactService.java | 29 ++++--
.../impl/WxCpExternalContactServiceImpl.java | 33 +++++--
.../contact/WxCpExternalContactListInfo.java | 92 +++++++++++++++++++
.../weixin/cp/constant/WxCpApiPathConsts.java | 3 +
.../WxCpExternalContactServiceImplTest.java | 27 ++++--
5 files changed, 161 insertions(+), 23 deletions(-)
create mode 100644 weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/contact/WxCpExternalContactListInfo.java
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpExternalContactService.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpExternalContactService.java
index 46d74bf92b..f55d2f7b93 100644
--- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpExternalContactService.java
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpExternalContactService.java
@@ -1,5 +1,10 @@
package me.chanjar.weixin.cp.api;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Date;
+import java.util.List;
import me.chanjar.weixin.common.bean.result.WxMediaUploadResult;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.cp.bean.WxCpBaseResp;
@@ -11,12 +16,6 @@
import me.chanjar.weixin.cp.bean.external.interceptrule.WxCpInterceptRuleInfo;
import me.chanjar.weixin.cp.bean.external.interceptrule.WxCpInterceptRuleList;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Date;
-import java.util.List;
-
/**
*
* 外部联系人管理接口,企业微信的外部联系人的接口和通讯录接口已经拆离
@@ -381,6 +380,24 @@ WxCpExternalContactBatchInfo getContactDetailBatch(String[] userIdList, String c
Integer limit)
throws WxErrorException;
+ /**
+ * 获取已服务的外部联系人
+ *
+ * 企业可通过此接口获取所有已服务的外部联系人,及其添加人和加入的群聊。
+ * 外部联系人分为客户和其他外部联系人,如果是客户,接口将返回外部联系人临时ID和externaluserid;如果是其他外部联系人,接口将只返回外部联系人临时ID。
+ * 请求方式:POST(HTTPS)
+ * 请求地址:https://qyapi.weixin.qq.com/cgi-bin/externalcontact/contact_list?access_token=ACCESS_TOKEN
+ * 文档地址: https://developer.work.weixin.qq.com/document/path/99434
+ *
+ *
+ * @param cursor the cursor
+ * @param limit the limit
+ * @return 已服务的外部联系人列表
+ * @throws WxErrorException .
+ * @apiNote 企业可通过外部联系人临时ID排除重复数据,外部联系人临时ID有效期为4小时。
+ */
+ WxCpExternalContactListInfo getContactList(String cursor, Integer limit) throws WxErrorException;
+
/**
* 修改客户备注信息.
*
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpExternalContactServiceImpl.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpExternalContactServiceImpl.java
index 8a7328af25..c2fbdfe6ef 100644
--- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpExternalContactServiceImpl.java
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpExternalContactServiceImpl.java
@@ -1,7 +1,16 @@
package me.chanjar.weixin.cp.api.impl;
+import static me.chanjar.weixin.cp.constant.WxCpApiPathConsts.ExternalContact.*;
+
import com.google.gson.Gson;
import com.google.gson.JsonObject;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Collections;
+import java.util.Date;
+import java.util.List;
+import java.util.UUID;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;
import me.chanjar.weixin.common.bean.result.WxMediaUploadResult;
@@ -26,16 +35,6 @@
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.StringUtils;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Collections;
-import java.util.Date;
-import java.util.List;
-import java.util.UUID;
-
-import static me.chanjar.weixin.cp.constant.WxCpApiPathConsts.ExternalContact.*;
-
/**
* The type Wx cp external contact service.
*
@@ -215,6 +214,20 @@ public WxCpExternalContactBatchInfo getContactDetailBatch(String[] userIdList, S
return WxCpExternalContactBatchInfo.fromJson(responseContent);
}
+ @Override
+ public WxCpExternalContactListInfo getContactList(String cursor, Integer limit) throws WxErrorException {
+ final String url = this.mainService.getWxCpConfigStorage().getApiUrl(GET_CONTACT_LIST);
+ JsonObject json = new JsonObject();
+ if (StringUtils.isNotBlank(cursor)) {
+ json.addProperty("cursor", cursor);
+ }
+ if (limit != null) {
+ json.addProperty("limit", limit);
+ }
+ String responseContent = this.mainService.post(url, json.toString());
+ return WxCpExternalContactListInfo.fromJson(responseContent);
+ }
+
@Override
public void updateRemark(WxCpUpdateRemarkRequest request) throws WxErrorException {
final String url = this.mainService.getWxCpConfigStorage().getApiUrl(UPDATE_REMARK);
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/contact/WxCpExternalContactListInfo.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/contact/WxCpExternalContactListInfo.java
new file mode 100644
index 0000000000..4c0055ad80
--- /dev/null
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/contact/WxCpExternalContactListInfo.java
@@ -0,0 +1,92 @@
+package me.chanjar.weixin.cp.bean.external.contact;
+
+import com.google.gson.annotations.SerializedName;
+import java.io.Serializable;
+import java.util.List;
+import lombok.Getter;
+import lombok.Setter;
+import me.chanjar.weixin.cp.api.WxCpService;
+import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
+
+/**
+ * 获取已服务的外部联系人( 参考文档)
+ * @see WxCpService#getExternalContactService()
+ * @serial
+ */
+@Getter
+@Setter
+public class WxCpExternalContactListInfo implements Serializable {
+
+ private static final long serialVersionUID = 7114885886548364396L;
+
+ @SerializedName("next_cursor")
+ private String nextCursor;
+
+ @SerializedName("errcode")
+ private String errcode;
+
+ @SerializedName("errmsg")
+ private String errmsg;
+
+ @SerializedName("info_list")
+ private List infoList;
+
+ @Getter
+ @Setter
+ public static class ExternalContactInfo implements Serializable{
+
+ private static final long serialVersionUID = -7400291089462740100L;
+
+ /**
+ * 是否被成员标记为客户
+ */
+ @SerializedName("is_customer")
+ private Boolean isCustomer;
+
+ /**
+ * 外部联系人临时ID
+ */
+ @SerializedName("tmp_openid")
+ private String tmpOpenid;
+
+ /**
+ * 外部联系人的externaluserid(如果是客户才返回)
+ */
+ @SerializedName("external_userid")
+ private String externalUserid;
+
+ /**
+ * 脱敏后的外部联系人昵称(如果是其他外部联系人才返回)
+ */
+ @SerializedName("name")
+ private String name;
+
+ /**
+ * 添加此外部联系人的企业成员或外部联系人所在群聊的群主userid
+ */
+ @SerializedName("follow_userid")
+ private String followUserid;
+
+ /**
+ * 外部联系人所在的群聊ID(如果群聊被成员标记为客户群才返回)
+ */
+ @SerializedName("chat_id")
+ private String chatId;
+
+ /**
+ * 外部联系人所在群聊的群名(如果群聊未被成员标记为客户群才返回)
+ */
+ @SerializedName("chat_name")
+ private String chatName;
+
+ /**
+ * 外部联系人首次添加/进群的时间
+ */
+ @SerializedName("add_time")
+ private Long addTime;
+ }
+ public static WxCpExternalContactListInfo fromJson(String json) {
+ return WxCpGsonBuilder.create().fromJson(json, WxCpExternalContactListInfo.class);
+ }
+
+}
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/constant/WxCpApiPathConsts.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/constant/WxCpApiPathConsts.java
index d90bda6ccc..b53f7549d7 100644
--- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/constant/WxCpApiPathConsts.java
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/constant/WxCpApiPathConsts.java
@@ -1137,6 +1137,9 @@ interface ExternalContact {
* The constant GET_CONTACT_DETAIL_BATCH.
*/
String GET_CONTACT_DETAIL_BATCH = "/cgi-bin/externalcontact/batch/get_by_user?";
+
+ String GET_CONTACT_LIST = "/cgi-bin/externalcontact/contact_list?";
+
/**
* The constant UPDATE_REMARK.
*/
diff --git a/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/impl/WxCpExternalContactServiceImplTest.java b/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/impl/WxCpExternalContactServiceImplTest.java
index 9f7dd8c531..c629165ca4 100644
--- a/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/impl/WxCpExternalContactServiceImplTest.java
+++ b/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/impl/WxCpExternalContactServiceImplTest.java
@@ -1,7 +1,13 @@
package me.chanjar.weixin.cp.api.impl;
+import static org.testng.Assert.assertNotNull;
+
import com.google.common.collect.Lists;
import com.google.inject.Inject;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Date;
+import java.util.List;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.common.util.XmlUtils;
import me.chanjar.weixin.cp.api.ApiTestModule;
@@ -10,6 +16,7 @@
import me.chanjar.weixin.cp.bean.external.*;
import me.chanjar.weixin.cp.bean.external.contact.WxCpExternalContactBatchInfo;
import me.chanjar.weixin.cp.bean.external.contact.WxCpExternalContactInfo;
+import me.chanjar.weixin.cp.bean.external.contact.WxCpExternalContactListInfo;
import me.chanjar.weixin.cp.bean.external.msg.Attachment;
import me.chanjar.weixin.cp.bean.external.msg.AttachmentBuilder;
import me.chanjar.weixin.cp.bean.external.msg.Image;
@@ -22,13 +29,6 @@
import org.testng.annotations.Test;
import org.testng.collections.CollectionUtils;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Date;
-import java.util.List;
-
-import static org.testng.Assert.assertNotNull;
-
/**
* The type Wx cp external contact service impl test.
*/
@@ -188,6 +188,19 @@ public void testGetContactDetailBatch() throws WxErrorException {
assertNotNull(result);
}
+ /**
+ * Test get contact list.
+ *
+ * @throws WxErrorException the wx error exception
+ */
+ @Test
+ public void testGetContactList() throws WxErrorException {
+ WxCpExternalContactListInfo result =
+ this.wxCpService.getExternalContactService().getContactList("", 100);
+ System.out.println(result);
+ assertNotNull(result);
+ }
+
/**
* Test get corp tag list.
*
From 03f78caecffb859a10c860ace75e6468113aa38f Mon Sep 17 00:00:00 2001
From: Leandra Green <142376248+aimmt918@users.noreply.github.com>
Date: Thu, 5 Dec 2024 11:17:58 +0800
Subject: [PATCH 012/326] =?UTF-8?q?:new:=20#3431=20=E3=80=90=E5=BC=80?=
=?UTF-8?q?=E6=94=BE=E5=B9=B3=E5=8F=B0=E3=80=91=E5=A2=9E=E5=8A=A0=E5=8D=8A?=
=?UTF-8?q?=E5=B1=8F=E5=B0=8F=E7=A8=8B=E5=BA=8F=E7=AE=A1=E7=90=86=E7=9B=B8?=
=?UTF-8?q?=E5=85=B3=E6=8E=A5=E5=8F=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../weixin/common/error/WxMaErrorMsgEnum.java | 126 +++++++++++++
.../open/api/WxOpenMaEmbeddedService.java | 133 ++++++++++++++
.../weixin/open/api/WxOpenMaService.java | 9 +
.../api/impl/WxOpenMaEmbeddedServiceImpl.java | 165 ++++++++++++++++++
.../open/api/impl/WxOpenMaServiceImpl.java | 3 +
.../weixin/open/bean/ma/WxOpenMaEmbedded.java | 59 +++++++
.../result/WxOpenMaEmbeddedListResult.java | 43 +++++
7 files changed, 538 insertions(+)
create mode 100644 weixin-java-open/src/main/java/me/chanjar/weixin/open/api/WxOpenMaEmbeddedService.java
create mode 100644 weixin-java-open/src/main/java/me/chanjar/weixin/open/api/impl/WxOpenMaEmbeddedServiceImpl.java
create mode 100644 weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/ma/WxOpenMaEmbedded.java
create mode 100644 weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/result/WxOpenMaEmbeddedListResult.java
diff --git a/weixin-java-common/src/main/java/me/chanjar/weixin/common/error/WxMaErrorMsgEnum.java b/weixin-java-common/src/main/java/me/chanjar/weixin/common/error/WxMaErrorMsgEnum.java
index 46c1d3d3d2..1bb3f6472b 100644
--- a/weixin-java-common/src/main/java/me/chanjar/weixin/common/error/WxMaErrorMsgEnum.java
+++ b/weixin-java-common/src/main/java/me/chanjar/weixin/common/error/WxMaErrorMsgEnum.java
@@ -711,6 +711,132 @@ public enum WxMaErrorMsgEnum {
CODE_89255(89255, "code参数无效,请检查code长度以及内容是否正确_;注意code_type的值不同需要传的code长度不一样 ;注意code_type的值不同需要传的code长度不一样"),
// CODE_504002(-504002, "云函数未找到 Function not found"),
+
+ /**
+ * 半屏小程序系统错误
+ */
+ CODE_89408(89408, "半屏小程序系统错误"),
+
+ /**
+ * 获取半屏小程序列表参数错误
+ */
+ CODE_89409(89409, "获取半屏小程序列表参数错误"),
+
+ /**
+ * 添加半屏小程序appid参数错误
+ */
+ CODE_89410(89410, "添加半屏小程序appid参数错误"),
+
+ /**
+ * 添加半屏小程序appid参数为空
+ */
+ CODE_89411(89411, "添加半屏小程序appid参数为空"),
+
+ /**
+ * 添加半屏小程序申请理由不得超过30个字
+ */
+ CODE_89412(89412, "添加半屏小程序申请理由不得超过30个字"),
+
+ /**
+ * 该小程序被申请次数已达24h限制
+ */
+ CODE_89413(89413, "该小程序被申请次数已达24h限制"),
+
+ /**
+ * 每天仅允许申请50次半屏小程序
+ */
+ CODE_89414(89414, "每天仅允许申请50次半屏小程序"),
+
+ /**
+ * 删除半屏小程序appid参数为空
+ */
+ CODE_89415(89415, "删除半屏小程序appid参数为空"),
+
+ /**
+ * 取消半屏小程序授权appid参数为空
+ */
+ CODE_89416(89416, "取消半屏小程序授权appid参数为空"),
+
+ /**
+ * 修改半屏小程序方式flag参数错误
+ */
+ CODE_89417(89417, "修改半屏小程序方式flag参数错误"),
+
+ /**
+ * 获取半屏小程序每日申请次数失败
+ */
+ CODE_89418(89418, "获取半屏小程序每日申请次数失败"),
+
+ /**
+ * 获取半屏小程序每日授权次数失败
+ */
+ CODE_89419(89419, "获取半屏小程序每日授权次数失败"),
+
+ /**
+ * 不支持添加个人主体小程序
+ */
+ CODE_89420(89420, "不支持添加个人主体小程序"),
+
+ /**
+ * 删除数据未找到
+ */
+ CODE_89421(89421, "删除数据未找到"),
+
+ /**
+ * 删除状态异常
+ */
+ CODE_89422(89422, "删除状态异常"),
+
+ /**
+ * 申请次数添加到达上限
+ */
+ CODE_89423(89423, "申请次数添加到达上限"),
+
+ /**
+ * 申请添加已超时
+ */
+ CODE_89425(89425, "申请添加已超时"),
+
+ /**
+ * 申请添加状态异常
+ */
+ CODE_89426(89426, "申请添加状态异常"),
+
+ /**
+ * 申请号和授权号相同
+ */
+ CODE_89427(89427, "申请号和授权号相同"),
+
+ /**
+ * 该小程序已申请,不允许重复添加
+ */
+ CODE_89428(89428, "该小程序已申请,不允许重复添加"),
+
+ /**
+ * 已到达同一小程序每日最多申请次数
+ */
+ CODE_89429(89429, "已到达同一小程序每日最多申请次数"),
+
+ /**
+ * 该小程序已设置自动拒绝申请
+ */
+ CODE_89430(89430, "该小程序已设置自动拒绝申请"),
+
+ /**
+ * 不支持此类型小程序
+ */
+ CODE_89431(89431, "不支持此类型小程序"),
+
+ /**
+ * 不是小程序
+ */
+ CODE_89432(89432, "不是小程序"),
+
+ /**
+ * 授权次数到达上限
+ */
+ CODE_89424(89424, "授权次数到达上限"),
+
;
private final int code;
diff --git a/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/WxOpenMaEmbeddedService.java b/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/WxOpenMaEmbeddedService.java
new file mode 100644
index 0000000000..80fdac2f38
--- /dev/null
+++ b/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/WxOpenMaEmbeddedService.java
@@ -0,0 +1,133 @@
+package me.chanjar.weixin.open.api;
+
+import me.chanjar.weixin.common.error.WxErrorException;
+import me.chanjar.weixin.open.bean.result.WxOpenMaEmbeddedListResult;
+
+/**
+ * 半屏小程序管理服务
+ *
+ * 半屏小程序管理
+ *
+ *
+ * @author Yuan
+ * @version 1.0.0
+ * @date 2024-12-04 16:55:19
+ */
+public interface WxOpenMaEmbeddedService {
+
+ /**
+ * 添加半屏小程序
+ *
+ * 本接口用于添加半屏小程序
+ *
+ */
+ String API_ADD_EMBEDDED = "https://api.weixin.qq.com/wxaapi/wxaembedded/add_embedded";
+
+ /**
+ * 删除半屏小程序
+ *
+ * 用本接口可以删除已经获得授权调用的半屏小程序
+ * 说明:通过add_embedded接口添加半屏小程序后,可通过当前接口删除已经添加到半屏小程序列表的小程序
+ *
+ */
+ String API_DELETE_EMBEDDED = "https://api.weixin.qq.com/wxaapi/wxaembedded/del_embedded";
+
+ /**
+ * 获取半屏小程序调用列表
+ *
+ * 调用本接口可以获取半屏小程序调用列表
+ * 说明:通过addEmbedded接口添加半屏小程序后,可通过当前接口获取半屏小程序调用列表
+ *
+ */
+ String API_GET_EMBEDDED_LIST = "https://api.weixin.qq.com/wxaapi/wxaembedded/get_list";
+
+ /**
+ * 取消授权小程序
+ *
+ * 调用本接口可以取消已经授权的小程序
+ * 说明:可通过get_own_list接口获取当前半屏小程序已经授权的小程序列表,可通过当前接口取消对某个小程序的调用权限
+ *
+ */
+ String API_DELETE_AUTHORIZED_EMBEDDED = "https://api.weixin.qq.com/wxaapi/wxaembedded/del_authorize";
+
+ /**
+ * 获取半屏小程序授权列表
+ *
+ * 调用本接口可以获取半屏小程序授权列表
+ * 说明:一个半屏小程序可授权给1000个小程序调用,通过该接口可获取已经授权的小程序列表
+ *
+ */
+ String API_GET_OWN_LIST = "https://api.weixin.qq.com/wxaapi/wxaembedded/get_own_list";
+
+ /**
+ * 设置授权方式
+ */
+ String API_SET_AUTHORIZED_EMBEDDED = "https://api.weixin.qq.com/wxaapi/wxaembedded/set_authorize";
+
+ /**
+ * 添加半屏小程序
+ *
+ * @param embeddedAppId 半屏小程序appId
+ * @param applyReason 申请理由
+ * @author Yuan
+ * @date 2024-12-04 17:33:33
+ */
+ void addEmbedded(String embeddedAppId, String applyReason) throws WxErrorException;
+
+ /**
+ * 删除半屏小程序
+ *
+ * @param embeddedAppId 半屏小程序appId
+ * @author Yuan
+ * @date 2024-12-04 17:33:33
+ */
+ void deleteEmbedded(String embeddedAppId) throws WxErrorException;
+
+ /**
+ * 获取半屏小程序调用列表
+ *
+ * @return {@link WxOpenMaEmbeddedListResult }
+ * @author Yuan
+ * @date 2024-12-04 17:33:33
+ */
+ WxOpenMaEmbeddedListResult getEmbeddedList() throws WxErrorException;
+
+ /**
+ * 取消授权小程序
+ *
+ * @param embeddedAppId 半屏小程序appId
+ * @author Yuan
+ * @date 2024-12-04 17:33:33
+ */
+ void deleteAuthorizedEmbedded(String embeddedAppId) throws WxErrorException;
+
+ /**
+ * 获取半屏小程序授权列表,默认分页起始值为0,一次拉取最大值为1000
+ *
+ * @return {@link WxOpenMaEmbeddedListResult }
+ * @author Yuan
+ * @date 2024-12-04 17:33:33
+ */
+ WxOpenMaEmbeddedListResult getOwnList() throws WxErrorException;
+
+ /**
+ * 获取半屏小程序授权列表
+ *
+ * @param start 分页起始值 ,默认值为0
+ * @param num 一次拉取最大值,最大 1000,默认值为10
+ * @return {@link WxOpenMaEmbeddedListResult }
+ * @author Yuan
+ * @date 2024-12-04 17:33:33
+ */
+ WxOpenMaEmbeddedListResult getOwnList(Integer start, Integer num) throws WxErrorException;
+
+ /**
+ * 设置授权方式
+ *
+ * @param flag 半屏小程序授权方式。0表示需要管理员验证;1表示自动通过;2表示自动拒绝。
+ * @author Yuan
+ * @date 2024-12-04 17:33:33
+ */
+ void setAuthorizedEmbedded(Integer flag) throws WxErrorException;
+
+}
diff --git a/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/WxOpenMaService.java b/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/WxOpenMaService.java
index 6d540940c0..7a3bbca44a 100644
--- a/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/WxOpenMaService.java
+++ b/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/WxOpenMaService.java
@@ -738,6 +738,15 @@ WxOpenMaDomainResult modifyDomain(String action, List requestDomains, Li
*/
WxOpenMaPrivacyService getPrivacyService();
+ /**
+ * 半屏小程序服务
+ *
+ * @return {@link WxOpenMaEmbeddedService }
+ * @author Yuan
+ * @date 2024-12-04 18:42:21
+ */
+ WxOpenMaEmbeddedService getEmbeddedService();
+
/**
* 购物订单
*
diff --git a/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/impl/WxOpenMaEmbeddedServiceImpl.java b/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/impl/WxOpenMaEmbeddedServiceImpl.java
new file mode 100644
index 0000000000..8a4a171af7
--- /dev/null
+++ b/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/impl/WxOpenMaEmbeddedServiceImpl.java
@@ -0,0 +1,165 @@
+package me.chanjar.weixin.open.api.impl;
+
+import cn.binarywang.wx.miniapp.api.WxMaService;
+import cn.binarywang.wx.miniapp.json.WxMaGsonBuilder;
+import com.google.gson.JsonObject;
+import lombok.AllArgsConstructor;
+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.open.api.WxOpenMaEmbeddedService;
+import me.chanjar.weixin.open.bean.result.WxOpenMaEmbeddedListResult;
+import org.apache.commons.lang3.StringUtils;
+
+/**
+ * 半屏小程序管理服务
+ *
+ * 半屏小程序管理
+ *
+ *
+ * @author Yuan
+ * @version 1.0.0
+ * @date 2024-12-04 16:55:19
+ */
+@AllArgsConstructor
+public class WxOpenMaEmbeddedServiceImpl implements WxOpenMaEmbeddedService {
+
+ private final WxMaService wxMaService;
+
+ /**
+ * 添加半屏小程序
+ *
+ * @param embeddedAppId 半屏小程序appId
+ * @param applyReason 申请理由
+ * @author Yuan
+ * @date 2024-12-04 17:33:33
+ */
+ @Override
+ public void addEmbedded(String embeddedAppId, String applyReason) throws WxErrorException {
+ JsonObject params = new JsonObject();
+ params.addProperty("appid", embeddedAppId);
+ if (StringUtils.isNotBlank(applyReason)) {
+ params.addProperty("apply_reason", applyReason);
+ }
+ String response = wxMaService.post(API_ADD_EMBEDDED, params);
+ WxError wxError = WxError.fromJson(response, WxType.MiniApp);
+ if (wxError.getErrorCode() != 0) {
+ throw new WxErrorException(wxError);
+ }
+ }
+
+ /**
+ * 删除半屏小程序
+ *
+ * @param embeddedAppId 半屏小程序appId
+ * @author Yuan
+ * @date 2024-12-04 17:33:33
+ */
+ @Override
+ public void deleteEmbedded(String embeddedAppId) throws WxErrorException {
+ JsonObject params = new JsonObject();
+ params.addProperty("appid", embeddedAppId);
+ String response = wxMaService.post(API_DELETE_EMBEDDED, params);
+ WxError wxError = WxError.fromJson(response, WxType.MiniApp);
+ if (wxError.getErrorCode() != 0) {
+ throw new WxErrorException(wxError);
+ }
+ }
+
+ /**
+ * 获取半屏小程序调用列表
+ *
+ * @author Yuan
+ * @date 2024-12-04 17:33:33
+ */
+ @Override
+ public WxOpenMaEmbeddedListResult getEmbeddedList() throws WxErrorException {
+ String response = wxMaService.get(API_GET_EMBEDDED_LIST, null);
+ WxError wxError = WxError.fromJson(response, WxType.MiniApp);
+ if (wxError.getErrorCode() != 0) {
+ throw new WxErrorException(wxError);
+ }
+ return WxMaGsonBuilder.create().fromJson(response, WxOpenMaEmbeddedListResult.class);
+ }
+
+ /**
+ * 取消授权小程序
+ *
+ * @param embeddedAppId 半屏小程序appId
+ * @author Yuan
+ * @date 2024-12-04 17:33:33
+ */
+ @Override
+ public void deleteAuthorizedEmbedded(String embeddedAppId) throws WxErrorException {
+ JsonObject params = new JsonObject();
+ params.addProperty("appid", embeddedAppId);
+ String response = wxMaService.post(API_DELETE_AUTHORIZED_EMBEDDED, params);
+ WxError wxError = WxError.fromJson(response, WxType.MiniApp);
+ if (wxError.getErrorCode() != 0) {
+ throw new WxErrorException(wxError);
+ }
+ }
+
+ /**
+ * 获取半屏小程序授权列表
+ *
+ * @return {@link WxOpenMaEmbeddedListResult }
+ * @author Yuan
+ * @date 2024-12-04 17:33:33
+ */
+ @Override
+ public WxOpenMaEmbeddedListResult getOwnList() throws WxErrorException {
+ String response = wxMaService.get(API_GET_OWN_LIST + "?num=1000", null);
+ WxError wxError = WxError.fromJson(response, WxType.MiniApp);
+ if (wxError.getErrorCode() != 0) {
+ throw new WxErrorException(wxError);
+ }
+ return WxMaGsonBuilder.create().fromJson(response, WxOpenMaEmbeddedListResult.class);
+ }
+
+ /**
+ * 获取半屏小程序授权列表
+ *
+ * @param start 分页起始值 ,默认值为0
+ * @param num 一次拉取最大值,最大 1000,默认值为10
+ * @return {@link WxOpenMaEmbeddedListResult }
+ * @author Yuan
+ * @date 2024-12-04 17:33:33
+ */
+ @Override
+ public WxOpenMaEmbeddedListResult getOwnList(Integer start, Integer num) throws WxErrorException {
+ if (null == start) {
+ start = 0;
+ }
+ if (null == num) {
+ num = 10;
+ }
+ if (num > 1000) {
+ num = 1000;
+ }
+ String response = wxMaService.get(API_GET_OWN_LIST + "?start=" + start + "&num=" + num, null);
+ WxError wxError = WxError.fromJson(response, WxType.MiniApp);
+ if (wxError.getErrorCode() != 0) {
+ throw new WxErrorException(wxError);
+ }
+ return WxMaGsonBuilder.create().fromJson(response, WxOpenMaEmbeddedListResult.class);
+ }
+
+ /**
+ * 设置授权方式
+ *
+ * @param flag 半屏小程序授权方式。0表示需要管理员验证;1表示自动通过;2表示自动拒绝。
+ * @author Yuan
+ * @date 2024-12-04 17:33:33
+ */
+ @Override
+ public void setAuthorizedEmbedded(Integer flag) throws WxErrorException {
+ JsonObject params = new JsonObject();
+ params.addProperty("flag", flag);
+ String response = wxMaService.post(API_SET_AUTHORIZED_EMBEDDED, params);
+ WxError wxError = WxError.fromJson(response, WxType.MiniApp);
+ if (wxError.getErrorCode() != 0) {
+ throw new WxErrorException(wxError);
+ }
+ }
+}
diff --git a/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/impl/WxOpenMaServiceImpl.java b/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/impl/WxOpenMaServiceImpl.java
index 75be6bd4e1..08bfc92bf7 100644
--- a/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/impl/WxOpenMaServiceImpl.java
+++ b/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/impl/WxOpenMaServiceImpl.java
@@ -54,6 +54,8 @@ public class WxOpenMaServiceImpl extends WxMaServiceImpl implements WxOpenMaServ
private final WxOpenMaPrivacyService privacyService;
@Getter
private final WxOpenMaShoppingOrdersService shoppingOrdersService;
+ @Getter
+ private final WxOpenMaEmbeddedService embeddedService;
public WxOpenMaServiceImpl(WxOpenComponentService wxOpenComponentService, String appId, WxMaConfig wxMaConfig) {
this.wxOpenComponentService = wxOpenComponentService;
@@ -64,6 +66,7 @@ public WxOpenMaServiceImpl(WxOpenComponentService wxOpenComponentService, String
this.icpService = new WxOpenMaIcpServiceImpl(this);
this.privacyService = new WxOpenMaPrivacyServiceImpl(this);
this.shoppingOrdersService = new WxOpenMaShoppingOrdersServiceImpl(this);
+ this.embeddedService = new WxOpenMaEmbeddedServiceImpl(this);
initHttp();
}
diff --git a/weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/ma/WxOpenMaEmbedded.java b/weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/ma/WxOpenMaEmbedded.java
new file mode 100644
index 0000000000..e408b3baf4
--- /dev/null
+++ b/weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/ma/WxOpenMaEmbedded.java
@@ -0,0 +1,59 @@
+package me.chanjar.weixin.open.bean.ma;
+
+import com.google.gson.annotations.SerializedName;
+import lombok.Data;
+import me.chanjar.weixin.open.util.json.WxOpenGsonBuilder;
+
+import java.io.Serializable;
+
+/**
+ * 微信开放平台半屏小程序信息
+ *
+ * @author Yuan
+ * @version 1.0.0
+ * @date 2024-12-04 17:57:40
+ */
+@Data
+public class WxOpenMaEmbedded implements Serializable {
+ private static final long serialVersionUID = -7319330493157204072L;
+
+ /**
+ * 半屏小程序appid
+ */
+ @SerializedName("appid")
+ private String appId;
+ /**
+ * 添加时间
+ */
+ @SerializedName("create_time")
+ private Long createTime;
+ /**
+ * 头像url
+ */
+ @SerializedName("headimg")
+ private String headImg;
+ /**
+ * 半屏小程序昵称
+ */
+ @SerializedName("nickname")
+ private String nickName;
+ /**
+ * 申请理由
+ */
+ @SerializedName("reason")
+ private String reason;
+ /**
+ * 申请状态,1-待验证,2-已通过,3-已拒绝,4-已超时,5-已撤销,6-已取消授权
+ */
+ @SerializedName("status")
+ private String status;
+
+ @Override
+ public String toString() {
+ return WxOpenGsonBuilder.create().toJson(this);
+ }
+
+ public String toJson() {
+ return WxOpenGsonBuilder.create().toJson(this);
+ }
+}
diff --git a/weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/result/WxOpenMaEmbeddedListResult.java b/weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/result/WxOpenMaEmbeddedListResult.java
new file mode 100644
index 0000000000..258a2630fa
--- /dev/null
+++ b/weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/result/WxOpenMaEmbeddedListResult.java
@@ -0,0 +1,43 @@
+package me.chanjar.weixin.open.bean.result;
+
+import com.google.gson.annotations.SerializedName;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import me.chanjar.weixin.open.bean.ma.WxOpenMaEmbedded;
+import me.chanjar.weixin.open.util.json.WxOpenGsonBuilder;
+
+import java.util.List;
+
+/**
+ * 获取半屏小程序调用列表返回值
+ *
+ * @author Yuan
+ * @version 1.0.0
+ * @date 2024-12-04 18:06:40
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+public class WxOpenMaEmbeddedListResult extends WxOpenResult {
+ private static final long serialVersionUID = -6484320771244602727L;
+
+ /**
+ * 半屏小程序列表
+ */
+ @SerializedName("wxa_embedded_list")
+ private List embeddedList;
+
+ /**
+ * 授权方式,0表示需要管理员确认,1表示自动通过,2表示自动拒绝
+ */
+ @SerializedName("embedded_flag")
+ private Integer embeddedFlag;
+
+ @Override
+ public String toString() {
+ return WxOpenGsonBuilder.create().toJson(this);
+ }
+
+ public String toJson() {
+ return WxOpenGsonBuilder.create().toJson(this);
+ }
+}
From ca005534d4270713c951a6a1c30accd95193fb81 Mon Sep 17 00:00:00 2001
From: pengles
Date: Mon, 9 Dec 2024 09:01:12 +0000
Subject: [PATCH 013/326] =?UTF-8?q?:new:=20=E3=80=90=E5=85=AC=E4=BC=97?=
=?UTF-8?q?=E5=8F=B7=E3=80=91=E4=BC=98=E5=8C=96=E9=85=8D=E7=BD=AE=E7=B1=BB?=
=?UTF-8?q?=EF=BC=8C=E5=A2=9E=E5=8A=A0=E6=96=B0=E6=96=B9=E6=B3=95=E8=8E=B7?=
=?UTF-8?q?=E5=8F=96=20OAuth=202.0=E9=87=8D=E5=AE=9A=E5=90=91=20URL=20?=
=?UTF-8?q?=E5=92=8C=20QR=20=E8=BF=9E=E6=8E=A5=E9=87=8D=E5=AE=9A=E5=90=91?=
=?UTF-8?q?=20URL=20!146?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../weixin/mp/config/WxMpConfigStorage.java | 23 ++++++++++++++++++-
.../mp/config/impl/WxMpDefaultConfigImpl.java | 3 +++
.../mp/api/impl/WxMpServiceImplTest.java | 9 ++++++++
.../weixin/mp/demo/DemoOAuth2Handler.java | 2 +-
.../src/test/resources/test-config.sample.xml | 4 ++--
.../api/impl/WxOpenInMemoryConfigStorage.java | 11 +++++++++
6 files changed, 48 insertions(+), 4 deletions(-)
diff --git a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/config/WxMpConfigStorage.java b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/config/WxMpConfigStorage.java
index 148ad6ebef..11aeef6124 100644
--- a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/config/WxMpConfigStorage.java
+++ b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/config/WxMpConfigStorage.java
@@ -22,13 +22,15 @@ public interface WxMpConfigStorage {
/**
* Is use stable access token api
- * @Link https://developers.weixin.qq.com/doc/offiaccount/Basic_Information/getStableAccessToken.html
+ *
* @return the boolean
+ * @link https://developers.weixin.qq.com/doc/offiaccount/Basic_Information/getStableAccessToken.html
*/
boolean isStableAccessToken();
/**
* Set use stable access token api
+ *
* @param useStableAccessToken true is use, false is not
*/
void useStableAccessToken(boolean useStableAccessToken);
@@ -154,9 +156,28 @@ public interface WxMpConfigStorage {
* Gets oauth 2 redirect uri.
*
* @return the oauth 2 redirect uri
+ * @deprecated This method is deprecated due to incorrect naming convention.
+ * Use {@link #getOauth2RedirectUrl()} instead.
*/
+ @Deprecated
String getOauth2redirectUri();
+ /**
+ * Gets OAuth 2.0 redirect Url
+ *
+ * @return the OAuth 2.0 redirect Url
+ * @author Peng Les
+ */
+ String getOauth2RedirectUrl();
+
+ /**
+ * Gets QR connect redirect Url
+ *
+ * @return the QR connect redirect Url
+ * @author Peng Les
+ */
+ String getQrConnectRedirectUrl();
+
/**
* Gets http proxy host.
*
diff --git a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/config/impl/WxMpDefaultConfigImpl.java b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/config/impl/WxMpDefaultConfigImpl.java
index 8c0ccfe666..da47fc49fa 100644
--- a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/config/impl/WxMpDefaultConfigImpl.java
+++ b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/config/impl/WxMpDefaultConfigImpl.java
@@ -34,7 +34,10 @@ public class WxMpDefaultConfigImpl implements WxMpConfigStorage, Serializable {
protected volatile String aesKey;
protected volatile long expiresTime;
+ @Deprecated
protected volatile String oauth2redirectUri;
+ protected volatile String oauth2RedirectUrl;
+ protected volatile String qrConnectRedirectUrl;
protected volatile String httpProxyHost;
protected volatile int httpProxyPort;
diff --git a/weixin-java-mp/src/test/java/me/chanjar/weixin/mp/api/impl/WxMpServiceImplTest.java b/weixin-java-mp/src/test/java/me/chanjar/weixin/mp/api/impl/WxMpServiceImplTest.java
index 636bedb855..f569c09d9d 100644
--- a/weixin-java-mp/src/test/java/me/chanjar/weixin/mp/api/impl/WxMpServiceImplTest.java
+++ b/weixin-java-mp/src/test/java/me/chanjar/weixin/mp/api/impl/WxMpServiceImplTest.java
@@ -44,6 +44,15 @@ public void testBuildQrConnectUrl() {
System.out.println(qrConnectUrl);
}
+ @Test
+ public void testBuildQrConnectRedirectUrl() {
+ String qrConnectRedirectUrl = this.wxService.getWxMpConfigStorage().getQrConnectRedirectUrl();
+ String qrConnectUrl = this.wxService.buildQrConnectUrl(qrConnectRedirectUrl,
+ WxConsts.QrConnectScope.SNSAPI_LOGIN, null);
+ Assert.assertNotNull(qrConnectUrl);
+ System.out.println(qrConnectUrl);
+ }
+
public void testGetTicket() throws WxErrorException {
String ticket = this.wxService.getTicket(TicketType.SDK, false);
System.out.println(ticket);
diff --git a/weixin-java-mp/src/test/java/me/chanjar/weixin/mp/demo/DemoOAuth2Handler.java b/weixin-java-mp/src/test/java/me/chanjar/weixin/mp/demo/DemoOAuth2Handler.java
index ce23512e29..3d257b873e 100644
--- a/weixin-java-mp/src/test/java/me/chanjar/weixin/mp/demo/DemoOAuth2Handler.java
+++ b/weixin-java-mp/src/test/java/me/chanjar/weixin/mp/demo/DemoOAuth2Handler.java
@@ -18,7 +18,7 @@ public WxMpXmlOutMessage handle(WxMpXmlMessage wxMessage,
Map context, WxMpService wxMpService,
WxSessionManager sessionManager) {
String href = "测试oauth2";
return WxMpXmlOutMessage.TEXT().content(href)
.fromUser(wxMessage.getToUser()).toUser(wxMessage.getFromUser())
diff --git a/weixin-java-mp/src/test/resources/test-config.sample.xml b/weixin-java-mp/src/test/resources/test-config.sample.xml
index 3df1de9d57..003fa8565c 100644
--- a/weixin-java-mp/src/test/resources/test-config.sample.xml
+++ b/weixin-java-mp/src/test/resources/test-config.sample.xml
@@ -10,7 +10,7 @@
商户平台设置的API密钥
商户平台的证书文件地址
模版消息的模版ID
- 网页授权获取用户信息回调地址
- 网页应用授权登陆回调地址
+ 网页授权获取用户信息回调地址
+ 网页应用授权登陆回调地址
完整客服账号,格式为:账号前缀@公众号微信号
diff --git a/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/impl/WxOpenInMemoryConfigStorage.java b/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/impl/WxOpenInMemoryConfigStorage.java
index a103315b5d..4b195badc3 100644
--- a/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/impl/WxOpenInMemoryConfigStorage.java
+++ b/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/impl/WxOpenInMemoryConfigStorage.java
@@ -572,11 +572,22 @@ public String getMsgDataFormat() {
return null;
}
+ @Deprecated
@Override
public String getOauth2redirectUri() {
return null;
}
+ @Override
+ public String getOauth2RedirectUrl() {
+ return null;
+ }
+
+ @Override
+ public String getQrConnectRedirectUrl() {
+ return null;
+ }
+
@Override
public String getHttpProxyHost() {
return this.wxOpenConfigStorage.getHttpProxyHost();
From f70a305aea00faff833ddc220dc5a8a4af8007a1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ader1y=20=E6=A0=88=E7=83=9F?=
Date: Thu, 12 Dec 2024 16:18:54 +0800
Subject: [PATCH 014/326] =?UTF-8?q?:bug:=20=E3=80=90=E5=BE=AE=E4=BF=A1?=
=?UTF-8?q?=E6=94=AF=E4=BB=98=E3=80=91=E4=BF=AE=E5=A4=8D=E5=85=AC=E9=92=A5?=
=?UTF-8?q?=E6=A0=A1=E9=AA=8C=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../java/com/github/binarywang/wxpay/config/WxPayConfig.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java
index 3c260226d3..a8ad909b3e 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java
@@ -449,7 +449,8 @@ private InputStream loadConfigInputStream(String configPath) throws WxPayExcepti
*/
private Object[] p12ToPem() {
String key = getMchId();
- if (StringUtils.isBlank(key) || StringUtils.isBlank(this.getKeyPath())) {
+ if (StringUtils.isBlank(key) ||
+ (StringUtils.isBlank(this.getKeyPath()) && this.keyContent == null && StringUtils.isBlank(this.keyString))) {
return null;
}
From a4e3af0eb66659cc84be2874c2357d6017c7761e Mon Sep 17 00:00:00 2001
From: Binary Wang
Date: Sat, 14 Dec 2024 00:14:58 +0800
Subject: [PATCH 015/326] =?UTF-8?q?:art:=20#3437=20=E3=80=90=E4=BC=81?=
=?UTF-8?q?=E4=B8=9A=E5=BE=AE=E4=BF=A1=E3=80=91=20=E5=BE=AE=E7=9B=98?=
=?UTF-8?q?=E6=96=87=E4=BB=B6=E7=AE=A1=E7=90=86=E7=9B=B8=E5=85=B3=E6=8E=A5?=
=?UTF-8?q?=E5=8F=A3=E7=A7=BB=E9=99=A4=E8=BF=87=E6=9C=9F=E7=9A=84userid?=
=?UTF-8?q?=E5=8F=82=E6=95=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../weixin/cp/api/WxCpOaWeDriveService.java | 102 +++++++++---------
.../cp/api/impl/WxCpOaWeDriveServiceImpl.java | 13 +--
.../oa/wedrive/WxCpFileDeleteRequest.java | 3 -
.../cp/bean/oa/wedrive/WxCpFileDownload.java | 4 -
.../bean/oa/wedrive/WxCpFileListRequest.java | 3 -
.../bean/oa/wedrive/WxCpFileMoveRequest.java | 6 --
.../oa/wedrive/WxCpFileUploadRequest.java | 3 -
.../cp/api/WxCpOaWeDriveServiceTest.java | 6 +-
8 files changed, 60 insertions(+), 80 deletions(-)
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpOaWeDriveService.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpOaWeDriveService.java
index ad2dc635fc..8c3efbc1ab 100644
--- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpOaWeDriveService.java
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpOaWeDriveService.java
@@ -9,7 +9,7 @@
/**
* 企业微信微盘相关接口.
- * https://developer.work.weixin.qq.com/document/path/93654
+ * ...
*
* @author Wang_Wong created on 2022-04-22
*/
@@ -20,7 +20,7 @@ public interface WxCpOaWeDriveService {
* 该接口用于在微盘内新建空间,可以指定人创建空间。
*
* 请求方式:POST(HTTPS)
- * 请求地址: https://qyapi.weixin.qq.com/cgi-bin/wedrive/space_create?access_token=ACCESS_TOKEN
+ * 请求地址: ...
*
* @param request 新建空间对应请求参数
* @return spaceid (空间id)
@@ -33,7 +33,7 @@ public interface WxCpOaWeDriveService {
* 该接口用于重命名已有空间,接收userid参数,以空间管理员身份来重命名。
*
* 请求方式:POST(HTTPS)
- * 请求地址: https://qyapi.weixin.qq.com/cgi-bin/wedrive/space_rename?access_token=ACCESS_TOKEN
+ * 请求地址: ...
*
* @param request 重命名空间的请求参数
* @return wx cp base resp
@@ -46,7 +46,7 @@ public interface WxCpOaWeDriveService {
* 该接口用于解散已有空间,需要以空间管理员身份来解散。
*
* 请求方式:POST(HTTPS)
- * 请求地址: https://qyapi.weixin.qq.com/cgi-bin/wedrive/space_dismiss?access_token=ACCESS_TOKEN
+ * 请求地址: ...
*
* @param userId the user id
* @param spaceId the space id
@@ -60,7 +60,7 @@ public interface WxCpOaWeDriveService {
* 该接口用于获取空间成员列表、信息、权限等信息。
*
* 请求方式:POST(HTTPS)
- * 请求地址: https://qyapi.weixin.qq.com/cgi-bin/wedrive/space_info?access_token=ACCESS_TOKEN
+ * 请求地址: ...
*
* @param userId the user id
* @param spaceId the space id
@@ -74,7 +74,7 @@ public interface WxCpOaWeDriveService {
* 该接口用于对指定空间添加成员/部门,可一次性添加多个。
*
* 请求方式:POST(HTTPS)
- * 请求地址: https://qyapi.weixin.qq.com/cgi-bin/wedrive/space_acl_add?access_token=ACCESS_TOKEN
+ * 请求地址: ...
*
* @param request 添加成员/部门请求参数
* @return wx cp base resp
@@ -87,7 +87,7 @@ public interface WxCpOaWeDriveService {
* 该接口用于对指定空间移除成员/部门,操作者需要有移除权限。
*
* 请求方式:POST(HTTPS)
- * 请求地址: https://qyapi.weixin.qq.com/cgi-bin/wedrive/space_acl_del?access_token=ACCESS_TOKEN
+ * 请求地址: ...
*
* @param request 移除成员/部门请求参数
* @return wx cp base resp
@@ -100,7 +100,7 @@ public interface WxCpOaWeDriveService {
* 该接口用于修改空间权限,需要传入userid,修改权限范围继承传入用户的权限范围。
*
* 请求方式:POST(HTTPS)
- * 请求地址: https://qyapi.weixin.qq.com/cgi-bin/wedrive/space_setting?access_token=ACCESS_TOKEN
+ * 请求地址: ...
*
* @param request 权限管理请求参数
* @return wx cp base resp
@@ -113,7 +113,7 @@ public interface WxCpOaWeDriveService {
* 该接口用于获取空间邀请分享链接。
*
* 请求方式:POST(HTTPS)
- * 请求地址: https://qyapi.weixin.qq.com/cgi-bin/wedrive/space_share?access_token=ACCESS_TOKEN
+ * 请求地址: ...
*
* @param userId the user id
* @param spaceId the space id
@@ -127,7 +127,7 @@ public interface WxCpOaWeDriveService {
* 该接口用于获取指定地址下的文件列表。
*
* 请求方式:POST(HTTPS)
- * 请求地址: https://qyapi.weixin.qq.com/cgi-bin/wedrive/file_list?access_token=ACCESS_TOKEN
+ * 请求地址: ...
*
* @param request 获取文件列表请求参数
* @return wx cp file list
@@ -140,7 +140,7 @@ public interface WxCpOaWeDriveService {
* 该接口用于向微盘中的指定位置上传文件。
*
* 请求方式:POST(HTTPS)
- * 请求地址: https://qyapi.weixin.qq.com/cgi-bin/wedrive/file_upload?access_token=ACCESS_TOKEN
+ * 请求地址: ...
*
* @param request 上传文件请求参数
* @return wx cp file upload
@@ -153,54 +153,58 @@ public interface WxCpOaWeDriveService {
* 该接口用于下载文件,请求的userid需有下载权限。
*
* 请求方式:POST(HTTPS)
- * 请求地址: https://qyapi.weixin.qq.com/cgi-bin/wedrive/file_download?access_token=ACCESS_TOKEN
+ * 请求地址: ...
*
- * @param userId the user id
- * @param fileId the file id
- * @return wx cp file download
+ * @param fileId 文件fileid(只支持下载普通文件,不支持下载文件夹或微文档)
+ * @param selectedTicket 微盘和文件选择器jsapi返回的selectedTicket。若填此参数,则不需要填fileid。
+ * @return {
+ * "errcode": 0,
+ * "errmsg": "ok",
+ * "download_url": "DOWNLOAD_URL",
+ * "cookie_name": "COOKIE_NAME",
+ * "cookie_value": "COOKIE_VALUE"
+ * }
* @throws WxErrorException the wx error exception
*/
- WxCpFileDownload fileDownload(@NonNull String userId, @NonNull String fileId) throws WxErrorException;
+ WxCpFileDownload fileDownload( String fileId, String selectedTicket) throws WxErrorException;
/**
* 重命名文件
* 该接口用于对指定文件进行重命名。
*
* 请求方式:POST(HTTPS)
- * 请求地址: https://qyapi.weixin.qq.com/cgi-bin/wedrive/file_rename?access_token=ACCESS_TOKEN
+ * 请求地址: ...
*
- * @param userId the user id
* @param fileId the file id
* @param newName the new name
* @return wx cp file rename
* @throws WxErrorException the wx error exception
*/
- WxCpFileRename fileRename(@NonNull String userId, @NonNull String fileId, @NonNull String newName) throws WxErrorException;
+ WxCpFileRename fileRename(@NonNull String fileId, @NonNull String newName) throws WxErrorException;
/**
- * 新建文件/微文档
- * 该接口用于在微盘指定位置新建文件、微文档。
+ * 新建文件夹/文档
+ * 该接口用于在微盘指定位置新建文件夹、文档(更多文档接口能力可见文档API接口说明)。
*
* 请求方式:POST(HTTPS)
- * 请求地址: https://qyapi.weixin.qq.com/cgi-bin/wedrive/file_create?access_token=ACCESS_TOKEN
+ * 请求地址: ...
*
- * @param userId 操作者userid
* @param spaceId 空间spaceid
* @param fatherId 父目录fileid, 在根目录时为空间spaceid
- * @param fileType 文件类型, 1:文件夹 3:微文档(文档) 4:微文档(表格)
- * @param fileName 文件名字
+ * @param fileType 文件类型, 1:文件夹 3:文档(文档) 4:文档(表格)
+ * @param fileName 文件名字(注意:文件名最多填255个字符, 英文算1个, 汉字算2个)
* @return wx cp file create
* @throws WxErrorException the wx error exception
*/
- WxCpFileCreate fileCreate(@NonNull String userId, @NonNull String spaceId,
- @NonNull String fatherId, @NonNull Integer fileType, @NonNull String fileName) throws WxErrorException;
+ WxCpFileCreate fileCreate(@NonNull String spaceId, @NonNull String fatherId, @NonNull Integer fileType,
+ @NonNull String fileName) throws WxErrorException;
/**
* 移动文件
* 该接口用于将文件移动到指定位置。
*
* 请求方式:POST(HTTPS)
- * 请求地址: https://qyapi.weixin.qq.com/cgi-bin/wedrive/file_move?access_token=ACCESS_TOKEN
+ * 请求地址: ...
*
* @param request 移动文件的请求参数
* @return wx cp file move
@@ -213,21 +217,33 @@ WxCpFileCreate fileCreate(@NonNull String userId, @NonNull String spaceId,
* 该接口用于删除指定文件。
*
* 请求方式:POST(HTTPS)
- * 请求地址: https://qyapi.weixin.qq.com/cgi-bin/wedrive/file_delete?access_token=ACCESS_TOKEN
+ * 请求地址: ...
*
- * @param userId 操作者userid
- * @param fileId 文件fileid列表
+ * @param fileIds 文件fileid列表
* @return wx cp base resp
* @throws WxErrorException the wx error exception
*/
- WxCpBaseResp fileDelete(@NonNull String userId, @NonNull List fileId) throws WxErrorException;
+ WxCpBaseResp fileDelete(@NonNull List fileIds) throws WxErrorException;
+
+ /**
+ * 文件信息
+ * 该接口用于获取指定文件的信息。
+ *
+ * 请求方式:POST(HTTPS)
+ * 请求地址: ...
+ *
+ * @param fileId the file id
+ * @return wx cp file info
+ * @throws WxErrorException the wx error exception
+ */
+ WxCpFileInfo fileInfo(@NonNull String fileId) throws WxErrorException;
/**
* 新增指定人
* 该接口用于对指定文件添加指定人/部门。
*
* 请求方式:POST(HTTPS)
- * 请求地址: https://qyapi.weixin.qq.com/cgi-bin/wedrive/file_acl_add?access_token=ACCESS_TOKEN
+ * 请求地址: ...
*
* @param request 新增指定人请求参数
* @return wx cp base resp
@@ -240,7 +256,7 @@ WxCpFileCreate fileCreate(@NonNull String userId, @NonNull String spaceId,
* 该接口用于删除指定文件的指定人/部门。
*
* 请求方式:POST(HTTPS)
- * 请求地址: https://qyapi.weixin.qq.com/cgi-bin/wedrive/file_acl_del?access_token=ACCESS_TOKEN
+ * 请求地址: ...
*
* @param request 请求参数
* @return wx cp base resp
@@ -253,7 +269,7 @@ WxCpFileCreate fileCreate(@NonNull String userId, @NonNull String spaceId,
* 该接口用于文件的分享设置。
*
* 请求方式:POST(HTTPS)
- * 请求地址: https://qyapi.weixin.qq.com/cgi-bin/wedrive/file_setting?access_token=ACCESS_TOKEN
+ * 请求地址: ...
*
* @param userId the user id
* @param fileId the file id
@@ -269,7 +285,7 @@ WxCpFileCreate fileCreate(@NonNull String userId, @NonNull String spaceId,
* 该接口用于获取文件的分享链接。
*
* 请求方式:POST(HTTPS)
- * 请求地址: https://qyapi.weixin.qq.com/cgi-bin/wedrive/file_share?access_token=ACCESS_TOKEN
+ * 请求地址: ...
*
* @param userId the user id
* @param fileId the file id
@@ -278,18 +294,4 @@ WxCpFileCreate fileCreate(@NonNull String userId, @NonNull String spaceId,
*/
WxCpFileShare fileShare(@NonNull String userId, @NonNull String fileId) throws WxErrorException;
- /**
- * 文件信息
- * 该接口用于获取指定文件的信息。
- *
- * 请求方式:POST(HTTPS)
- * 请求地址: https://qyapi.weixin.qq.com/cgi-bin/wedrive/file_info?access_token=ACCESS_TOKEN
- *
- * @param userId the user id
- * @param fileId the file id
- * @return wx cp file info
- * @throws WxErrorException the wx error exception
- */
- WxCpFileInfo fileInfo(@NonNull String userId, @NonNull String fileId) throws WxErrorException;
-
}
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpOaWeDriveServiceImpl.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpOaWeDriveServiceImpl.java
index 979e86e55f..597851aae4 100644
--- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpOaWeDriveServiceImpl.java
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpOaWeDriveServiceImpl.java
@@ -114,10 +114,9 @@ public WxCpFileDownload fileDownload(@NonNull String userId, @NonNull String fil
}
@Override
- public WxCpFileRename fileRename(@NonNull String userId, @NonNull String fileId, @NonNull String newName) throws WxErrorException {
+ public WxCpFileRename fileRename(@NonNull String fileId, @NonNull String newName) throws WxErrorException {
String apiUrl = this.cpService.getWxCpConfigStorage().getApiUrl(FILE_RENAME);
JsonObject jsonObject = new JsonObject();
- jsonObject.addProperty("userid", userId);
jsonObject.addProperty("fileid", fileId);
jsonObject.addProperty("new_name", newName);
String responseContent = this.cpService.post(apiUrl, jsonObject.toString());
@@ -125,11 +124,10 @@ public WxCpFileRename fileRename(@NonNull String userId, @NonNull String fileId,
}
@Override
- public WxCpFileCreate fileCreate(@NonNull String userId, @NonNull String spaceId, @NonNull String fatherId,
+ public WxCpFileCreate fileCreate(@NonNull String spaceId, @NonNull String fatherId,
@NonNull Integer fileType, @NonNull String fileName) throws WxErrorException {
String apiUrl = this.cpService.getWxCpConfigStorage().getApiUrl(FILE_CREATE);
JsonObject jsonObject = new JsonObject();
- jsonObject.addProperty("userid", userId);
jsonObject.addProperty("spaceid", spaceId);
jsonObject.addProperty("fatherid", fatherId);
jsonObject.addProperty("file_type", fileType);
@@ -146,9 +144,9 @@ public WxCpFileMove fileMove(@NonNull WxCpFileMoveRequest request) throws WxErro
}
@Override
- public WxCpBaseResp fileDelete(@NonNull String userId, @NonNull List fileId) throws WxErrorException {
+ public WxCpBaseResp fileDelete(@NonNull List fileIds) throws WxErrorException {
String apiUrl = this.cpService.getWxCpConfigStorage().getApiUrl(FILE_DELETE);
- WxCpFileDeleteRequest request = new WxCpFileDeleteRequest(userId, fileId);
+ WxCpFileDeleteRequest request = new WxCpFileDeleteRequest(fileIds);
String responseContent = this.cpService.post(apiUrl, request.toJson());
return WxCpBaseResp.fromJson(responseContent);
}
@@ -193,10 +191,9 @@ public WxCpFileShare fileShare(@NonNull String userId, @NonNull String fileId) t
}
@Override
- public WxCpFileInfo fileInfo(@NonNull String userId, @NonNull String fileId) throws WxErrorException {
+ public WxCpFileInfo fileInfo(@NonNull String fileId) throws WxErrorException {
String apiUrl = this.cpService.getWxCpConfigStorage().getApiUrl(FILE_INFO);
JsonObject jsonObject = new JsonObject();
- jsonObject.addProperty("userid", userId);
jsonObject.addProperty("fileid", fileId);
String responseContent = this.cpService.post(apiUrl, jsonObject.toString());
return WxCpFileInfo.fromJson(responseContent);
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/wedrive/WxCpFileDeleteRequest.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/wedrive/WxCpFileDeleteRequest.java
index bb740f3935..3b95629cc6 100644
--- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/wedrive/WxCpFileDeleteRequest.java
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/wedrive/WxCpFileDeleteRequest.java
@@ -22,9 +22,6 @@
public class WxCpFileDeleteRequest implements Serializable {
private static final long serialVersionUID = -4960239393895754138L;
- @SerializedName("userid")
- private String userId;
-
@SerializedName("fileid")
private List fileId;
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/wedrive/WxCpFileDownload.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/wedrive/WxCpFileDownload.java
index 9c2507c681..f52f0ca424 100644
--- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/wedrive/WxCpFileDownload.java
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/wedrive/WxCpFileDownload.java
@@ -35,8 +35,4 @@ public static WxCpFileDownload fromJson(String json) {
return WxCpGsonBuilder.create().fromJson(json, WxCpFileDownload.class);
}
- public String toJson() {
- return WxCpGsonBuilder.create().toJson(this);
- }
-
}
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/wedrive/WxCpFileListRequest.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/wedrive/WxCpFileListRequest.java
index 1855c1a0da..890f35d364 100644
--- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/wedrive/WxCpFileListRequest.java
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/wedrive/WxCpFileListRequest.java
@@ -21,9 +21,6 @@
public class WxCpFileListRequest implements Serializable {
private static final long serialVersionUID = -4960239393895754138L;
- @SerializedName("userid")
- private String userId;
-
@SerializedName("spaceid")
private String spaceId;
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/wedrive/WxCpFileMoveRequest.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/wedrive/WxCpFileMoveRequest.java
index 5802e3c276..58460067bc 100644
--- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/wedrive/WxCpFileMoveRequest.java
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/wedrive/WxCpFileMoveRequest.java
@@ -21,12 +21,6 @@
public class WxCpFileMoveRequest implements Serializable {
private static final long serialVersionUID = -4960239393895754138L;
- /**
- * 操作者userid
- */
- @SerializedName("userid")
- private String userId;
-
/**
* 如果移动到的目标目录与需要移动的文件重名时,是否覆盖。
* true:重名文件覆盖
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/wedrive/WxCpFileUploadRequest.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/wedrive/WxCpFileUploadRequest.java
index 7a107562bb..d6ffe7b11c 100644
--- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/wedrive/WxCpFileUploadRequest.java
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/wedrive/WxCpFileUploadRequest.java
@@ -21,9 +21,6 @@
public class WxCpFileUploadRequest implements Serializable {
private static final long serialVersionUID = -4960239393895754138L;
- @SerializedName("userid")
- private String userId;
-
@SerializedName("spaceid")
private String spaceId;
diff --git a/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/WxCpOaWeDriveServiceTest.java b/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/WxCpOaWeDriveServiceTest.java
index dc1c458734..365741c328 100644
--- a/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/WxCpOaWeDriveServiceTest.java
+++ b/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/WxCpOaWeDriveServiceTest.java
@@ -110,13 +110,13 @@ public void test() throws Exception {
*/
ArrayList fileIds = Lists.newArrayList();
fileIds.add(fileId);
- WxCpBaseResp fileDelete = cpService.getOaWeDriveService().fileDelete(uId, fileIds);
+ WxCpBaseResp fileDelete = cpService.getOaWeDriveService().fileDelete(fileIds);
log.info("删除文件数据为:{}", fileDelete.toJson());
/**
* 文件信息
*/
- WxCpFileInfo fileInfo = cpService.getOaWeDriveService().fileInfo(uId, fileId);
+ WxCpFileInfo fileInfo = cpService.getOaWeDriveService().fileInfo(fileId);
log.info("fileInfo数据为:{}", fileInfo.toJson());
/**
@@ -134,7 +134,7 @@ public void test() throws Exception {
/**
* 新建文件/微文档
*/
- WxCpFileCreate fileCreate = cpService.getOaWeDriveService().fileCreate(uId, spId, spId, 3, "新建微文档1");
+ WxCpFileCreate fileCreate = cpService.getOaWeDriveService().fileCreate(spId, spId, 3, "新建微文档1");
log.info("新建文件/微文档:{}", fileCreate.toJson());
/**
From 7494de9d4f90c0f0a9df5940fdd20b2dafb7d478 Mon Sep 17 00:00:00 2001
From: Binary Wang
Date: Sat, 14 Dec 2024 00:30:42 +0800
Subject: [PATCH 016/326] =?UTF-8?q?:art:=20#3438=20=E3=80=90=E4=BC=81?=
=?UTF-8?q?=E4=B8=9A=E5=BE=AE=E4=BF=A1=E3=80=91=E7=AC=AC=E4=B8=89=E6=96=B9?=
=?UTF-8?q?=E5=BA=94=E7=94=A8=E5=BC=80=E5=8F=91=E8=8E=B7=E5=8F=96=E7=99=BB?=
=?UTF-8?q?=E5=BD=95/=E8=AE=BF=E9=97=AE=E7=94=A8=E6=88=B7=E8=BA=AB?=
=?UTF-8?q?=E4=BB=BD=E6=8E=A5=E5=8F=A3=E8=BF=94=E5=9B=9E=E5=AD=97=E6=AE=B5?=
=?UTF-8?q?=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../weixin/cp/bean/WxCpTpUserInfo.java | 23 ++++++++-----------
.../weixin/cp/tp/service/WxCpTpService.java | 4 +++-
2 files changed, 12 insertions(+), 15 deletions(-)
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpUserInfo.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpUserInfo.java
index c6664fd0ab..9837acff36 100644
--- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpUserInfo.java
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpUserInfo.java
@@ -13,31 +13,24 @@
@Data
@EqualsAndHashCode(callSuper = true)
public class WxCpTpUserInfo extends WxCpBaseResp {
-
private static final long serialVersionUID = -5028321625140879571L;
/**
* 用户所属企业的corpid
*/
- @SerializedName("CorpId")
+ @SerializedName("corpid")
private String corpId;
/**
* 用户在企业内的UserID,如果该企业与第三方应用有授权关系时,返回明文UserId,否则返回密文UserId
*/
- @SerializedName("UserId")
+ @SerializedName("userid")
private String userId;
- /**
- * 手机设备号(由企业微信在安装时随机生成,删除重装会改变,升级不受影响)
- */
- @SerializedName("DeviceId")
- private String deviceId;
-
/**
* 成员票据,最大为512字节。
* scope为snsapi_userinfo或snsapi_privateinfo,且用户在应用可见范围之内时返回此参数。
- * 后续利用该参数可以获取用户信息或敏感信息,参见:https://work.weixin.qq.com/api/doc/90001/90143/91122
+ * 后续利用该参数可以获取用户信息或敏感信息,参见:...
*/
@SerializedName("user_ticket")
private String userTicket;
@@ -54,6 +47,12 @@ public class WxCpTpUserInfo extends WxCpBaseResp {
@SerializedName("open_userid")
private String openUserId;
+ /**
+ 非企业成员的标识,对当前服务商唯一
+ */
+ @SerializedName("openid")
+ private String openid;
+
/**
* From json wx cp tp user info.
*
@@ -64,8 +63,4 @@ public static WxCpTpUserInfo fromJson(String json) {
return WxCpGsonBuilder.create().fromJson(json, WxCpTpUserInfo.class);
}
- public String toJson() {
- return WxCpGsonBuilder.create().toJson(this);
- }
-
}
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/tp/service/WxCpTpService.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/tp/service/WxCpTpService.java
index 286f2e9673..5c433c0b49 100644
--- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/tp/service/WxCpTpService.java
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/tp/service/WxCpTpService.java
@@ -371,7 +371,9 @@ public interface WxCpTpService {
/**
*
- * 获取访问用户身份
+ * 获取登录/访问用户身份
+ * 1、网页授权登录对应的文档
+ * 2、企业微信web登录对应的文档
*
*
* @param code the code
From d3f6023d2ce8ce48393759662ee851276c32eab1 Mon Sep 17 00:00:00 2001
From: Binary Wang
Date: Sat, 14 Dec 2024 00:45:24 +0800
Subject: [PATCH 017/326] =?UTF-8?q?:art=EF=BC=9A=20=E4=BC=98=E5=8C=96?=
=?UTF-8?q?=E9=83=A8=E5=88=86javadoc=E6=96=87=E6=A1=A3=E5=92=8C=E5=8D=95?=
=?UTF-8?q?=E5=85=83=E6=B5=8B=E8=AF=95=E4=BB=A3=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
README.md | 6 +-
.../tp/service/WxCpTpDepartmentService.java | 10 +--
.../cp/api/WxCpOaWeDriveServiceTest.java | 61 +++++++++----------
3 files changed, 37 insertions(+), 40 deletions(-)
diff --git a/README.md b/README.md
index ebd8a852c7..c61c8d48da 100644
--- a/README.md
+++ b/README.md
@@ -1,10 +1,10 @@
## WxJava - 微信开发 Java SDK
[](https://gitee.com/binary/weixin-java-tools)
-[](https://github.com/binarywang/WxJava)
-[](https://github.com/binarywang/WxJava/releases)
+[](https://github.com/binarywang/WxJava)
+[](https://github.com/binarywang/WxJava/releases)
[](http://mvnrepository.com/artifact/com.github.binarywang/wx-java)
-[](https://circleci.com/gh/Wechat-Group/WxJava/tree/develop)
+[](https://circleci.com/gh/binarywang/WxJava/tree/develop)
[](https://www.jetbrains.com/?from=WxJava-weixin-java-tools)
[](https://opensource.org/licenses/Apache-2.0)
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/tp/service/WxCpTpDepartmentService.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/tp/service/WxCpTpDepartmentService.java
index 8cbd17d6de..706add84aa 100644
--- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/tp/service/WxCpTpDepartmentService.java
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/tp/service/WxCpTpDepartmentService.java
@@ -17,7 +17,7 @@ public interface WxCpTpDepartmentService {
*
* 部门管理接口 - 创建部门.
* 最多支持创建500个部门
- * 详情请见: https://work.weixin.qq.com/api/doc#90000/90135/90205
+ * 详情请见: ...
*
*
* @param depart 部门
@@ -29,7 +29,7 @@ public interface WxCpTpDepartmentService {
/**
*
* 部门管理接口 - 获取部门列表.
- * 详情请见: https://work.weixin.qq.com/api/doc#90000/90135/90208
+ * 详情请见: ...
*
*
* @param id 部门id。获取指定部门及其下的子部门。非必需,可为null
@@ -42,7 +42,7 @@ public interface WxCpTpDepartmentService {
/**
*
* 部门管理接口 - 更新部门.
- * 详情请见: https://work.weixin.qq.com/api/doc#90000/90135/90206
+ * 详情请见: ...
* 如果id为0(未部门),1(黑名单),2(星标组),或者不存在的id,微信会返回系统繁忙的错误
*
*
@@ -54,7 +54,7 @@ public interface WxCpTpDepartmentService {
/**
*
* 部门管理接口 - 删除部门.
- * 详情请见: https://work.weixin.qq.com/api/doc#90000/90135/90207
+ * 详情请见: ...
* 应用须拥有指定部门的管理权限
*
*
@@ -66,7 +66,7 @@ public interface WxCpTpDepartmentService {
/**
*
* 部门管理接口 - 获取部门列表.
- * 详情请见: https://work.weixin.qq.com/api/doc#90000/90135/90208
+ * 详情请见: ...
*
*
* @param corpId the corp id
diff --git a/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/WxCpOaWeDriveServiceTest.java b/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/WxCpOaWeDriveServiceTest.java
index 365741c328..bd7599061d 100644
--- a/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/WxCpOaWeDriveServiceTest.java
+++ b/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/WxCpOaWeDriveServiceTest.java
@@ -56,19 +56,19 @@ public void test() throws Exception {
String fileId2 = "s.ww45d3e188865aca30.652091685u4h_f.652696024TU4P";
- /**
+ /*
* 获取分享链接
*/
WxCpFileShare fileShare = cpService.getOaWeDriveService().fileShare(uId, fileId2);
log.info("获取分享链接返回结果为:{}", fileShare.toJson());
- /**
+ /*
* 分享设置
*/
WxCpBaseResp fileSetting = cpService.getOaWeDriveService().fileSetting(uId, fileId2, 2, 1);
log.info("分享设置返回结果为:{}", fileSetting.toJson());
- /**
+ /*
* 删除指定人
*/
WxCpFileAclDelRequest aclDelRequest = new WxCpFileAclDelRequest();
@@ -87,7 +87,7 @@ public void test() throws Exception {
WxCpBaseResp aclDel = cpService.getOaWeDriveService().fileAclDel(aclDelRequest);
log.info("删除指定人返回结果为:{}", aclDel.toJson());
- /**
+ /*
* 新增指定人
*/
WxCpFileAclAddRequest fileAclAdd = new WxCpFileAclAddRequest();
@@ -105,7 +105,7 @@ public void test() throws Exception {
WxCpBaseResp result = cpService.getOaWeDriveService().fileAclAdd(fileAclAdd);
log.info("返回结果为:{}", result.toJson());
- /**
+ /*
* 删除文件
*/
ArrayList fileIds = Lists.newArrayList();
@@ -113,17 +113,16 @@ public void test() throws Exception {
WxCpBaseResp fileDelete = cpService.getOaWeDriveService().fileDelete(fileIds);
log.info("删除文件数据为:{}", fileDelete.toJson());
- /**
- * 文件信息
+ /*
+ 文件信息
*/
WxCpFileInfo fileInfo = cpService.getOaWeDriveService().fileInfo(fileId);
log.info("fileInfo数据为:{}", fileInfo.toJson());
- /**
- * 移动文件
+ /*
+ 移动文件
*/
WxCpFileMoveRequest fileMoveRequest = new WxCpFileMoveRequest();
- fileMoveRequest.setUserId(uId);
fileMoveRequest.setFatherId(spId);
fileMoveRequest.setReplace(true);
fileMoveRequest.setFileId(new String[]{fileId});
@@ -131,23 +130,22 @@ public void test() throws Exception {
WxCpFileMove fileMove = cpService.getOaWeDriveService().fileMove(fileMoveRequest);
log.info("fileMove数据为:{}", fileMove.toJson());
- /**
- * 新建文件/微文档
+ /*
+ 新建文件/微文档
*/
WxCpFileCreate fileCreate = cpService.getOaWeDriveService().fileCreate(spId, spId, 3, "新建微文档1");
log.info("新建文件/微文档:{}", fileCreate.toJson());
- /**
- * 下载文件
+ /*
+ 下载文件
*/
WxCpFileDownload fileDownload = cpService.getOaWeDriveService().fileDownload(uId, fileId);
log.info("下载文件为:{}", fileDownload.toJson());
- /**
- * 上传文件
+ /*
+ 上传文件
*/
WxCpFileUploadRequest fileUploadRequest = new WxCpFileUploadRequest();
- fileUploadRequest.setUserId(uId);
fileUploadRequest.setSpaceId(spId);
fileUploadRequest.setFatherId(spId);
fileUploadRequest.setFileName("第一个文件");
@@ -165,17 +163,16 @@ public void test() throws Exception {
WxCpFileUpload fileUpload = cpService.getOaWeDriveService().fileUpload(fileUploadRequest);
log.info("上传文件为:{}", fileUpload.toJson());
- /**
- * 重命名文件
+ /*
+ 重命名文件
*/
- WxCpFileRename fileRename = cpService.getOaWeDriveService().fileRename(uId, fileUpload.getFileId(), "新的名字呢");
+ WxCpFileRename fileRename = cpService.getOaWeDriveService().fileRename(fileUpload.getFileId(), "新的名字呢");
log.info("重命名文件:{}", fileRename.toJson());
- /**
- * 获取文件列表
+ /*
+ 获取文件列表
*/
WxCpFileListRequest fileListRequest = new WxCpFileListRequest();
- fileListRequest.setUserId(uId);
fileListRequest.setSpaceId(spId);
fileListRequest.setFatherId(spId);
fileListRequest.setSortType(1);
@@ -185,7 +182,7 @@ public void test() throws Exception {
WxCpFileList fileList = cpService.getOaWeDriveService().fileList(fileListRequest);
log.info("获取文件列表为:{}", fileList.toJson());
- /**
+ /*
* 权限管理
*/
WxCpSpaceSettingRequest spaceSettingRequest = new WxCpSpaceSettingRequest();
@@ -200,19 +197,19 @@ public void test() throws Exception {
WxCpBaseResp spaceSetting = cpService.getOaWeDriveService().spaceSetting(spaceSettingRequest);
log.info("权限管理信息为:{}", spaceSetting.toJson());
- /**
+ /*
* 获取邀请链接
*/
WxCpSpaceShare spaceShare = cpService.getOaWeDriveService().spaceShare(uId, spId);
log.info("获取邀请链接信息为:{}", spaceShare.toJson());
- /**
+ /*
* 获取空间信息
*/
WxCpSpaceInfo data = cpService.getOaWeDriveService().spaceInfo(uId, spId);
log.info("获取空间信息为:{}", data.toJson());
- /**
+ /*
* 移除成员/部门
*/
WxCpSpaceAclDelRequest spaceAclDelRequest = new WxCpSpaceAclDelRequest();
@@ -231,7 +228,7 @@ public void test() throws Exception {
WxCpBaseResp spaceAclDel = cpService.getOaWeDriveService().spaceAclDel(spaceAclDelRequest);
log.info("移除成员/部门,返回数据为:{}", spaceAclDel.toJson());
- /**
+ /*
* 添加成员/部门
* https://developer.work.weixin.qq.com/document/path/93656
*/
@@ -252,13 +249,13 @@ public void test() throws Exception {
WxCpBaseResp wxCpBaseResp = cpService.getOaWeDriveService().spaceAclAdd(spaceAclAddRequest);
log.info("添加成员/部门,返回数据为:{}", wxCpBaseResp.toJson());
- /**
+ /*
* 获取空间信息
*/
WxCpSpaceInfo spaceInfo = cpService.getOaWeDriveService().spaceInfo("WangKai", "s.ww45d3e188865aca30.652091685u4h");
log.info("获取空间信息,spaceInfo信息为:{}", spaceInfo.toJson());
- /**
+ /*
* 新建空间
*/
WxCpSpaceCreateRequest request = new WxCpSpaceCreateRequest();
@@ -269,7 +266,7 @@ public void test() throws Exception {
log.info("空间id为:{}", spaceCreateData.getSpaceId()); //
log.info(spaceCreateData.toJson());
- /**
+ /*
* 重命名空间
*/
WxCpSpaceRenameRequest wxCpSpaceRenameRequest = new WxCpSpaceRenameRequest();
@@ -279,7 +276,7 @@ public void test() throws Exception {
WxCpBaseResp baseResp = cpService.getOaWeDriveService().spaceRename(wxCpSpaceRenameRequest);
log.info("重命名成功:{}", baseResp.toJson());
- /**
+ /*
* 解散空间
*/
WxCpBaseResp thisResp = cpService.getOaWeDriveService().spaceDismiss("WangKai", spaceCreateData.getSpaceId());
From 6af301de58ead04daaea4f00c85f086613779f8c Mon Sep 17 00:00:00 2001
From: Binary Wang
Date: Sat, 14 Dec 2024 01:08:11 +0800
Subject: [PATCH 018/326] =?UTF-8?q?:bookmark:=20=E5=8F=91=E5=B8=83=204.6.9?=
=?UTF-8?q?.B=20=E6=B5=8B=E8=AF=95=E7=89=88=E6=9C=AC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pom.xml | 2 +-
solon-plugins/pom.xml | 2 +-
solon-plugins/wx-java-channel-multi-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-channel-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-cp-multi-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-cp-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-miniapp-multi-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-miniapp-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-mp-multi-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-mp-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-open-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-pay-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-qidian-solon-plugin/pom.xml | 2 +-
spring-boot-starters/pom.xml | 2 +-
.../wx-java-channel-multi-spring-boot-starter/pom.xml | 2 +-
.../wx-java-channel-spring-boot-starter/pom.xml | 2 +-
.../wx-java-cp-multi-spring-boot-starter/pom.xml | 2 +-
spring-boot-starters/wx-java-cp-spring-boot-starter/pom.xml | 2 +-
.../wx-java-miniapp-multi-spring-boot-starter/pom.xml | 2 +-
.../wx-java-miniapp-spring-boot-starter/pom.xml | 2 +-
.../wx-java-mp-multi-spring-boot-starter/pom.xml | 2 +-
spring-boot-starters/wx-java-mp-spring-boot-starter/pom.xml | 2 +-
spring-boot-starters/wx-java-open-spring-boot-starter/pom.xml | 2 +-
spring-boot-starters/wx-java-pay-spring-boot-starter/pom.xml | 2 +-
spring-boot-starters/wx-java-qidian-spring-boot-starter/pom.xml | 2 +-
weixin-graal/pom.xml | 2 +-
weixin-java-channel/pom.xml | 2 +-
weixin-java-common/pom.xml | 2 +-
weixin-java-cp/pom.xml | 2 +-
weixin-java-miniapp/pom.xml | 2 +-
weixin-java-mp/pom.xml | 2 +-
weixin-java-open/pom.xml | 2 +-
weixin-java-pay/pom.xml | 2 +-
weixin-java-qidian/pom.xml | 2 +-
34 files changed, 34 insertions(+), 34 deletions(-)
diff --git a/pom.xml b/pom.xml
index 70f32b776d..af8ba086c3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -3,7 +3,7 @@
4.0.0
com.github.binarywang
wx-java
- 4.6.8.B
+ 4.6.9.B
pom
WxJava - Weixin/Wechat Java SDK
微信开发Java SDK
diff --git a/solon-plugins/pom.xml b/solon-plugins/pom.xml
index d6883a2dc0..81985dbad2 100644
--- a/solon-plugins/pom.xml
+++ b/solon-plugins/pom.xml
@@ -6,7 +6,7 @@
com.github.binarywang
wx-java
- 4.6.8.B
+ 4.6.9.B
pom
wx-java-solon-plugins
diff --git a/solon-plugins/wx-java-channel-multi-solon-plugin/pom.xml b/solon-plugins/wx-java-channel-multi-solon-plugin/pom.xml
index e16c3f7f23..f437adcca9 100644
--- a/solon-plugins/wx-java-channel-multi-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-channel-multi-solon-plugin/pom.xml
@@ -5,7 +5,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.6.8.B
+ 4.6.9.B
4.0.0
diff --git a/solon-plugins/wx-java-channel-solon-plugin/pom.xml b/solon-plugins/wx-java-channel-solon-plugin/pom.xml
index d27c59e66a..025da0efd6 100644
--- a/solon-plugins/wx-java-channel-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-channel-solon-plugin/pom.xml
@@ -3,7 +3,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.6.8.B
+ 4.6.9.B
4.0.0
diff --git a/solon-plugins/wx-java-cp-multi-solon-plugin/pom.xml b/solon-plugins/wx-java-cp-multi-solon-plugin/pom.xml
index 9a9d66b49f..58c4107d61 100644
--- a/solon-plugins/wx-java-cp-multi-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-cp-multi-solon-plugin/pom.xml
@@ -4,7 +4,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.6.8.B
+ 4.6.9.B
4.0.0
diff --git a/solon-plugins/wx-java-cp-solon-plugin/pom.xml b/solon-plugins/wx-java-cp-solon-plugin/pom.xml
index fe183424b3..e73ddd62e6 100644
--- a/solon-plugins/wx-java-cp-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-cp-solon-plugin/pom.xml
@@ -4,7 +4,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.6.8.B
+ 4.6.9.B
4.0.0
diff --git a/solon-plugins/wx-java-miniapp-multi-solon-plugin/pom.xml b/solon-plugins/wx-java-miniapp-multi-solon-plugin/pom.xml
index d11cda057d..f4ae20c457 100644
--- a/solon-plugins/wx-java-miniapp-multi-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-miniapp-multi-solon-plugin/pom.xml
@@ -5,7 +5,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.6.8.B
+ 4.6.9.B
4.0.0
diff --git a/solon-plugins/wx-java-miniapp-solon-plugin/pom.xml b/solon-plugins/wx-java-miniapp-solon-plugin/pom.xml
index a7e25ac592..d05d28be2f 100644
--- a/solon-plugins/wx-java-miniapp-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-miniapp-solon-plugin/pom.xml
@@ -4,7 +4,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.6.8.B
+ 4.6.9.B
4.0.0
diff --git a/solon-plugins/wx-java-mp-multi-solon-plugin/pom.xml b/solon-plugins/wx-java-mp-multi-solon-plugin/pom.xml
index 88901855a4..dbfafa8ebd 100644
--- a/solon-plugins/wx-java-mp-multi-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-mp-multi-solon-plugin/pom.xml
@@ -5,7 +5,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.6.8.B
+ 4.6.9.B
4.0.0
diff --git a/solon-plugins/wx-java-mp-solon-plugin/pom.xml b/solon-plugins/wx-java-mp-solon-plugin/pom.xml
index 89de01770c..1a07cf0bcc 100644
--- a/solon-plugins/wx-java-mp-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-mp-solon-plugin/pom.xml
@@ -5,7 +5,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.6.8.B
+ 4.6.9.B
4.0.0
diff --git a/solon-plugins/wx-java-open-solon-plugin/pom.xml b/solon-plugins/wx-java-open-solon-plugin/pom.xml
index c4303cf8f7..bb777597b8 100644
--- a/solon-plugins/wx-java-open-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-open-solon-plugin/pom.xml
@@ -5,7 +5,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.6.8.B
+ 4.6.9.B
4.0.0
diff --git a/solon-plugins/wx-java-pay-solon-plugin/pom.xml b/solon-plugins/wx-java-pay-solon-plugin/pom.xml
index 0da704a4c7..ba0363962f 100644
--- a/solon-plugins/wx-java-pay-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-pay-solon-plugin/pom.xml
@@ -5,7 +5,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.6.8.B
+ 4.6.9.B
4.0.0
diff --git a/solon-plugins/wx-java-qidian-solon-plugin/pom.xml b/solon-plugins/wx-java-qidian-solon-plugin/pom.xml
index c49d9ed3ac..abeafebaa8 100644
--- a/solon-plugins/wx-java-qidian-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-qidian-solon-plugin/pom.xml
@@ -3,7 +3,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.6.8.B
+ 4.6.9.B
4.0.0
diff --git a/spring-boot-starters/pom.xml b/spring-boot-starters/pom.xml
index d5a7effae9..370d4e961a 100644
--- a/spring-boot-starters/pom.xml
+++ b/spring-boot-starters/pom.xml
@@ -6,7 +6,7 @@
com.github.binarywang
wx-java
- 4.6.8.B
+ 4.6.9.B
pom
wx-java-spring-boot-starters
diff --git a/spring-boot-starters/wx-java-channel-multi-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-channel-multi-spring-boot-starter/pom.xml
index c2c72bd366..e4eb43cc9c 100644
--- a/spring-boot-starters/wx-java-channel-multi-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-channel-multi-spring-boot-starter/pom.xml
@@ -5,7 +5,7 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.6.8.B
+ 4.6.9.B
4.0.0
diff --git a/spring-boot-starters/wx-java-channel-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-channel-spring-boot-starter/pom.xml
index 68e4ce13c1..2516fb60b1 100644
--- a/spring-boot-starters/wx-java-channel-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-channel-spring-boot-starter/pom.xml
@@ -3,7 +3,7 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.6.8.B
+ 4.6.9.B
4.0.0
diff --git a/spring-boot-starters/wx-java-cp-multi-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-cp-multi-spring-boot-starter/pom.xml
index 6947fb9e04..ebce5599d1 100644
--- a/spring-boot-starters/wx-java-cp-multi-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-cp-multi-spring-boot-starter/pom.xml
@@ -4,7 +4,7 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.6.8.B
+ 4.6.9.B
4.0.0
diff --git a/spring-boot-starters/wx-java-cp-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-cp-spring-boot-starter/pom.xml
index 6449feb3c8..1472037d1d 100644
--- a/spring-boot-starters/wx-java-cp-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-cp-spring-boot-starter/pom.xml
@@ -4,7 +4,7 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.6.8.B
+ 4.6.9.B
4.0.0
diff --git a/spring-boot-starters/wx-java-miniapp-multi-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-miniapp-multi-spring-boot-starter/pom.xml
index 38c1a80d45..78387f26f7 100644
--- a/spring-boot-starters/wx-java-miniapp-multi-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-miniapp-multi-spring-boot-starter/pom.xml
@@ -5,7 +5,7 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.6.8.B
+ 4.6.9.B
4.0.0
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 6983904416..dafad3b2d3 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 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.6.8.B
+ 4.6.9.B
4.0.0
diff --git a/spring-boot-starters/wx-java-mp-multi-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-mp-multi-spring-boot-starter/pom.xml
index 064a4b9d47..0d096e1e57 100644
--- a/spring-boot-starters/wx-java-mp-multi-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-mp-multi-spring-boot-starter/pom.xml
@@ -5,7 +5,7 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.6.8.B
+ 4.6.9.B
4.0.0
diff --git a/spring-boot-starters/wx-java-mp-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-mp-spring-boot-starter/pom.xml
index a784de838c..dfb2f1366a 100644
--- a/spring-boot-starters/wx-java-mp-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-mp-spring-boot-starter/pom.xml
@@ -5,7 +5,7 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.6.8.B
+ 4.6.9.B
4.0.0
diff --git a/spring-boot-starters/wx-java-open-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-open-spring-boot-starter/pom.xml
index 81c3514e81..1dc0371f7d 100644
--- a/spring-boot-starters/wx-java-open-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-open-spring-boot-starter/pom.xml
@@ -5,7 +5,7 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.6.8.B
+ 4.6.9.B
4.0.0
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 b24d3ce7cf..cb75fb32df 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 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.6.8.B
+ 4.6.9.B
4.0.0
diff --git a/spring-boot-starters/wx-java-qidian-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-qidian-spring-boot-starter/pom.xml
index 7d3d7ebb11..fce8c3a04e 100644
--- a/spring-boot-starters/wx-java-qidian-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-qidian-spring-boot-starter/pom.xml
@@ -3,7 +3,7 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.6.8.B
+ 4.6.9.B
4.0.0
diff --git a/weixin-graal/pom.xml b/weixin-graal/pom.xml
index 86bcf85cf7..21f1d786c3 100644
--- a/weixin-graal/pom.xml
+++ b/weixin-graal/pom.xml
@@ -6,7 +6,7 @@
com.github.binarywang
wx-java
- 4.6.8.B
+ 4.6.9.B
weixin-graal
diff --git a/weixin-java-channel/pom.xml b/weixin-java-channel/pom.xml
index 24c87e86e7..ccd6a602ce 100644
--- a/weixin-java-channel/pom.xml
+++ b/weixin-java-channel/pom.xml
@@ -6,7 +6,7 @@
com.github.binarywang
wx-java
- 4.6.8.B
+ 4.6.9.B
weixin-java-channel
diff --git a/weixin-java-common/pom.xml b/weixin-java-common/pom.xml
index f6ebeef34a..b988418013 100644
--- a/weixin-java-common/pom.xml
+++ b/weixin-java-common/pom.xml
@@ -6,7 +6,7 @@
com.github.binarywang
wx-java
- 4.6.8.B
+ 4.6.9.B
weixin-java-common
diff --git a/weixin-java-cp/pom.xml b/weixin-java-cp/pom.xml
index a917f68236..cbe101285e 100644
--- a/weixin-java-cp/pom.xml
+++ b/weixin-java-cp/pom.xml
@@ -7,7 +7,7 @@
com.github.binarywang
wx-java
- 4.6.8.B
+ 4.6.9.B
weixin-java-cp
diff --git a/weixin-java-miniapp/pom.xml b/weixin-java-miniapp/pom.xml
index d0e71512e7..530acda8ae 100644
--- a/weixin-java-miniapp/pom.xml
+++ b/weixin-java-miniapp/pom.xml
@@ -7,7 +7,7 @@
com.github.binarywang
wx-java
- 4.6.8.B
+ 4.6.9.B
weixin-java-miniapp
diff --git a/weixin-java-mp/pom.xml b/weixin-java-mp/pom.xml
index 860654c1b7..90d9e32b6b 100644
--- a/weixin-java-mp/pom.xml
+++ b/weixin-java-mp/pom.xml
@@ -7,7 +7,7 @@
com.github.binarywang
wx-java
- 4.6.8.B
+ 4.6.9.B
weixin-java-mp
diff --git a/weixin-java-open/pom.xml b/weixin-java-open/pom.xml
index 1e8845ecd4..6f36e34779 100644
--- a/weixin-java-open/pom.xml
+++ b/weixin-java-open/pom.xml
@@ -7,7 +7,7 @@
com.github.binarywang
wx-java
- 4.6.8.B
+ 4.6.9.B
weixin-java-open
diff --git a/weixin-java-pay/pom.xml b/weixin-java-pay/pom.xml
index f744e5e643..8351c65690 100644
--- a/weixin-java-pay/pom.xml
+++ b/weixin-java-pay/pom.xml
@@ -5,7 +5,7 @@
com.github.binarywang
wx-java
- 4.6.8.B
+ 4.6.9.B
4.0.0
diff --git a/weixin-java-qidian/pom.xml b/weixin-java-qidian/pom.xml
index 2b713519b5..8928f4815e 100644
--- a/weixin-java-qidian/pom.xml
+++ b/weixin-java-qidian/pom.xml
@@ -7,7 +7,7 @@
com.github.binarywang
wx-java
- 4.6.8.B
+ 4.6.9.B
weixin-java-qidian
From 8707c42eddf05c0eaa0d0fa37ce799c6f760f22d Mon Sep 17 00:00:00 2001
From: Binary Wang
Date: Mon, 30 Dec 2024 22:26:29 +0800
Subject: [PATCH 019/326] =?UTF-8?q?:bookmark:=20=E5=8F=91=E5=B8=83=204.7.0?=
=?UTF-8?q?=20=E6=AD=A3=E5=BC=8F=E7=89=88=E6=9C=AC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pom.xml | 2 +-
solon-plugins/pom.xml | 2 +-
solon-plugins/wx-java-channel-multi-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-channel-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-cp-multi-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-cp-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-miniapp-multi-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-miniapp-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-mp-multi-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-mp-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-open-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-pay-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-qidian-solon-plugin/pom.xml | 2 +-
spring-boot-starters/pom.xml | 2 +-
.../wx-java-channel-multi-spring-boot-starter/pom.xml | 2 +-
.../wx-java-channel-spring-boot-starter/pom.xml | 2 +-
.../wx-java-cp-multi-spring-boot-starter/pom.xml | 2 +-
spring-boot-starters/wx-java-cp-spring-boot-starter/pom.xml | 2 +-
.../wx-java-miniapp-multi-spring-boot-starter/pom.xml | 2 +-
.../wx-java-miniapp-spring-boot-starter/pom.xml | 2 +-
.../wx-java-mp-multi-spring-boot-starter/pom.xml | 2 +-
spring-boot-starters/wx-java-mp-spring-boot-starter/pom.xml | 2 +-
spring-boot-starters/wx-java-open-spring-boot-starter/pom.xml | 2 +-
spring-boot-starters/wx-java-pay-spring-boot-starter/pom.xml | 2 +-
spring-boot-starters/wx-java-qidian-spring-boot-starter/pom.xml | 2 +-
weixin-graal/pom.xml | 2 +-
weixin-java-channel/pom.xml | 2 +-
weixin-java-common/pom.xml | 2 +-
weixin-java-cp/pom.xml | 2 +-
weixin-java-miniapp/pom.xml | 2 +-
weixin-java-mp/pom.xml | 2 +-
weixin-java-open/pom.xml | 2 +-
weixin-java-pay/pom.xml | 2 +-
weixin-java-qidian/pom.xml | 2 +-
34 files changed, 34 insertions(+), 34 deletions(-)
diff --git a/pom.xml b/pom.xml
index af8ba086c3..730f6b5809 100644
--- a/pom.xml
+++ b/pom.xml
@@ -3,7 +3,7 @@
4.0.0
com.github.binarywang
wx-java
- 4.6.9.B
+ 4.7.0
pom
WxJava - Weixin/Wechat Java SDK
微信开发Java SDK
diff --git a/solon-plugins/pom.xml b/solon-plugins/pom.xml
index 81985dbad2..bf956526c8 100644
--- a/solon-plugins/pom.xml
+++ b/solon-plugins/pom.xml
@@ -6,7 +6,7 @@
com.github.binarywang
wx-java
- 4.6.9.B
+ 4.7.0
pom
wx-java-solon-plugins
diff --git a/solon-plugins/wx-java-channel-multi-solon-plugin/pom.xml b/solon-plugins/wx-java-channel-multi-solon-plugin/pom.xml
index f437adcca9..aa9911e115 100644
--- a/solon-plugins/wx-java-channel-multi-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-channel-multi-solon-plugin/pom.xml
@@ -5,7 +5,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.6.9.B
+ 4.7.0
4.0.0
diff --git a/solon-plugins/wx-java-channel-solon-plugin/pom.xml b/solon-plugins/wx-java-channel-solon-plugin/pom.xml
index 025da0efd6..dda371c780 100644
--- a/solon-plugins/wx-java-channel-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-channel-solon-plugin/pom.xml
@@ -3,7 +3,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.6.9.B
+ 4.7.0
4.0.0
diff --git a/solon-plugins/wx-java-cp-multi-solon-plugin/pom.xml b/solon-plugins/wx-java-cp-multi-solon-plugin/pom.xml
index 58c4107d61..d2218490b9 100644
--- a/solon-plugins/wx-java-cp-multi-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-cp-multi-solon-plugin/pom.xml
@@ -4,7 +4,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.6.9.B
+ 4.7.0
4.0.0
diff --git a/solon-plugins/wx-java-cp-solon-plugin/pom.xml b/solon-plugins/wx-java-cp-solon-plugin/pom.xml
index e73ddd62e6..05598d6b9c 100644
--- a/solon-plugins/wx-java-cp-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-cp-solon-plugin/pom.xml
@@ -4,7 +4,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.6.9.B
+ 4.7.0
4.0.0
diff --git a/solon-plugins/wx-java-miniapp-multi-solon-plugin/pom.xml b/solon-plugins/wx-java-miniapp-multi-solon-plugin/pom.xml
index f4ae20c457..deca9a2ffa 100644
--- a/solon-plugins/wx-java-miniapp-multi-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-miniapp-multi-solon-plugin/pom.xml
@@ -5,7 +5,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.6.9.B
+ 4.7.0
4.0.0
diff --git a/solon-plugins/wx-java-miniapp-solon-plugin/pom.xml b/solon-plugins/wx-java-miniapp-solon-plugin/pom.xml
index d05d28be2f..5075140322 100644
--- a/solon-plugins/wx-java-miniapp-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-miniapp-solon-plugin/pom.xml
@@ -4,7 +4,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.6.9.B
+ 4.7.0
4.0.0
diff --git a/solon-plugins/wx-java-mp-multi-solon-plugin/pom.xml b/solon-plugins/wx-java-mp-multi-solon-plugin/pom.xml
index dbfafa8ebd..67f9e2da37 100644
--- a/solon-plugins/wx-java-mp-multi-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-mp-multi-solon-plugin/pom.xml
@@ -5,7 +5,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.6.9.B
+ 4.7.0
4.0.0
diff --git a/solon-plugins/wx-java-mp-solon-plugin/pom.xml b/solon-plugins/wx-java-mp-solon-plugin/pom.xml
index 1a07cf0bcc..5dcea9ac93 100644
--- a/solon-plugins/wx-java-mp-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-mp-solon-plugin/pom.xml
@@ -5,7 +5,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.6.9.B
+ 4.7.0
4.0.0
diff --git a/solon-plugins/wx-java-open-solon-plugin/pom.xml b/solon-plugins/wx-java-open-solon-plugin/pom.xml
index bb777597b8..bd8c9e3e45 100644
--- a/solon-plugins/wx-java-open-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-open-solon-plugin/pom.xml
@@ -5,7 +5,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.6.9.B
+ 4.7.0
4.0.0
diff --git a/solon-plugins/wx-java-pay-solon-plugin/pom.xml b/solon-plugins/wx-java-pay-solon-plugin/pom.xml
index ba0363962f..47153d8f13 100644
--- a/solon-plugins/wx-java-pay-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-pay-solon-plugin/pom.xml
@@ -5,7 +5,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.6.9.B
+ 4.7.0
4.0.0
diff --git a/solon-plugins/wx-java-qidian-solon-plugin/pom.xml b/solon-plugins/wx-java-qidian-solon-plugin/pom.xml
index abeafebaa8..b5488655ec 100644
--- a/solon-plugins/wx-java-qidian-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-qidian-solon-plugin/pom.xml
@@ -3,7 +3,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.6.9.B
+ 4.7.0
4.0.0
diff --git a/spring-boot-starters/pom.xml b/spring-boot-starters/pom.xml
index 370d4e961a..75f2d94865 100644
--- a/spring-boot-starters/pom.xml
+++ b/spring-boot-starters/pom.xml
@@ -6,7 +6,7 @@
com.github.binarywang
wx-java
- 4.6.9.B
+ 4.7.0
pom
wx-java-spring-boot-starters
diff --git a/spring-boot-starters/wx-java-channel-multi-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-channel-multi-spring-boot-starter/pom.xml
index e4eb43cc9c..b67cc1733e 100644
--- a/spring-boot-starters/wx-java-channel-multi-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-channel-multi-spring-boot-starter/pom.xml
@@ -5,7 +5,7 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.6.9.B
+ 4.7.0
4.0.0
diff --git a/spring-boot-starters/wx-java-channel-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-channel-spring-boot-starter/pom.xml
index 2516fb60b1..4a4567198c 100644
--- a/spring-boot-starters/wx-java-channel-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-channel-spring-boot-starter/pom.xml
@@ -3,7 +3,7 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.6.9.B
+ 4.7.0
4.0.0
diff --git a/spring-boot-starters/wx-java-cp-multi-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-cp-multi-spring-boot-starter/pom.xml
index ebce5599d1..0128c7bf52 100644
--- a/spring-boot-starters/wx-java-cp-multi-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-cp-multi-spring-boot-starter/pom.xml
@@ -4,7 +4,7 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.6.9.B
+ 4.7.0
4.0.0
diff --git a/spring-boot-starters/wx-java-cp-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-cp-spring-boot-starter/pom.xml
index 1472037d1d..59c2f63f8a 100644
--- a/spring-boot-starters/wx-java-cp-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-cp-spring-boot-starter/pom.xml
@@ -4,7 +4,7 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.6.9.B
+ 4.7.0
4.0.0
diff --git a/spring-boot-starters/wx-java-miniapp-multi-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-miniapp-multi-spring-boot-starter/pom.xml
index 78387f26f7..c90f2b741d 100644
--- a/spring-boot-starters/wx-java-miniapp-multi-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-miniapp-multi-spring-boot-starter/pom.xml
@@ -5,7 +5,7 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.6.9.B
+ 4.7.0
4.0.0
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 dafad3b2d3..2eaa6f1c77 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 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.6.9.B
+ 4.7.0
4.0.0
diff --git a/spring-boot-starters/wx-java-mp-multi-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-mp-multi-spring-boot-starter/pom.xml
index 0d096e1e57..3ec7cf5163 100644
--- a/spring-boot-starters/wx-java-mp-multi-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-mp-multi-spring-boot-starter/pom.xml
@@ -5,7 +5,7 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.6.9.B
+ 4.7.0
4.0.0
diff --git a/spring-boot-starters/wx-java-mp-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-mp-spring-boot-starter/pom.xml
index dfb2f1366a..4bc7037c22 100644
--- a/spring-boot-starters/wx-java-mp-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-mp-spring-boot-starter/pom.xml
@@ -5,7 +5,7 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.6.9.B
+ 4.7.0
4.0.0
diff --git a/spring-boot-starters/wx-java-open-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-open-spring-boot-starter/pom.xml
index 1dc0371f7d..cd6f25e892 100644
--- a/spring-boot-starters/wx-java-open-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-open-spring-boot-starter/pom.xml
@@ -5,7 +5,7 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.6.9.B
+ 4.7.0
4.0.0
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 cb75fb32df..960556dad7 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 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.6.9.B
+ 4.7.0
4.0.0
diff --git a/spring-boot-starters/wx-java-qidian-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-qidian-spring-boot-starter/pom.xml
index fce8c3a04e..5fe49991e1 100644
--- a/spring-boot-starters/wx-java-qidian-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-qidian-spring-boot-starter/pom.xml
@@ -3,7 +3,7 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.6.9.B
+ 4.7.0
4.0.0
diff --git a/weixin-graal/pom.xml b/weixin-graal/pom.xml
index 21f1d786c3..44c7c952fe 100644
--- a/weixin-graal/pom.xml
+++ b/weixin-graal/pom.xml
@@ -6,7 +6,7 @@
com.github.binarywang
wx-java
- 4.6.9.B
+ 4.7.0
weixin-graal
diff --git a/weixin-java-channel/pom.xml b/weixin-java-channel/pom.xml
index ccd6a602ce..0cb27642ab 100644
--- a/weixin-java-channel/pom.xml
+++ b/weixin-java-channel/pom.xml
@@ -6,7 +6,7 @@
com.github.binarywang
wx-java
- 4.6.9.B
+ 4.7.0
weixin-java-channel
diff --git a/weixin-java-common/pom.xml b/weixin-java-common/pom.xml
index b988418013..b775fab23b 100644
--- a/weixin-java-common/pom.xml
+++ b/weixin-java-common/pom.xml
@@ -6,7 +6,7 @@
com.github.binarywang
wx-java
- 4.6.9.B
+ 4.7.0
weixin-java-common
diff --git a/weixin-java-cp/pom.xml b/weixin-java-cp/pom.xml
index cbe101285e..85a37ba2f9 100644
--- a/weixin-java-cp/pom.xml
+++ b/weixin-java-cp/pom.xml
@@ -7,7 +7,7 @@
com.github.binarywang
wx-java
- 4.6.9.B
+ 4.7.0
weixin-java-cp
diff --git a/weixin-java-miniapp/pom.xml b/weixin-java-miniapp/pom.xml
index 530acda8ae..a9bb5f37dc 100644
--- a/weixin-java-miniapp/pom.xml
+++ b/weixin-java-miniapp/pom.xml
@@ -7,7 +7,7 @@
com.github.binarywang
wx-java
- 4.6.9.B
+ 4.7.0
weixin-java-miniapp
diff --git a/weixin-java-mp/pom.xml b/weixin-java-mp/pom.xml
index 90d9e32b6b..c8c3f298c8 100644
--- a/weixin-java-mp/pom.xml
+++ b/weixin-java-mp/pom.xml
@@ -7,7 +7,7 @@
com.github.binarywang
wx-java
- 4.6.9.B
+ 4.7.0
weixin-java-mp
diff --git a/weixin-java-open/pom.xml b/weixin-java-open/pom.xml
index 6f36e34779..0146f516ad 100644
--- a/weixin-java-open/pom.xml
+++ b/weixin-java-open/pom.xml
@@ -7,7 +7,7 @@
com.github.binarywang
wx-java
- 4.6.9.B
+ 4.7.0
weixin-java-open
diff --git a/weixin-java-pay/pom.xml b/weixin-java-pay/pom.xml
index 8351c65690..cba2ede006 100644
--- a/weixin-java-pay/pom.xml
+++ b/weixin-java-pay/pom.xml
@@ -5,7 +5,7 @@
com.github.binarywang
wx-java
- 4.6.9.B
+ 4.7.0
4.0.0
diff --git a/weixin-java-qidian/pom.xml b/weixin-java-qidian/pom.xml
index 8928f4815e..31a0c21dc0 100644
--- a/weixin-java-qidian/pom.xml
+++ b/weixin-java-qidian/pom.xml
@@ -7,7 +7,7 @@
com.github.binarywang
wx-java
- 4.6.9.B
+ 4.7.0
weixin-java-qidian
From bebfbef7265cc4a7a6d009327be3ece0c559986f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=BE=E8=8A=B1=E7=83=A7=E9=A5=BC?=
Date: Tue, 17 Dec 2024 00:31:48 +0800
Subject: [PATCH 020/326] =?UTF-8?q?:art:=E3=80=90=E5=BE=AE=E4=BF=A1?=
=?UTF-8?q?=E6=94=AF=E4=BB=98=E3=80=91=E9=83=A8=E5=88=86=E6=8E=A5=E5=8F=A3?=
=?UTF-8?q?=E8=BF=94=E5=9B=9E=E5=AE=9E=E4=BD=93=E7=B1=BB=E5=AE=9E=E7=8E=B0?=
=?UTF-8?q?=E5=BA=8F=E5=88=97=E5=8C=96=E6=8E=A5=E5=8F=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../binarywang/wxpay/bean/bank/BankBranchesResult.java | 5 ++++-
.../com/github/binarywang/wxpay/bean/bank/BankInfo.java | 7 ++++++-
.../github/binarywang/wxpay/bean/bank/BankingResult.java | 5 ++++-
.../github/binarywang/wxpay/bean/bank/CitiesResult.java | 5 ++++-
.../github/binarywang/wxpay/bean/bank/ProvincesResult.java | 4 +++-
.../binarywang/wxpay/bean/ecommerce/FundBillResult.java | 4 +++-
6 files changed, 24 insertions(+), 6 deletions(-)
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/bank/BankBranchesResult.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/bank/BankBranchesResult.java
index 72cc4f6a76..a0ee6d3d99 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/bank/BankBranchesResult.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/bank/BankBranchesResult.java
@@ -144,7 +144,10 @@ public class BankBranchesResult implements Serializable {
@Getter
@Setter
- public static class BankBranch {
+ public static class BankBranch implements Serializable {
+
+ private static final long serialVersionUID = -3500020131951579476L;
+
/**
*
* 字段名:开户银行支行名称
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/bank/BankInfo.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/bank/BankInfo.java
index 89756b07d5..adafc9b280 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/bank/BankInfo.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/bank/BankInfo.java
@@ -5,6 +5,8 @@
import lombok.Getter;
import lombok.Setter;
+import java.io.Serializable;
+
/**
* 银行信息
*
@@ -12,7 +14,10 @@
* created on 2022/5/12
**/
@Data
-public class BankInfo {
+public class BankInfo implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
/**
* 银行别名
*/
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/bank/BankingResult.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/bank/BankingResult.java
index 407ad5fc55..1d3a48c200 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/bank/BankingResult.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/bank/BankingResult.java
@@ -43,7 +43,10 @@ public class BankingResult implements Serializable {
@Getter
@Setter
- public static class Link {
+ public static class Link implements Serializable {
+
+ private static final long serialVersionUID = -8372812998971715894L;
+
/**
* 下一页链接
*/
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/bank/CitiesResult.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/bank/CitiesResult.java
index b5bf87c816..b6914ee814 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/bank/CitiesResult.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/bank/CitiesResult.java
@@ -47,7 +47,10 @@ public class CitiesResult implements Serializable {
@Getter
@Setter
- public static class CityInfo {
+ public static class CityInfo implements Serializable {
+
+ private static final long serialVersionUID = -6089905695087974693L;
+
/**
*
* 字段名:城市名称
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/bank/ProvincesResult.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/bank/ProvincesResult.java
index 6525fc1c91..162c976347 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/bank/ProvincesResult.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/bank/ProvincesResult.java
@@ -47,7 +47,9 @@ public class ProvincesResult implements Serializable {
@Getter
@Setter
- public static class ProvinceInfo {
+ public static class ProvinceInfo implements Serializable {
+
+ private static final long serialVersionUID = -4118613374545722650L;
/**
*
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/FundBillResult.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/FundBillResult.java
index 206cd1218b..077c2c2336 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/FundBillResult.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/FundBillResult.java
@@ -48,7 +48,9 @@ public class FundBillResult implements Serializable {
private FundBill[] downloadBillList;
@Data
- public static class FundBill {
+ public static class FundBill implements Serializable {
+
+ private static final long serialVersionUID = 4008480977464421822L;
/**
*
From f6b114d0eab95fdc47558309420437fe4adb67cc Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Tue, 17 Dec 2024 00:32:15 +0800
Subject: [PATCH 021/326] :arrow_up: Bump com.thoughtworks.xstream:xstream
---
others/weixin-java-osgi/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/others/weixin-java-osgi/pom.xml b/others/weixin-java-osgi/pom.xml
index 67e4f42beb..b8531da88d 100644
--- a/others/weixin-java-osgi/pom.xml
+++ b/others/weixin-java-osgi/pom.xml
@@ -28,7 +28,7 @@
com.thoughtworks.xstream
xstream
- 1.4.19
+ 1.4.21
provided
From 27f1fcaec6cae003e39333e60eb46aae0b902106 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E7=BD=97=E5=8B=8B?=
Date: Wed, 18 Dec 2024 03:19:46 +0000
Subject: [PATCH 022/326] =?UTF-8?q?:bug:=20=E3=80=90=E8=A7=86=E9=A2=91?=
=?UTF-8?q?=E5=8F=B7=E3=80=91=E4=BF=AE=E5=A4=8D=E5=BE=AE=E4=BF=A1=E5=B0=8F?=
=?UTF-8?q?=E5=BA=97=E4=B8=BB=E9=A1=B5=E7=AE=A1=E7=90=86API=E8=8E=B7?=
=?UTF-8?q?=E5=8F=96=E5=9C=A8=E5=BA=97=E9=93=BA=E4=B8=BB=E9=A1=B5=E5=B1=95?=
=?UTF-8?q?=E7=A4=BA=E7=9A=84=E5=95=86=E5=93=81=E5=88=86=E7=B1=BB=E6=8E=A5?=
=?UTF-8?q?=E5=8F=A3=E7=9A=84=E8=BF=94=E5=9B=9E=E5=AE=9E=E4=BD=93=E7=B1=BB?=
=?UTF-8?q?=E7=9A=84=E9=83=A8=E5=88=86=E5=AD=97=E6=AE=B5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../chanjar/weixin/channel/bean/home/tree/LevelTreeInfo.java | 5 +++--
.../weixin/channel/bean/home/tree/OneLevelTreeNode.java | 5 +++--
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/LevelTreeInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/LevelTreeInfo.java
index c74fff1246..104588202e 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/LevelTreeInfo.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/LevelTreeInfo.java
@@ -2,6 +2,7 @@
import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable;
+import java.util.List;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@@ -17,7 +18,7 @@
public class LevelTreeInfo implements Serializable {
/** 一级分类 */
- @JsonProperty("level1")
- private OneLevelTreeNode level1;
+ @JsonProperty("level_1")
+ private List level1;
}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/OneLevelTreeNode.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/OneLevelTreeNode.java
index 74103e2b89..76499c86e7 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/OneLevelTreeNode.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/OneLevelTreeNode.java
@@ -1,6 +1,7 @@
package me.chanjar.weixin.channel.bean.home.tree;
import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.List;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
@@ -18,7 +19,7 @@
public class OneLevelTreeNode extends CatTreeNode {
/** 二级分类 */
- @JsonProperty("level2")
- private CatTreeNode level2;
+ @JsonProperty("level_2")
+ private List level2;
}
From 47471a6c0b10e2e7429b419f386ee98e5acea72b Mon Sep 17 00:00:00 2001
From: Binary Wang <5303+binary@user.noreply.gitee.com>
Date: Wed, 18 Dec 2024 03:23:35 +0000
Subject: [PATCH 023/326] update .gitee/ISSUE_TEMPLATE.md.
Signed-off-by: Binary Wang <5303+binary@user.noreply.gitee.com>
---
.gitee/ISSUE_TEMPLATE.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.gitee/ISSUE_TEMPLATE.md b/.gitee/ISSUE_TEMPLATE.md
index cdae693d35..a0b60ba750 100644
--- a/.gitee/ISSUE_TEMPLATE.md
+++ b/.gitee/ISSUE_TEMPLATE.md
@@ -1,4 +1,4 @@
-强烈建议大家到 `github` 相关页面提交问题,方便统一查询管理,具体页面地址:https://github.com/Wechat-Group/WxJava/issues
+强烈建议大家到 `github` 相关页面提交问题,方便统一查询管理,具体页面地址:https://github.com/binarywang/WxJava/issues
当然如果必须在这里提问,请务必按以下格式填写,谢谢配合~
From 8891b68e7986d6ec53aa52fb60985dd9272cd66a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ader1y=20=E6=A0=88=E7=83=9F?=
Date: Wed, 18 Dec 2024 11:37:37 +0800
Subject: [PATCH 024/326] =?UTF-8?q?:bug:=20#3443=20=E3=80=90=E5=BE=AE?=
=?UTF-8?q?=E4=BF=A1=E6=94=AF=E4=BB=98=E3=80=91=E5=88=9D=E5=A7=8B=E5=8C=96?=
=?UTF-8?q?V3=E8=AF=B7=E6=B1=82=E6=97=B6=E5=8F=96=E6=B6=88=E5=AF=B9?=
=?UTF-8?q?=E7=A7=81=E9=92=A5=E7=9A=84=E5=8A=A0=E5=AF=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../binarywang/wxpay/config/WxPayConfig.java | 5 ----
.../config/CustomizedWxPayConfigTest.java | 9 ++++---
.../wxpay/config/WxPayConfigTest.java | 24 -------------------
.../testbase/CustomizedApiTestModule.java | 20 +++++++++++++---
4 files changed, 23 insertions(+), 35 deletions(-)
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java
index a8ad909b3e..293c52eac6 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java
@@ -14,7 +14,6 @@
import java.security.PublicKey;
import java.security.cert.Certificate;
import java.security.cert.X509Certificate;
-import java.util.Base64;
import java.util.Optional;
import javax.net.ssl.SSLContext;
import lombok.Data;
@@ -295,10 +294,6 @@ public CloseableHttpClient initApiV3HttpClient() throws WxPayException {
}
try {
if (merchantPrivateKey == null) {
- if (StringUtils.isNotBlank(this.getPrivateKeyString())) {
- this.setPrivateKeyString(Base64.getEncoder().encodeToString(this.getPrivateKeyString().getBytes()));
- }
-
try (InputStream keyInputStream = this.loadConfigInputStream(this.getPrivateKeyString(), this.getPrivateKeyPath(),
this.privateKeyContent, "privateKeyPath")) {
merchantPrivateKey = PemUtils.loadPrivateKey(keyInputStream);
diff --git a/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/config/CustomizedWxPayConfigTest.java b/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/config/CustomizedWxPayConfigTest.java
index a42026e3ee..3b2bdfeaa6 100644
--- a/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/config/CustomizedWxPayConfigTest.java
+++ b/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/config/CustomizedWxPayConfigTest.java
@@ -1,5 +1,9 @@
package com.github.binarywang.wxpay.config;
+import static org.testng.Assert.assertEquals;
+
+import com.github.binarywang.wxpay.bean.result.WxPayOrderQueryV3Result;
+import com.github.binarywang.wxpay.constant.WxPayErrorCode;
import com.github.binarywang.wxpay.exception.WxPayException;
import com.github.binarywang.wxpay.service.WxPayService;
import com.github.binarywang.wxpay.testbase.CustomizedApiTestModule;
@@ -30,10 +34,9 @@ public void testCustomizerHttpClient() {
public void testCustomizerV3HttpClient() {
try {
- wxPayService.queryOrderV3("a", null);
+ WxPayOrderQueryV3Result result = wxPayService.queryOrderV3("a", null);
} catch (WxPayException e) {
- // ignore
- e.printStackTrace();
+ assertEquals(e.getErrCode(), WxPayErrorCode.RefundQuery.PARAM_ERROR);
}
}
}
diff --git a/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/config/WxPayConfigTest.java b/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/config/WxPayConfigTest.java
index 72750e01cd..46bc23aac2 100644
--- a/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/config/WxPayConfigTest.java
+++ b/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/config/WxPayConfigTest.java
@@ -1,16 +1,7 @@
package com.github.binarywang.wxpay.config;
-import com.github.binarywang.wxpay.exception.WxPayException;
-import org.bouncycastle.jce.provider.BouncyCastleProvider;
-import org.bouncycastle.pqc.jcajce.provider.util.KeyUtil;
import org.testng.annotations.Test;
-import java.security.KeyPair;
-import java.security.KeyPairGenerator;
-import java.security.SecureRandom;
-import java.security.Security;
-import java.util.Base64;
-
/**
*
* Created by BinaryWang on 2017/6/18.
@@ -54,19 +45,4 @@ public void testInitSSLContext_base64() throws Exception {
payConfig.initSSLContext();
}
-
- @Test
- public void testInitApiV3HttpClient() throws Exception {
- Security.addProvider(new BouncyCastleProvider());
- KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("RSA","BC");
- keyPairGenerator.initialize(2048,new SecureRandom());
- KeyPair keyPair = keyPairGenerator.genKeyPair();
- byte[] encoded = keyPair.getPrivate().getEncoded();
- // 模拟用户配置
- String privateKeyString = Base64.getEncoder().encodeToString(encoded);
- payConfig.setPrivateKeyString(privateKeyString);
- payConfig.setApiV3Key("Test");
- payConfig.initApiV3HttpClient();
- }
-
}
diff --git a/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/testbase/CustomizedApiTestModule.java b/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/testbase/CustomizedApiTestModule.java
index a0cc399ea9..484227e34e 100644
--- a/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/testbase/CustomizedApiTestModule.java
+++ b/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/testbase/CustomizedApiTestModule.java
@@ -6,15 +6,14 @@
import com.google.inject.Binder;
import com.google.inject.Module;
import com.thoughtworks.xstream.XStream;
+import java.io.*;
+import java.nio.charset.StandardCharsets;
import me.chanjar.weixin.common.error.WxRuntimeException;
import me.chanjar.weixin.common.util.xml.XStreamInitializer;
import org.apache.http.HttpRequestInterceptor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.io.IOException;
-import java.io.InputStream;
-
/**
* The type Api test module.
*/
@@ -39,7 +38,22 @@ public void configure(Binder binder) {
config.setHttpClientBuilderCustomizer((builder) -> {
builder.addInterceptorLast((HttpRequestInterceptor) (r, c) -> System.out.println("--------> HttpRequestInterceptor ..."));
});
+ try (FileInputStream fis = new FileInputStream(config.getPrivateKeyPath());
+ InputStreamReader isr = new InputStreamReader(fis, StandardCharsets.UTF_8);
+ BufferedReader reader = new BufferedReader(isr)) {
+
+ StringBuilder stringBuilder = new StringBuilder();
+ String line;
+ while ((line = reader.readLine()) != null) {
+ stringBuilder.append(line);
+ stringBuilder.append(System.lineSeparator());
+ }
+ String fileContent = stringBuilder.toString();
+ config.setPrivateKeyString(fileContent);
+ System.out.println(fileContent);
+
+ }
WxPayService wxService = new WxPayServiceImpl();
wxService.setConfig(config);
From 6b5d69667f9c0c76ae73c0a96ba856c3346964d0 Mon Sep 17 00:00:00 2001
From: Zeyes Lee
Date: Wed, 18 Dec 2024 12:39:27 +0800
Subject: [PATCH 025/326] =?UTF-8?q?:bug:=20=E3=80=90=E8=A7=86=E9=A2=91?=
=?UTF-8?q?=E5=8F=B7=E3=80=91=E4=BF=AE=E6=AD=A3=E5=BA=97=E9=93=BA=E4=B8=BB?=
=?UTF-8?q?=E9=A1=B5=E5=B1=95=E7=A4=BA=E7=9A=84=E5=95=86=E5=93=81=E5=88=86?=
=?UTF-8?q?=E7=B1=BB=E6=8A=A5=E9=94=99?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../channel/bean/home/tree/CatTreeNode.java | 2 +-
.../channel/bean/home/tree/TreeShowInfo.java | 58 -------------------
2 files changed, 1 insertion(+), 59 deletions(-)
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/CatTreeNode.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/CatTreeNode.java
index fda794428c..c545b8637f 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/CatTreeNode.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/CatTreeNode.java
@@ -28,5 +28,5 @@ public class CatTreeNode implements Serializable {
/** 是否在用户端展示该分类。1为是,0为否 */
@JsonProperty("is_displayed")
- private Integer displayed;
+ private Boolean displayed;
}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/TreeShowInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/TreeShowInfo.java
index 485d29ce15..09da2c5b0c 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/TreeShowInfo.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/TreeShowInfo.java
@@ -1,6 +1,5 @@
package me.chanjar.weixin.channel.bean.home.tree;
-import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable;
import java.util.List;
@@ -43,61 +42,4 @@ protected LevelTreeInfo createTree() {
}
return tree;
}
-
- /**
- * 创建一级分类节点
- *
- * @return 一级分类节点
- */
- protected OneLevelTreeNode createLevel1() {
- this.createTree();
- if (tree.getLevel1() == null) {
- tree.setLevel1(new OneLevelTreeNode());
- }
- return tree.getLevel1();
- }
-
- /**
- * 创建二级分类节点
- *
- * @return 二级分类节点
- */
- protected CatTreeNode createLevel2() {
- OneLevelTreeNode level1 = this.createLevel1();
- if (level1.getLevel2() == null) {
- level1.setLevel2(new CatTreeNode());
- }
- return level1.getLevel2();
- }
-
-
- @JsonIgnore
- public void setLevel1Id(Integer id) {
- createLevel1().setId(id);
- }
-
- @JsonIgnore
- public void setLevel1Name(String name) {
- createLevel1().setName(name);
- }
-
- @JsonIgnore
- public void setLevel1Displayed(Integer displayed) {
- createLevel1().setDisplayed(displayed);
- }
-
- @JsonIgnore
- public void setLevel2Id(Integer id) {
- createLevel2().setId(id);
- }
-
- @JsonIgnore
- public void setLevel2Name(String name) {
- createLevel2().setName(name);
- }
-
- @JsonIgnore
- public void setLevel2Displayed(Integer displayed) {
- createLevel2().setDisplayed(displayed);
- }
}
From 24f03e957377ab034177bf061766865c171ff91f Mon Sep 17 00:00:00 2001
From: Binary Wang
Date: Wed, 18 Dec 2024 12:37:54 +0800
Subject: [PATCH 026/326] =?UTF-8?q?:art:=20=E4=BC=98=E5=8C=96=E9=A6=96?=
=?UTF-8?q?=E9=A1=B5=E6=96=87=E6=A1=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
README.md | 56 ++++++++++++++++++++++++-------------------------------
1 file changed, 24 insertions(+), 32 deletions(-)
diff --git a/README.md b/README.md
index c61c8d48da..ab645b7c4f 100644
--- a/README.md
+++ b/README.md
@@ -50,21 +50,23 @@
+
+
### 重要信息
-0. [`WxJava` 荣获 `GitCode` 2024年度十大开源社区奖项](https://mp.weixin.qq.com/s/wM_UlMsDm3IZ1CPPDvcvQw)。
-1. 项目合作洽谈请联系微信`binary0000`(在微信里自行搜索并添加好友,请注明来意,如有关于SDK问题需讨论请参考下文入群讨论,不要加此微信)。
-2. **2023-12-28 发布 [【4.6.0正式版】](https://mp.weixin.qq.com/s/9Hhc_8w-v7ogS_TEAsqfAg)**!
-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/binarywang/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/binarywang/WxJava/wiki) ,避免浪费大家的宝贵时间;
-9. 寻求帮助时需贴代码或大长串异常信息的,请利用 http://paste.ubuntu.com
+1. [`WxJava` 荣获 `GitCode` 2024年度十大开源社区奖项](https://mp.weixin.qq.com/s/wM_UlMsDm3IZ1CPPDvcvQw)。
+2. 项目合作洽谈请联系微信`binary0000`(在微信里自行搜索并添加好友,请注明来意,如有关于SDK问题需讨论请参考下文入群讨论,不要加此微信)。
+3. **2023-12-28 发布 [【4.6.0正式版】](https://mp.weixin.qq.com/s/9Hhc_8w-v7ogS_TEAsqfAg)**!
+4. 贡献源码可以参考视频:[【贡献源码全过程(上集)】](https://mp.weixin.qq.com/s/3xUZSATWwHR_gZZm207h7Q)、[【贡献源码全过程(下集)】](https://mp.weixin.qq.com/s/nyzJwVVoYSJ4hSbwyvTx9A) ,友情提供:[程序员小山与Bug](https://space.bilibili.com/473631007)
+5. 新手重要提示:本项目仅是一个SDK开发工具包,未提供Web实现,建议使用 `maven` 或 `gradle` 引用本项目即可使用本SDK提供的各种功能,详情可参考 **[【Demo项目】](demo.md)** 或本项目中的部分单元测试代码;
+6. 微信开发新手请务必阅读【开发文档】([Gitee Wiki](https://gitee.com/binary/weixin-java-tools/wikis/Home) 或者 [Github Wiki](https://github.com/binarywang/WxJava/wiki))的常见问题部分,可以少走很多弯路,节省不少时间。
+7. 技术交流群:想获得QQ群/微信群/钉钉企业群等信息的同学,请使用微信扫描上面的微信公众号二维码关注 `WxJava` 后点击相关菜单即可获取加入方式,同时也可以在微信中搜索 `weixin-java-tools` 或 `WxJava` 后选择正确的公众号进行关注,该公众号会及时通知SDK相关更新信息,并不定期分享微信Java开发相关技术知识;
+8. 钉钉技术交流群:`32206329`(技术交流2群), `30294972`(技术交流1群,目前已满),`35724728`(通知群,实时通知Github项目变更记录)。
+9. 微信开发新手或者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) ,避免浪费大家的宝贵时间;
+10. 寻求帮助时需贴代码或大长串异常信息的,请利用 http://paste.ubuntu.com
--------------------------------
### 其他说明
@@ -95,9 +97,9 @@
- 微信小程序:`weixin-java-miniapp`
- 微信支付:`weixin-java-pay`
- 微信开放平台:`weixin-java-open`
- - 公众号(包括订阅号和服务号):`weixin-java-mp`
- - 企业号/企业微信:`weixin-java-cp`
- - 视频号/微信小店:`weixin-java-channel`
+ - 微信公众号:`weixin-java-mp`
+ - 企业微信:`weixin-java-cp`
+ - 微信视频号/微信小店:`weixin-java-channel`
---------------------------------
@@ -117,7 +119,8 @@
### 应用案例
完整案例登记列表,请[【访问这里】](https://github.com/binarywang/WxJava/issues/729)查看,欢迎登记更多的案例。
-以下为节选的部分案例:
+
+以下为节选的部分案例, 点此展开查看
#### 开源项目:
- 基于微信公众号的签到、抽奖、发送弹幕程序:https://github.com/workcheng/weiya
@@ -180,26 +183,15 @@
- 微信公众号管理系统:http://demo.joolun.com
- 锐捷网络:Saleslink
+
+
----------------------------------
### 贡献者列表
特别感谢参与贡献的所有同学,所有贡献者列表请在[此处](https://github.com/binarywang/WxJava/graphs/contributors)查看,欢迎大家继续踊跃贡献代码!
-
-点击此处展开查看贡献次数最多的几位小伙伴
-
-1. [chanjarster (Daniel Qian)](https://github.com/chanjarster)
-2. [binarywang (Binary Wang)](https://github.com/binarywang)
-3. [007gzs](https://github.com/007gzs)
-4. [Silloy](https://github.com/silloy)
-5. [mgcnrx11](https://github.com/mgcnrx11)
-6. [0katekate0 (Wang_Wong)](https://github.com/0katekate0)
-7. [yuanqixun](https://github.com/yuanqixun)
-8. [kakotor](https://github.com/kakotor)
-9. [aimilin6688 (Jonk)](https://github.com/aimilin6688)
-10. [lkqm (Mario Luo)](https://github.com/lkqm)
-11. [kareanyi (MillerLin)](https://github.com/kareanyi)
-12. [Bincent (Hongbin.hsu)](https://gitee.com/bincent)
-
-### GitHub Stargazers over time
+
+
+
-[](https://starchart.cc/Wechat-Group/WxJava)
+### GitHub Stargazers over time
+[](https://star-history.com/#binarywang/WxJava&Date)
From 75aa3fce9a59360dfe8aebc79a36a912ab40610b Mon Sep 17 00:00:00 2001
From: Zeyes Lee
Date: Wed, 18 Dec 2024 21:50:53 +0800
Subject: [PATCH 027/326] =?UTF-8?q?:art:=20#3445=20=E3=80=90=E4=BC=81?=
=?UTF-8?q?=E4=B8=9A=E5=BE=AE=E4=BF=A1=E3=80=91=E7=AC=AC=E4=B8=89=E6=96=B9?=
=?UTF-8?q?=E5=BA=94=E7=94=A8=E5=BC=80=E5=8F=91=E6=B6=88=E6=81=AF=E5=A4=84?=
=?UTF-8?q?=E7=90=86=E5=88=A4=E6=96=AD=E9=87=8D=E5=A4=8D=E7=9A=84=E6=96=B9?=
=?UTF-8?q?=E6=B3=95=E8=BF=9B=E8=A1=8C=E4=BC=98=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../weixin/channel/message/WxChannelMessageRouter.java | 4 ++--
.../java/me/chanjar/weixin/cp/message/WxCpMessageRouter.java | 2 +-
.../me/chanjar/weixin/cp/tp/message/WxCpTpMessageRouter.java | 5 +++--
.../cn/binarywang/wx/miniapp/message/WxMaMessageRouter.java | 2 +-
.../java/me/chanjar/weixin/mp/api/WxMpMessageRouter.java | 2 +-
5 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/message/WxChannelMessageRouter.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/message/WxChannelMessageRouter.java
index 8ccc2c5050..16fb0781cb 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/message/WxChannelMessageRouter.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/message/WxChannelMessageRouter.java
@@ -178,7 +178,7 @@ public Object route(final WxChannelMessage message, final String content, final
* @param wxMessage 消息
* @return 是否重复
*/
- private boolean isMsgDuplicated(WxChannelMessage wxMessage) {
+ protected boolean isMsgDuplicated(WxChannelMessage wxMessage) {
String messageId = this.generateMessageId(wxMessage);
return this.messageDuplicateChecker.isDuplicate(messageId);
}
@@ -188,7 +188,7 @@ private boolean isMsgDuplicated(WxChannelMessage wxMessage) {
*
* @return 消息id
*/
- private String generateMessageId(WxChannelMessage wxMessage) {
+ protected String generateMessageId(WxChannelMessage wxMessage) {
StringBuilder sb = new StringBuilder();
if (wxMessage.getMsgId() == null) {
sb.append(wxMessage.getCreateTime())
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/message/WxCpMessageRouter.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/message/WxCpMessageRouter.java
index e2daeab546..a2417ec86d 100644
--- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/message/WxCpMessageRouter.java
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/message/WxCpMessageRouter.java
@@ -258,7 +258,7 @@ public WxCpXmlOutMessage route(final WxCpXmlMessage wxMessage) {
return this.route(wxMessage, new HashMap<>(2));
}
- private boolean isMsgDuplicated(WxCpXmlMessage wxMessage) {
+ protected boolean isMsgDuplicated(WxCpXmlMessage wxMessage) {
StringBuilder messageId = new StringBuilder();
if (wxMessage.getMsgId() == null) {
messageId.append(wxMessage.getCreateTime())
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/tp/message/WxCpTpMessageRouter.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/tp/message/WxCpTpMessageRouter.java
index 1df52149c8..8887a23d5f 100644
--- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/tp/message/WxCpTpMessageRouter.java
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/tp/message/WxCpTpMessageRouter.java
@@ -278,7 +278,7 @@ public WxCpXmlOutMessage route(final WxCpTpXmlMessage wxMessage) {
return this.route(wxMessage, new HashMap<>(2));
}
- private boolean isMsgDuplicated(final String suiteId, WxCpTpXmlMessage wxMessage) {
+ protected boolean isMsgDuplicated(final String suiteId, WxCpTpXmlMessage wxMessage) {
StringBuilder messageId = new StringBuilder();
messageId.append(wxMessage.getToUserName());
if (wxMessage.getInfoType() != null) {
@@ -306,7 +306,8 @@ private boolean isMsgDuplicated(final String suiteId, WxCpTpXmlMessage wxMessage
.append("-").append(wxMessage.getCreateTime())
.append("-").append(wxMessage.getFromUserName())
.append("-").append(StringUtils.trimToEmpty(wxMessage.getEvent()))
- .append("-").append(StringUtils.trimToEmpty(wxMessage.getEventKey()));
+ .append("-").append(StringUtils.trimToEmpty(wxMessage.getEventKey()))
+ .append("-").append(StringUtils.trimToEmpty(wxMessage.getExternalUserID()));
}
}
diff --git a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/message/WxMaMessageRouter.java b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/message/WxMaMessageRouter.java
index 6cd603929d..3d81b6d66a 100644
--- a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/message/WxMaMessageRouter.java
+++ b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/message/WxMaMessageRouter.java
@@ -173,7 +173,7 @@ public WxMaXmlOutMessage route(final WxMaMessage wxMessage) {
return this.route(wxMessage, new HashMap<>(2));
}
- private boolean isMsgDuplicated(WxMaMessage wxMessage) {
+ protected boolean isMsgDuplicated(WxMaMessage wxMessage) {
StringBuilder messageId = new StringBuilder();
if (wxMessage.getMsgId() == null) {
messageId.append(wxMessage.getCreateTime())
diff --git a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/WxMpMessageRouter.java b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/WxMpMessageRouter.java
index 070e952c0f..f2a28c668c 100644
--- a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/WxMpMessageRouter.java
+++ b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/WxMpMessageRouter.java
@@ -315,7 +315,7 @@ public WxMpXmlOutMessage route(String appid, final WxMpXmlMessage wxMessage) {
return this.route(appid, wxMessage, new HashMap<>(2));
}
- private boolean isMsgDuplicated(WxMpXmlMessage wxMessage) {
+ protected boolean isMsgDuplicated(WxMpXmlMessage wxMessage) {
StringBuilder messageId = new StringBuilder();
if (wxMessage.getMsgId() == null) {
messageId.append(wxMessage.getCreateTime())
From 6840722947445862620db495b48fbc6667b25761 Mon Sep 17 00:00:00 2001
From: Zeyes Lee
Date: Wed, 18 Dec 2024 22:40:10 +0800
Subject: [PATCH 028/326] =?UTF-8?q?:art:=20#3449=E3=80=90=E8=A7=86?=
=?UTF-8?q?=E9=A2=91=E5=8F=B7=E3=80=91=E8=AE=A2=E5=8D=95=E8=AF=A6=E6=83=85?=
=?UTF-8?q?=E5=92=8C=E5=88=86=E7=B1=BB=E8=AF=A6=E6=83=85=E6=8E=A5=E5=8F=A3?=
=?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=83=A8=E5=88=86=E5=AD=97=E6=AE=B5=EF=BC=8C?=
=?UTF-8?q?=E5=B9=B6=E5=A2=9E=E5=8A=A0=E6=96=B0=E5=A2=9E=E5=BA=93=E5=AD=98?=
=?UTF-8?q?=E4=B8=8D=E8=B6=B3=E3=80=81=E5=9B=A2=E8=B4=AD=E4=BC=98=E6=83=A0?=
=?UTF-8?q?=E5=8F=91=E6=94=BE=E7=9A=84=E5=9B=9E=E8=B0=83=E9=80=9A=E7=9F=A5?=
=?UTF-8?q?=E5=A4=84=E7=90=86=E6=96=B9=E6=B3=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../api/BaseWxChannelMessageService.java | 25 +++++
.../impl/BaseWxChannelMessageServiceImpl.java | 19 ++++
.../bean/category/CategoryDetailResult.java | 4 +
.../bean/category/CategoryQualification.java | 4 +
.../bean/message/product/SpuStockMessage.java | 88 +++++++++++++++
.../bean/message/voucher/VoucherInfo.java | 106 ++++++++++++++++++
.../bean/message/voucher/VoucherMessage.java | 29 +++++
.../channel/bean/order/OrderAgentInfo.java | 30 +++++
.../channel/bean/order/OrderDetailInfo.java | 8 ++
.../channel/bean/order/OrderSourceInfo.java | 48 ++++++++
.../constant/MessageEventConstants.java | 4 +
.../message/WxChannelMessageRouter.java | 7 +-
12 files changed, 369 insertions(+), 3 deletions(-)
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/message/product/SpuStockMessage.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/message/voucher/VoucherInfo.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/message/voucher/VoucherMessage.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/OrderAgentInfo.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/OrderSourceInfo.java
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/BaseWxChannelMessageService.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/BaseWxChannelMessageService.java
index 6f7be2f63f..a908da9479 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/BaseWxChannelMessageService.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/BaseWxChannelMessageService.java
@@ -20,11 +20,13 @@
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.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.WxChannelMessageRouterRule;
import me.chanjar.weixin.common.session.WxSessionManager;
@@ -197,6 +199,18 @@ void spuStatusUpdate(SpuAuditMessage message, final String content, final String
void spuUpdate(SpuAuditMessage message, final String content, final String appId, final Map context,
final WxSessionManager sessionManager);
+ /**
+ * 商品库存不足通知
+ *
+ * @param message 消息
+ * @param content 消息原始内容
+ * @param appId appId
+ * @param context 上下文
+ * @param sessionManager session管理器
+ */
+ void stockNoEnough(SpuStockMessage message, final String content, final String appId,
+ final Map context, final WxSessionManager sessionManager);
+
/**
* 类目审核结果
*
@@ -353,6 +367,17 @@ void userCouponUse(UserCouponExpireMessage message, final String content, final
void userCouponUnuse(UserCouponExpireMessage message, final String content, final String appId,
final Map context, final WxSessionManager sessionManager);
+ /**
+ * 发放团购优惠成功回调
+ *
+ * @param message 消息
+ * @param content 消息原始内容
+ * @param appId appId
+ * @param context 上下文
+ * @param sessionManager session管理器
+ */
+ void voucherSendSucc(VoucherMessage message, final String content, final String appId,
+ final Map context, final WxSessionManager sessionManager);
/**
* 结算账户变更回调
*
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 ea0ee6c444..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
@@ -23,12 +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;
@@ -64,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);
/* 订单下单 */
@@ -106,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);
/* 提现回调 */
@@ -151,6 +157,7 @@ protected void addRule(Class clazz, String event
consumer.accept(message, content, appId, context, sessionManager);
return "success";
});
+ rule.setNext(true);
this.addRule(rule);
}
@@ -242,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) {
@@ -320,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) {
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 a59559fb6c..32313b7e34 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
@@ -99,6 +99,10 @@ public static class Attr implements Serializable {
@JsonProperty("size_chart")
private SizeChart sizeChart;
+ /** 放心买必须打开坏损包赔 */
+ @JsonProperty("is_confidence_require_bad_must_pay")
+ private Boolean confidenceRequireBadMustPay;
+
/** 资质信息 */
@JsonProperty("product_qua_list")
private List productQuaList;
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 40258e067f..9cac327d6c 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
@@ -39,4 +39,8 @@ public class CategoryQualification implements Serializable {
@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/message/product/SpuStockMessage.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/message/product/SpuStockMessage.java
new file mode 100644
index 0000000000..96feac5a4a
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/message/product/SpuStockMessage.java
@@ -0,0 +1,88 @@
+package me.chanjar.weixin.channel.bean.message.product;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
+import java.util.Map;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import me.chanjar.weixin.channel.message.WxChannelMessage;
+
+/**
+ * SPU库存不足消息
+ *
+ * @author Zeyes
+ */
+@Data
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+@JacksonXmlRootElement(localName = "xml")
+public class SpuStockMessage extends WxChannelMessage {
+
+ private static final long serialVersionUID = 2250860804161527363L;
+
+ /** 商品id */
+ @JsonProperty("product_id")
+ @JacksonXmlProperty(localName = "product_id")
+ private String productId;
+
+ /** 平台商品id */
+ @JsonProperty("sku_id")
+ @JacksonXmlProperty(localName = "sku_id")
+ private String skuId;
+
+ /** 剩余库存:当前实时库存数量 */
+ @JsonProperty("remaining_stock_amount")
+ @JacksonXmlProperty(localName = "remaining_stock_amount")
+ private Long remainingStockAmount;
+
+ /** 未发放的预存code数【该字段对code_source_type=2的团购优惠生效,其他类型该字段值为0】 */
+ @JsonProperty("remaining_code_amount")
+ @JacksonXmlProperty(localName = "remaining_code_amount")
+ private Long remainingCodeAmount;
+
+ /** ChannelsEcStockNoEnough */
+ @JsonProperty("channels_ec_stock_no_enough")
+ @JacksonXmlProperty(localName = "channels_ec_stock_no_enough")
+ private void stockNoEnough(Map map) {
+ this.unpackNameFromNestedObject(map);
+ }
+
+ /**
+ * 从嵌套对象中解析字段
+ *
+ * @param map 嵌套对象
+ */
+ protected void unpackNameFromNestedObject(Map map) {
+ if (map == null) {
+ return;
+ }
+ Object obj = null;
+ obj = map.get("product_id");
+ if (obj != null) {
+ this.productId = (obj instanceof String ? (String) obj : String.valueOf(obj));
+ }
+ obj = map.get("sku_id");
+ if (obj != null) {
+ this.skuId = (obj instanceof String ? (String) obj : String.valueOf(obj));
+ }
+
+ obj = map.get("remaining_stock_amount");
+ if (obj != null) {
+ if (obj instanceof Number) {
+ this.remainingStockAmount = ((Number) obj).longValue();
+ } else if (obj instanceof String) {
+ this.remainingStockAmount = Long.parseLong((String) obj);
+ }
+ }
+ obj = map.get("remaining_code_amount");
+ if (obj != null) {
+ if (obj instanceof Number) {
+ this.remainingCodeAmount = ((Number) obj).longValue();
+ } else if (obj instanceof String) {
+ this.remainingCodeAmount = Long.parseLong((String) obj);
+ }
+ }
+ }
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/message/voucher/VoucherInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/message/voucher/VoucherInfo.java
new file mode 100644
index 0000000000..1b5a926205
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/message/voucher/VoucherInfo.java
@@ -0,0 +1,106 @@
+package me.chanjar.weixin.channel.bean.message.voucher;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * @author Zeyes
+ */
+@Data
+@NoArgsConstructor
+public class VoucherInfo implements Serializable {
+ private static final long serialVersionUID = 6007964849358969438L;
+
+ /** 券code */
+ @JsonProperty("code")
+ @JacksonXmlProperty(localName = "code")
+ private String code;
+
+ /** 劵码类型,1商户实时code 2户预存 3平台生成 */
+ @JsonProperty("code_type")
+ @JacksonXmlProperty(localName = "code_type")
+ private Integer codeType;
+
+ /** 券状态 */
+ @JsonProperty("status")
+ @JacksonXmlProperty(localName = "status")
+ private Integer status;
+
+ /** 发放时间,时间戳 */
+ @JsonProperty("send_time")
+ @JacksonXmlProperty(localName = "send_time")
+ private Long sendTime;
+
+ /** 最近更新时间,时间戳 */
+ @JsonProperty("update_time")
+ @JacksonXmlProperty(localName = "update_time")
+ private Long updateTime;
+
+ /** 核销生效时间,时间戳 */
+ @JsonProperty("start_time")
+ @JacksonXmlProperty(localName = "start_time")
+ private Long startTime;
+
+ /** 核销结束时间,时间戳 */
+ @JsonProperty("end_time")
+ @JacksonXmlProperty(localName = "end_time")
+ private Long endTime;
+
+ /** 核销时间,时间戳。次卡时不返回此字段 */
+ @JsonProperty("consume_time")
+ @JacksonXmlProperty(localName = "consume_time")
+ private Long consumeTime;
+
+ /** 退券时间,时间戳。次卡时不返回此字段 */
+ @JsonProperty("refund_time")
+ @JacksonXmlProperty(localName = "refund_time")
+ private Long refundTime;
+
+ /** 核销门店名称 */
+ @JsonProperty("consume_store_name")
+ @JacksonXmlProperty(localName = "consume_store_name")
+ private String consumeStoreName;
+
+ /** */
+ @JsonProperty("voucher_type")
+ @JacksonXmlProperty(localName = "voucher_type")
+ private Integer voucherType;
+
+ /** 券的售卖价格(分) */
+ @JsonProperty("voucher_buy_amount")
+ @JacksonXmlProperty(localName = "voucher_buy_amount")
+ private Integer voucherBuyAmount;
+
+ /** 券市场金额(分) */
+ @JsonProperty("voucher_actual_amount")
+ @JacksonXmlProperty(localName = "voucher_actual_amount")
+ private Integer voucherActualAmount;
+
+ /** 用户手机号 */
+ @JsonProperty("telphone_no")
+ @JacksonXmlProperty(localName = "telphone_no")
+ private String telPhoneNo;
+
+ /** 商品id */
+ @JsonProperty("product_id")
+ @JacksonXmlProperty(localName = "product_id")
+ private String productId;
+
+ /** 商品下的skuId */
+ @JsonProperty("sku_id")
+ @JacksonXmlProperty(localName = "sku_id")
+ private String skuId;
+
+ /** 购买券的订单id */
+ @JsonProperty("order_id")
+ @JacksonXmlProperty(localName = "order_id")
+ private String orderId;
+
+ /** 用户在商家品牌appid下的openid */
+ @JsonProperty("openid")
+ @JacksonXmlProperty(localName = "openid")
+ private String openId;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/message/voucher/VoucherMessage.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/message/voucher/VoucherMessage.java
new file mode 100644
index 0000000000..941828969d
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/message/voucher/VoucherMessage.java
@@ -0,0 +1,29 @@
+package me.chanjar.weixin.channel.bean.message.voucher;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
+import java.util.List;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import me.chanjar.weixin.channel.message.WxChannelMessage;
+
+/**
+ * 发放团购优惠成功消息
+ *
+ * @author Zeyes
+ */
+@Data
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+@JacksonXmlRootElement(localName = "xml")
+public class VoucherMessage extends WxChannelMessage {
+
+ private static final long serialVersionUID = 975858675917036089L;
+
+ /** 发放团购优惠成功消息 */
+ @JsonProperty("voucher_list")
+ @JacksonXmlProperty(localName = "voucher_list")
+ private List voucherInfo;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/OrderAgentInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/OrderAgentInfo.java
new file mode 100644
index 0000000000..548e36dd49
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/OrderAgentInfo.java
@@ -0,0 +1,30 @@
+package me.chanjar.weixin.channel.bean.order;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 授权账号信息
+ *
+ * @author Zeyes
+ */
+@Data
+@NoArgsConstructor
+public class OrderAgentInfo implements Serializable {
+
+ private static final long serialVersionUID = 6396067079343033841L;
+
+ /**
+ * 授权视频号id
+ */
+ @JsonProperty("agent_finder_id")
+ private String agentFinderId;
+
+ /**
+ * 授权视频号昵称
+ */
+ @JsonProperty("agent_finder_nickname")
+ private String agentFinderNickname;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/OrderDetailInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/OrderDetailInfo.java
index 8a17140cc1..282f2f99f6 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/OrderDetailInfo.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/OrderDetailInfo.java
@@ -56,4 +56,12 @@ public class OrderDetailInfo implements Serializable {
@JsonProperty("sku_sharer_infos")
private List skuSharerInfos;
+ /** 授权账号信息 */
+ @JsonProperty("agent_info")
+ private OrderAgentInfo agentInfo;
+
+ /** 订单来源信息 */
+ @JsonProperty("source_info")
+ private OrderSourceInfo sourceInfo;
+
}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/OrderSourceInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/OrderSourceInfo.java
new file mode 100644
index 0000000000..fbdd663a5a
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/OrderSourceInfo.java
@@ -0,0 +1,48 @@
+package me.chanjar.weixin.channel.bean.order;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 订单带货来源信息
+ *
+ * @author Zeyes
+ */
+@Data
+@NoArgsConstructor
+public class OrderSourceInfo implements Serializable {
+
+ private static final long serialVersionUID = 3131907659419977296L;
+
+ /**
+ * sku_id
+ */
+ @JsonProperty("sku_id")
+ private String skuId;
+
+ /**
+ * 带货账户类型,1:视频号,2:公众号,3:小程序
+ */
+ @JsonProperty("account_type")
+ private Integer accountType;
+
+ /**
+ * 带货账户id,如果带货账户类型是视频号,此id为视频号id; 如果带货类型为 公众号/小程序, 此id 为对应 公众号/小程序 的appid
+ */
+ @JsonProperty("account_id")
+ private String accountId;
+
+ /**
+ * 销售渠道, 0:关联账号,1:合作账号,100:联盟达人带货
+ */
+ @JsonProperty("sale_channel")
+ private Integer saleChannel;
+
+ /**
+ * 带货账户昵称
+ */
+ @JsonProperty("account_nickname")
+ private String accountNickname;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/constant/MessageEventConstants.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/constant/MessageEventConstants.java
index 0a945b1f35..675b5d8a57 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/constant/MessageEventConstants.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/constant/MessageEventConstants.java
@@ -16,6 +16,8 @@ public interface MessageEventConstants {
String PRODUCT_SPU_UPDATE = "product_spu_update";
/** 类目审核结果 */
String PRODUCT_CATEGORY_AUDIT = "product_category_audit";
+ /** 库存不足 */
+ String PRODUCT_STOCK_NO_ENOUGH = "channels_ec_stock_no_enough";
/** 订单下单 */
String ORDER_NEW = "channels_ec_order_new";
/** 订单取消 */
@@ -57,6 +59,8 @@ public interface MessageEventConstants {
String USER_COUPON_UNUSE = "channels_ec_user_coupon_unuse";
/** 优惠券核销通知 */
String USER_COUPON_USE = "channels_ec_user_coupon_use";
+ /** 发放团购优惠成功回调 */
+ String VOUCHER_SEND_SUCC = "channels_ec_voucher_send_succ";
// 资金相关
/** 结算账户变更回调 */
String ACCOUNT_NOTIFY = "channels_ec_acct_notify";
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/message/WxChannelMessageRouter.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/message/WxChannelMessageRouter.java
index 16fb0781cb..c35f75ac0b 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/message/WxChannelMessageRouter.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/message/WxChannelMessageRouter.java
@@ -121,6 +121,7 @@ public Object route(final WxChannelMessage message, final String content, final
final Map context, final WxChannelService service, final WxSessionManager sessionManager) {
// 如果是重复消息,那么就不做处理
if (isMsgDuplicated(message)) {
+ log.info("收到重复消息,{}", content);
return null;
}
@@ -211,10 +212,10 @@ protected String generateMessageId(WxChannelMessage wxMessage) {
*
* @param sessionManager session管理器
* @param message 消息
- * @param sync 是否同步 打印log用
+ * @param async 是否异步 打印log用
*/
- private void sessionEndAccess(WxSessionManager sessionManager, WxChannelMessage message, boolean sync) {
- log.debug("End session access: async={}, sessionId={}", sync, message.getFromUser());
+ private void sessionEndAccess(WxSessionManager sessionManager, WxChannelMessage message, boolean async) {
+ log.debug("End session access: async={}, sessionId={}", async, message.getFromUser());
InternalSession session = ((InternalSessionManager) sessionManager).findSession(message.getFromUser());
if (session != null) {
session.endAccess();
From 05c112309b00a5a1422753e52da3b569fc9e67e2 Mon Sep 17 00:00:00 2001
From: Binary Wang
Date: Wed, 18 Dec 2024 23:19:15 +0800
Subject: [PATCH 029/326] =?UTF-8?q?:art:=20#3439=20=E3=80=90=E5=85=AC?=
=?UTF-8?q?=E4=BC=97=E5=8F=B7=E3=80=91=E6=A8=A1=E7=89=88=E6=B6=88=E6=81=AF?=
=?UTF-8?q?=E9=95=BF=E5=BA=A6=E9=99=90=E5=88=B6=E9=97=AE=E9=A2=98=E4=BC=98?=
=?UTF-8?q?=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../mp/bean/template/WxMpTemplateMessage.java | 41 ++++++++++++++-----
.../template/WxMpTemplateMessageTest.java | 26 +++++++++++-
2 files changed, 55 insertions(+), 12 deletions(-)
diff --git a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/bean/template/WxMpTemplateMessage.java b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/bean/template/WxMpTemplateMessage.java
index a04d8bb896..02211937f9 100644
--- a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/bean/template/WxMpTemplateMessage.java
+++ b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/bean/template/WxMpTemplateMessage.java
@@ -1,20 +1,16 @@
package me.chanjar.weixin.mp.bean.template;
+import lombok.*;
+import me.chanjar.weixin.mp.util.json.WxMpGsonBuilder;
+import org.apache.commons.lang3.StringUtils;
+
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
-import lombok.AllArgsConstructor;
-import lombok.Builder;
-import lombok.Data;
-import lombok.Getter;
-import lombok.NoArgsConstructor;
-import lombok.Setter;
-import me.chanjar.weixin.mp.util.json.WxMpGsonBuilder;
-
/**
* 模板消息.
- * 参考 http://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1433751277&token=&lang=zh_CN 发送模板消息接口部分
+ * 参考 发送模板消息接口部分
*
* @author Binary Wang
*/
@@ -67,10 +63,35 @@ public WxMpTemplateMessage addData(WxMpTemplateData datum) {
if (this.data == null) {
this.data = new ArrayList<>();
}
- this.data.add(datum);
+ this.data.add(resetValue(datum));
return this;
}
+ /**
+ * 处理微信模版消息字符串长度问题
+ *
+ * @link 模板消息
+ */
+ private WxMpTemplateData resetValue(WxMpTemplateData datum) {
+ String name = datum.getName();
+ String value = datum.getValue();
+
+ if (StringUtils.startsWith(name, "thing") && value.length() > 20) {
+ value = StringUtils.substring(value, 0, 17) + "...";
+ } else if (StringUtils.startsWith(name, "character_string") && value.length() > 32) {
+ value = StringUtils.substring(value, 0, 29) + "...";
+ } else if (StringUtils.startsWith(name, "phone_number") && value.length() > 17) {
+ value = StringUtils.substring(value, 0, 14) + "...";
+ } else if (StringUtils.startsWith(name, "car_number") && value.length() > 8) {
+ value = StringUtils.substring(value, 0, 5) + "...";
+ } else if (StringUtils.startsWith(name, "const") && value.length() > 20) {
+ value = StringUtils.substring(value, 0, 17) + "...";
+ }
+
+ datum.setValue(value);
+ return datum;
+ }
+
public String toJson() {
return WxMpGsonBuilder.create().toJson(this);
}
diff --git a/weixin-java-mp/src/test/java/me/chanjar/weixin/mp/bean/template/WxMpTemplateMessageTest.java b/weixin-java-mp/src/test/java/me/chanjar/weixin/mp/bean/template/WxMpTemplateMessageTest.java
index fa7cd92967..5012be59a8 100644
--- a/weixin-java-mp/src/test/java/me/chanjar/weixin/mp/bean/template/WxMpTemplateMessageTest.java
+++ b/weixin-java-mp/src/test/java/me/chanjar/weixin/mp/bean/template/WxMpTemplateMessageTest.java
@@ -17,7 +17,7 @@ public void testToJson() {
WxMpTemplateMessage tm = WxMpTemplateMessage.builder()
.toUser("OPENID")
.templateId("ngqIpbwh8bUfcSsECmogfXcV14J0tQlEpBO27izEYtY")
- .miniProgram(new WxMpTemplateMessage.MiniProgram("xiaochengxuappid12345", "index?foo=bar",true))
+ .miniProgram(new WxMpTemplateMessage.MiniProgram("xiaochengxuappid12345", "index?foo=bar", true))
.url("http://weixin.qq.com/download")
.clientMsgId("MSG_000001")
.build();
@@ -26,7 +26,29 @@ public void testToJson() {
new WxMpTemplateData("first", "haahah", "#FF00FF"));
tm.addData(
new WxMpTemplateData("remark", "heihei", "#FF00FF"));
- assertEquals(tm.toJson(), "{\"touser\":\"OPENID\",\"template_id\":\"ngqIpbwh8bUfcSsECmogfXcV14J0tQlEpBO27izEYtY\",\"client_msg_id\":\"MSG_000001\",\"url\":\"http://weixin.qq.com/download\",\"miniprogram\":{\"appid\":\"xiaochengxuappid12345\",\"path\":\"index?foo=bar\"},\"data\":{\"first\":{\"value\":\"haahah\",\"color\":\"#FF00FF\"},\"remark\":{\"value\":\"heihei\",\"color\":\"#FF00FF\"}}}");
+
+ assertEquals("{\"touser\":\"OPENID\",\"template_id\":\"ngqIpbwh8bUfcSsECmogfXcV14J0tQlEpBO27izEYtY\",\"client_msg_id\":\"MSG_000001\",\"url\":\"http://weixin.qq.com/download\",\"miniprogram\":{\"appid\":\"xiaochengxuappid12345\",\"path\":\"index?foo=bar\"},\"data\":{\"first\":{\"value\":\"haahah\",\"color\":\"#FF00FF\"},\"remark\":{\"value\":\"heihei\",\"color\":\"#FF00FF\"}}}", tm.toJson());
}
+ @Test
+ public void testAddData() {
+ WxMpTemplateMessage tm = WxMpTemplateMessage.builder().build()
+ .addData(new WxMpTemplateData("thing01", "张三李四王麻子张三李四王麻子张三李四王麻子张三李四王麻子"))
+ .addData(new WxMpTemplateData("time01", "2019年10月1日 15:01"))
+ .addData(new WxMpTemplateData("character_string01", "1234567890123456789012345678901234567890"))
+ .addData(new WxMpTemplateData("amount01", "¥100.21"))
+ .addData(new WxMpTemplateData("phone_number01", "+86-0766-668888661111"))
+ .addData(new WxMpTemplateData("car_number01", "粤A8Z888挂9"))
+ .addData(new WxMpTemplateData("const01", "支付状态、排队状态、天气状态、物流状态、用药提醒、还款提醒"));
+
+ assertEquals(7, tm.getData().size());
+
+ assertEquals("张三李四王麻子张三李四王麻子张三李...", tm.getData().get(0).getValue());
+ assertEquals("2019年10月1日 15:01", tm.getData().get(1).getValue());
+ assertEquals("12345678901234567890123456789...", tm.getData().get(2).getValue());
+ assertEquals("¥100.21", tm.getData().get(3).getValue());
+ assertEquals("+86-0766-66888...", tm.getData().get(4).getValue());
+ assertEquals("粤A8Z8...", tm.getData().get(5).getValue());
+ assertEquals("支付状态、排队状态、天气状态、物流...", tm.getData().get(6).getValue());
+ }
}
From 29a76bcfae02445c01faba0261ded7dd91a428a3 Mon Sep 17 00:00:00 2001
From: GeXiangDong
Date: Fri, 20 Dec 2024 15:46:13 +0800
Subject: [PATCH 030/326] =?UTF-8?q?:art:=20#3453=20=E3=80=90=E5=B0=8F?=
=?UTF-8?q?=E7=A8=8B=E5=BA=8F=E3=80=91=E4=BF=AE=E5=A4=8D=E5=90=8C=E5=9F=8E?=
=?UTF-8?q?=E9=85=8D=E9=80=81=E6=9F=A5=E8=AF=A2=E8=BF=90=E8=B4=B9=E6=8E=A5?=
=?UTF-8?q?=E5=8F=A3=E8=BF=94=E5=9B=9E=E5=8F=82=E6=95=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../wx/miniapp/api/WxMaIntracityService.java | 2 +-
.../api/impl/WxMaIntracityServiceImpl.java | 5 +-
.../intractiy/WxMaPreAddOrderResponse.java | 63 +++++++++++++++++++
.../impl/WxMaIntracityServiceImpleTest.java | 4 +-
4 files changed, 69 insertions(+), 5 deletions(-)
create mode 100644 weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/intractiy/WxMaPreAddOrderResponse.java
diff --git a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/WxMaIntracityService.java b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/WxMaIntracityService.java
index 80cd88b463..4359fc7b1c 100644
--- a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/WxMaIntracityService.java
+++ b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/WxMaIntracityService.java
@@ -57,7 +57,7 @@ WxMaStoreBalance balanceQuery(String wxStoreId, String serviceTransId, PayMode p
WxMaGetPayModeResponse getPayMode() throws WxErrorException;
/** 查询运费 */
- WxMaAddOrderResponse preAddOrder(WxMaPreAddOrderRequest request) throws WxErrorException;
+ WxMaPreAddOrderResponse preAddOrder(WxMaPreAddOrderRequest request) throws WxErrorException;
/** 创建配送单 */
WxMaAddOrderResponse addOrder(WxMaAddOrderRequest order) throws WxErrorException;
diff --git a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/WxMaIntracityServiceImpl.java b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/WxMaIntracityServiceImpl.java
index 46a728eca9..3e21dab79f 100644
--- a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/WxMaIntracityServiceImpl.java
+++ b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/WxMaIntracityServiceImpl.java
@@ -205,9 +205,10 @@ public WxMaGetPayModeResponse getPayMode() throws WxErrorException {
}
@Override
- public WxMaAddOrderResponse preAddOrder(WxMaPreAddOrderRequest request) throws WxErrorException {
+ public WxMaPreAddOrderResponse preAddOrder(WxMaPreAddOrderRequest request)
+ throws WxErrorException {
String response = this.wxMaService.postWithSignature(Intracity.PRE_ADD_ORDER, request);
- return gson.fromJson(response, WxMaAddOrderResponse.class);
+ return gson.fromJson(response, WxMaPreAddOrderResponse.class);
}
@Override
diff --git a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/intractiy/WxMaPreAddOrderResponse.java b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/intractiy/WxMaPreAddOrderResponse.java
new file mode 100644
index 0000000000..f198c81baa
--- /dev/null
+++ b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/intractiy/WxMaPreAddOrderResponse.java
@@ -0,0 +1,63 @@
+package cn.binarywang.wx.miniapp.bean.intractiy;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class WxMaPreAddOrderResponse {
+ private static final Logger logger = LoggerFactory.getLogger(WxMaPreAddOrderResponse.class);
+
+ /** 运力公司ID */
+ private String serviceTransId;
+
+ /** 配送距离 */
+ private int distance;
+
+ /** 预估配送费 */
+ private int estFee;
+
+ /** 商品预计送达时间 */
+ private long expectedFinishedTime;
+
+ /** 配送时长(单位:分钟) */
+ private int promiseDeliveryTime;
+
+ public String getServiceTransId() {
+ return serviceTransId;
+ }
+
+ public void setServiceTransId(String serviceTransId) {
+ this.serviceTransId = serviceTransId;
+ }
+
+ public int getDistance() {
+ return distance;
+ }
+
+ public void setDistance(int distance) {
+ this.distance = distance;
+ }
+
+ public int getEstFee() {
+ return estFee;
+ }
+
+ public void setEstFee(int estFee) {
+ this.estFee = estFee;
+ }
+
+ public long getExpectedFinishedTime() {
+ return expectedFinishedTime;
+ }
+
+ public void setExpectedFinishedTime(long expectedFinishedTime) {
+ this.expectedFinishedTime = expectedFinishedTime;
+ }
+
+ public int getPromiseDeliveryTime() {
+ return promiseDeliveryTime;
+ }
+
+ public void setPromiseDeliveryTime(int promiseDeliveryTime) {
+ this.promiseDeliveryTime = promiseDeliveryTime;
+ }
+}
diff --git a/weixin-java-miniapp/src/test/java/cn/binarywang/wx/miniapp/api/impl/WxMaIntracityServiceImpleTest.java b/weixin-java-miniapp/src/test/java/cn/binarywang/wx/miniapp/api/impl/WxMaIntracityServiceImpleTest.java
index 9828542a46..e16fc424c7 100644
--- a/weixin-java-miniapp/src/test/java/cn/binarywang/wx/miniapp/api/impl/WxMaIntracityServiceImpleTest.java
+++ b/weixin-java-miniapp/src/test/java/cn/binarywang/wx/miniapp/api/impl/WxMaIntracityServiceImpleTest.java
@@ -254,8 +254,8 @@ public void testOrderRelatived() throws Exception {
cargo.setCargoPrice(10000);
cargo.setCargoWeight(1000);
request.setCargo(cargo);
- WxMaAddOrderResponse response = wxService.getIntracityService().preAddOrder(request);
- logger.debug("查询运费返回 {}, 预估运费{}元", response, response.getFee() / 100.0);
+ WxMaPreAddOrderResponse response = wxService.getIntracityService().preAddOrder(request);
+ logger.debug("查询运费返回 {}, 预估运费{}元", response, response.getEstFee() / 100.0);
}
String wxOrderId = null;
{
From 5ece315b87619aa58762560868a16121737bd387 Mon Sep 17 00:00:00 2001
From: Molzx <31435895+Molzx@users.noreply.github.com>
Date: Sat, 21 Dec 2024 14:02:43 +0800
Subject: [PATCH 031/326] =?UTF-8?q?:new:=20#3455=20=E3=80=90=E5=BC=80?=
=?UTF-8?q?=E6=94=BE=E5=B9=B3=E5=8F=B0=E3=80=91=E5=A2=9E=E5=8A=A0=E5=B0=8F?=
=?UTF-8?q?=E7=A8=8B=E5=BA=8F=E8=AE=A4=E8=AF=81=E5=8F=8A=E5=A4=87=E6=A1=88?=
=?UTF-8?q?=E7=9B=B8=E5=85=B3=E6=8E=A5=E5=8F=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../weixin/open/api/WxOpenMaIcpService.java | 40 +++++++++
.../open/api/impl/WxOpenMaIcpServiceImpl.java | 44 +++++++++-
.../bean/icp/WxOpenApplyIcpFilingParam.java | 3 +-
.../WxOpenIcpCreateIcpVerifyTaskResult.java | 5 ++
.../bean/icp/WxOpenIcpVerifyTaskResult.java | 6 ++
.../bean/icp/WxOpenQueryAuthAndIcpResult.java | 85 +++++++++++++++++++
.../bean/icp/WxOpenSubmitAuthAndIcpParam.java | 29 +++++++
.../icp/WxOpenSubmitAuthAndIcpResult.java | 30 +++++++
.../open/bean/message/WxOpenXmlMessage.java | 19 +++++
9 files changed, 259 insertions(+), 2 deletions(-)
create mode 100644 weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/icp/WxOpenQueryAuthAndIcpResult.java
create mode 100644 weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/icp/WxOpenSubmitAuthAndIcpParam.java
create mode 100644 weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/icp/WxOpenSubmitAuthAndIcpResult.java
diff --git a/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/WxOpenMaIcpService.java b/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/WxOpenMaIcpService.java
index ad59b246c7..9b936b1572 100644
--- a/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/WxOpenMaIcpService.java
+++ b/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/WxOpenMaIcpService.java
@@ -97,6 +97,19 @@ public interface WxOpenMaIcpService {
*/
String GET_ICP_MEDIA = "https://api.weixin.qq.com/wxa/icp/get_icp_media";
+ /**
+ * 申请小程序认证及备案
+ * https://developers.weixin.qq.com/doc/oplatform/openApi/OpenApiDoc/miniprogram-management/wxverifyicp/submitAuthAndIcp.html
+ */
+ String SUBMIT_AUTH_AND_ICP = "https://api.weixin.qq.com/wxa/sec/submit_auth_and_icp";
+
+ /**
+ * 查询小程序认证及备案进度
+ * https://developers.weixin.qq.com/doc/oplatform/openApi/OpenApiDoc/miniprogram-management/wxverifyicp/queryAuthAndIcp.html
+ */
+ String QUERY_AUTH_AND_ICP = "https://api.weixin.qq.com/wxa/sec/query_auth_and_icp";
+
+
/**
* 查询人脸核身任务状态
*
@@ -114,6 +127,15 @@ public interface WxOpenMaIcpService {
*/
WxOpenIcpCreateIcpVerifyTaskResult createIcpVerifyTask() throws WxErrorException;
+ /**
+ * 发起小程序管理员人脸核身
+ *
+ * @param alongWithAuth 小程序认证及备案二合一场景,填 true,否则为小程序备案场景。默认值为 false。
+ * @return 人脸核验任务结果
+ * @throws WxErrorException e
+ */
+ WxOpenIcpCreateIcpVerifyTaskResult createIcpVerifyTask(boolean alongWithAuth) throws WxErrorException;
+
/**
* 上传小程序备案媒体材料
*
@@ -204,4 +226,22 @@ public interface WxOpenMaIcpService {
* @throws WxErrorException e
*/
File getIcpMedia(String mediaId) throws WxErrorException;
+
+ /**
+ * 申请小程序认证及备案
+ *
+ * @param param 参数
+ * @return r
+ * @throws WxErrorException e
+ */
+ WxOpenSubmitAuthAndIcpResult submitAuthAndIcp(WxOpenSubmitAuthAndIcpParam param) throws WxErrorException;
+
+ /**
+ * 查询小程序认证及备案进度
+ * @param procedureId 小程序认证及备案任务流程id
+ * @return r
+ * @throws WxErrorException e
+ */
+ WxOpenQueryAuthAndIcpResult queryAuthAndIcp(String procedureId) throws WxErrorException;
+
}
diff --git a/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/impl/WxOpenMaIcpServiceImpl.java b/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/impl/WxOpenMaIcpServiceImpl.java
index dc78f22fe3..db9654f287 100644
--- a/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/impl/WxOpenMaIcpServiceImpl.java
+++ b/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/impl/WxOpenMaIcpServiceImpl.java
@@ -54,7 +54,21 @@ public WxOpenIcpVerifyTaskResult queryIcpVerifyTask(String taskId) throws WxErro
*/
@Override
public WxOpenIcpCreateIcpVerifyTaskResult createIcpVerifyTask() throws WxErrorException {
- String response = wxMaService.post(CREATE_ICP_VERIFY_TASK, "");
+ return createIcpVerifyTask(false);
+ }
+
+ /**
+ * 发起小程序管理员人脸核身
+ *
+ * @param alongWithAuth 小程序认证及备案二合一场景,填 true,否则为小程序备案场景。默认值为 false。
+ * @return 人脸核验任务结果
+ * @throws WxErrorException e
+ */
+ @Override
+ public WxOpenIcpCreateIcpVerifyTaskResult createIcpVerifyTask(boolean alongWithAuth) throws WxErrorException {
+ JsonObject params = new JsonObject();
+ params.addProperty("along_with_auth", alongWithAuth);
+ String response = wxMaService.post(CREATE_ICP_VERIFY_TASK, params);
return WxMaGsonBuilder.create().fromJson(response, WxOpenIcpCreateIcpVerifyTaskResult.class);
}
@@ -212,4 +226,32 @@ public File getIcpMedia(String mediaId) throws WxErrorException {
throw new WxErrorException(WxError.builder().errorMsg(e.getMessage()).build(), e);
}
}
+
+ /**
+ * 申请小程序认证及备案
+ *
+ * @param param 参数
+ * @return r
+ * @throws WxErrorException e
+ */
+ @Override
+ public WxOpenSubmitAuthAndIcpResult submitAuthAndIcp(WxOpenSubmitAuthAndIcpParam param) throws WxErrorException {
+ String response = wxMaService.post(SUBMIT_AUTH_AND_ICP, param);
+ return WxMaGsonBuilder.create().fromJson(response, WxOpenSubmitAuthAndIcpResult.class);
+ }
+
+ /**
+ * 查询小程序认证及备案进度
+ *
+ * @param procedureId 小程序认证及备案任务流程id
+ * @return r
+ * @throws WxErrorException e
+ */
+ @Override
+ public WxOpenQueryAuthAndIcpResult queryAuthAndIcp(String procedureId) throws WxErrorException {
+ JsonObject params = new JsonObject();
+ params.addProperty("procedure_id", procedureId);
+ String response = wxMaService.post(QUERY_AUTH_AND_ICP, params);
+ return WxOpenGsonBuilder.create().fromJson(response, WxOpenQueryAuthAndIcpResult.class);
+ }
}
diff --git a/weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/icp/WxOpenApplyIcpFilingParam.java b/weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/icp/WxOpenApplyIcpFilingParam.java
index 37f84cf3d5..ef24a5360c 100644
--- a/weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/icp/WxOpenApplyIcpFilingParam.java
+++ b/weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/icp/WxOpenApplyIcpFilingParam.java
@@ -2,6 +2,7 @@
import com.google.gson.annotations.SerializedName;
import lombok.*;
+import lombok.experimental.SuperBuilder;
import java.io.Serializable;
import java.util.List;
@@ -12,7 +13,7 @@
* @createTime 2024/08/14 15:09
*/
@Data
-@Builder
+@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
public class WxOpenApplyIcpFilingParam implements Serializable {
diff --git a/weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/icp/WxOpenIcpCreateIcpVerifyTaskResult.java b/weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/icp/WxOpenIcpCreateIcpVerifyTaskResult.java
index 8deb401335..967e81fa95 100644
--- a/weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/icp/WxOpenIcpCreateIcpVerifyTaskResult.java
+++ b/weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/icp/WxOpenIcpCreateIcpVerifyTaskResult.java
@@ -26,4 +26,9 @@ public class WxOpenIcpCreateIcpVerifyTaskResult extends WxOpenResult {
@SerializedName("task_id")
private String taskId;
+ /**
+ * 人脸核验任务url,along_with_auth 填 true 时返回。
+ */
+ @SerializedName("verify_url")
+ private String verifyUrl;
}
diff --git a/weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/icp/WxOpenIcpVerifyTaskResult.java b/weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/icp/WxOpenIcpVerifyTaskResult.java
index cb59fac1c0..5290748b2a 100644
--- a/weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/icp/WxOpenIcpVerifyTaskResult.java
+++ b/weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/icp/WxOpenIcpVerifyTaskResult.java
@@ -30,4 +30,10 @@ public class WxOpenIcpVerifyTaskResult extends WxOpenResult {
*/
@SerializedName("face_status")
private Integer faceStatus;
+
+ /**
+ * 发起时 along_with_auth 填 true 时有效:9. 认证短信核验通过。
+ */
+ @SerializedName("along_with_auth_result")
+ private Integer alongWithAuthResult;
}
diff --git a/weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/icp/WxOpenQueryAuthAndIcpResult.java b/weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/icp/WxOpenQueryAuthAndIcpResult.java
new file mode 100644
index 0000000000..42a996d9b4
--- /dev/null
+++ b/weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/icp/WxOpenQueryAuthAndIcpResult.java
@@ -0,0 +1,85 @@
+package me.chanjar.weixin.open.bean.icp;
+
+import com.google.gson.annotations.SerializedName;
+import lombok.*;
+import me.chanjar.weixin.open.bean.result.WxOpenResult;
+
+import java.util.List;
+
+/**
+ * @author xzh
+ * @Description
+ * @createTime 2024/12/19 16:56
+ */
+@Getter
+@Setter
+@NoArgsConstructor
+public class WxOpenQueryAuthAndIcpResult extends WxOpenResult {
+ private static final long serialVersionUID = 1626895037788760364L;
+
+
+ /**
+ * 当前任务流程状态,见下方任务流程状态枚举
+ * 值 含义
+ * 15 等待支付认证审核费用
+ * 16 认证审核费用支付成功
+ * 17 认证审核中
+ * 18 认证审核驳回
+ * 19 认证审核通过
+ * 20 认证审核最终失败(不能再修改)
+ * 21 创建备案审核单失败
+ * 22 备案平台审核中
+ * 23 备案平台审核驳回
+ * 24 备案管局审核中
+ * 25 管局审核驳回
+ * 26 认证及备案完成
+ */
+ @SerializedName("procedure_status")
+ private Integer procedureStatus;
+
+ /**
+ * 小程序后台展示的认证订单号
+ */
+ @SerializedName("orderid")
+ private Long orderId;
+
+ /**
+ * 小程序认证审核单被驳回(procedure_status 为 18)时有效
+ */
+ @SerializedName("refill_reason")
+ private String refillReason;
+ /**
+ * 小程序认证审核最终失败的原因(procedure_status 为 20)时有效
+ */
+ @SerializedName("fail_reason")
+ private String failReason;
+
+ /**
+ * 小程序备案相关信息
+ */
+ @SerializedName("icp_audit")
+ private IcpAudit icpAudit;
+
+ @Data
+ public static class IcpAudit {
+
+ /**
+ * 错误提示,创建备案审核单失败时返回(procedure_status 为 21)
+ */
+ @SerializedName("hints")
+ private List hints;
+
+ /**
+ * 驳回原因,备案不通过时返回(procedure_status 为 23、25)
+ */
+ @SerializedName("audit_data")
+ private List auditData;
+
+ /**
+ * 管局短信核验状态,仅当任务流程状态为 24(备案管局审核中)的时候才有效。1:等待核验中,2:核验完成,3:核验超时。
+ */
+ @SerializedName("sms_verify_status")
+ private Integer smsVerifyStatus;
+ }
+
+}
diff --git a/weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/icp/WxOpenSubmitAuthAndIcpParam.java b/weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/icp/WxOpenSubmitAuthAndIcpParam.java
new file mode 100644
index 0000000000..31d4f158f8
--- /dev/null
+++ b/weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/icp/WxOpenSubmitAuthAndIcpParam.java
@@ -0,0 +1,29 @@
+package me.chanjar.weixin.open.bean.icp;
+
+import com.google.gson.annotations.SerializedName;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import lombok.experimental.SuperBuilder;
+import me.chanjar.weixin.open.bean.auth.MaAuthSubmitParamAuthData;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author xzh
+ * @Description
+ * @createTime 2024/12/19 16:42
+ */
+@Data
+@SuperBuilder
+@NoArgsConstructor
+@AllArgsConstructor
+public class WxOpenSubmitAuthAndIcpParam extends WxOpenApplyIcpFilingParam {
+ private static final long serialVersionUID = -1302523168779484802L;
+
+ /**
+ * 认证信息
+ */
+ @NotNull
+ @SerializedName("auth_data")
+ private MaAuthSubmitParamAuthData authData;
+}
diff --git a/weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/icp/WxOpenSubmitAuthAndIcpResult.java b/weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/icp/WxOpenSubmitAuthAndIcpResult.java
new file mode 100644
index 0000000000..53f04412f5
--- /dev/null
+++ b/weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/icp/WxOpenSubmitAuthAndIcpResult.java
@@ -0,0 +1,30 @@
+package me.chanjar.weixin.open.bean.icp;
+
+import com.google.gson.annotations.SerializedName;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+
+/**
+ * @author xzh
+ * @Description
+ * @createTime 2024/12/19 16:47
+ */
+@Getter
+@Setter
+@NoArgsConstructor
+public class WxOpenSubmitAuthAndIcpResult extends WxOpenApplyIcpFilingResult {
+ private static final long serialVersionUID = 2338143380820535842L;
+
+ /**
+ * 小程序认证及备案任务流程 id
+ */
+ @SerializedName("procedure_id")
+ private String procedureId;
+
+ /**
+ * 小程序认证认证审核费用付费链接,当 pay_type 为 2 时返回
+ */
+ @SerializedName("pay_url")
+ private String payUrl;
+}
diff --git a/weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/message/WxOpenXmlMessage.java b/weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/message/WxOpenXmlMessage.java
index dc6839c1a5..df782e6a0c 100644
--- a/weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/message/WxOpenXmlMessage.java
+++ b/weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/message/WxOpenXmlMessage.java
@@ -140,6 +140,11 @@ public class WxOpenXmlMessage implements Serializable {
*/
@XStreamAlias("result")
private Integer result;
+ /**
+ * 发起时 along_with_auth 填 true 时有效:9. 认证短信核验通过。
+ */
+ @XStreamAlias("along_with_auth_result")
+ private Integer alongWithAuthResult;
//endregion
//region 当备案审核被驳回或通过时会推送该事件 推送的消息 infoType=notify_apply_icpfiling_result
@@ -155,6 +160,20 @@ public class WxOpenXmlMessage implements Serializable {
private Integer beianStatus;
//endregion
+ //region 认证及备案流程的主要节点均有事件推送到第三方平台的授权事件接收接口,包括支付完成、派单给审核机构、审核打回、审核通过、审核失败等。消息类型,固定为 notify_3rd_wxa_auth_and_icp
+
+ /**
+ * 小程序认证及备案任务流程 id
+ */
+ @XStreamAlias("procedure_id")
+ private String procedureId;
+ /**
+ * 当前任务流程状态,见“小程序认证及备案进度查询” API 文档中的任务流程状态枚举
+ */
+ @XStreamAlias("procedure_status")
+ private Integer procedureStatus;
+ //endregion
+
/**
* 快速创建的小程序appId,已弃用,未来将删除
*
From 16f2922fd5f9ff7ab13975fb33498a41219013f8 Mon Sep 17 00:00:00 2001
From: Molzx <31435895+Molzx@users.noreply.github.com>
Date: Tue, 24 Dec 2024 13:19:14 +0800
Subject: [PATCH 032/326] =?UTF-8?q?:new:=20=20#3457=E3=80=90=E5=B0=8F?=
=?UTF-8?q?=E7=A8=8B=E5=BA=8F=E3=80=91=E5=A2=9E=E5=8A=A0=E5=8F=91=E8=B4=A7?=
=?UTF-8?q?=E4=BF=A1=E6=81=AF=E7=AE=A1=E7=90=86=E9=87=8C=E7=9A=84=E7=89=B9?=
=?UTF-8?q?=E6=AE=8A=E5=8F=91=E8=B4=A7=E6=8A=A5=E5=A4=87=E6=8E=A5=E5=8F=A3?=
=?UTF-8?q?=E5=92=8C=E6=9F=A5=E8=AF=A2=E5=B0=8F=E7=A8=8B=E5=BA=8F=E6=98=AF?=
=?UTF-8?q?=E5=90=A6=E5=B7=B2=E5=AE=8C=E6=88=90=E4=BA=A4=E6=98=93=E7=BB=93?=
=?UTF-8?q?=E7=AE=97=E7=AE=A1=E7=90=86=E7=A1=AE=E8=AE=A4=E7=9A=84=E6=8E=A5?=
=?UTF-8?q?=E5=8F=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../miniapp/api/WxMaOrderShippingService.java | 26 +++++++++++---
.../impl/WxMaOrderShippingServiceImpl.java | 33 +++++++++++++++---
.../WxMaOrderShippingITMCCompletedResult.java | 34 +++++++++++++++++++
.../miniapp/constant/WxMaApiUrlConstants.java | 18 ++++++++++
4 files changed, 103 insertions(+), 8 deletions(-)
create mode 100644 weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/shop/response/WxMaOrderShippingITMCCompletedResult.java
diff --git a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/WxMaOrderShippingService.java b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/WxMaOrderShippingService.java
index 322d740d5b..8332ae7af4 100644
--- a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/WxMaOrderShippingService.java
+++ b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/WxMaOrderShippingService.java
@@ -1,10 +1,7 @@
package cn.binarywang.wx.miniapp.api;
import cn.binarywang.wx.miniapp.bean.shop.request.shipping.*;
-import cn.binarywang.wx.miniapp.bean.shop.response.WxMaOrderShippingInfoBaseResponse;
-import cn.binarywang.wx.miniapp.bean.shop.response.WxMaOrderShippingInfoGetListResponse;
-import cn.binarywang.wx.miniapp.bean.shop.response.WxMaOrderShippingInfoGetResponse;
-import cn.binarywang.wx.miniapp.bean.shop.response.WxMaOrderShippingIsTradeManagedResponse;
+import cn.binarywang.wx.miniapp.bean.shop.response.*;
import me.chanjar.weixin.common.error.WxErrorException;
/**
@@ -86,4 +83,25 @@ WxMaOrderShippingInfoBaseResponse notifyConfirmReceive(WxMaOrderShippingInfoNoti
*/
WxMaOrderShippingInfoBaseResponse setMsgJumpPath(String path)
throws WxErrorException;
+
+ /**
+ * 查询小程序是否已完成交易结算管理确认
+ *
+ * @param appId 待查询小程序的 appid,非服务商调用时仅能查询本账号
+ * @return WxMaOrderShippingITMCCompletedResult
+ * @throws WxErrorException e
+ */
+ WxMaOrderShippingITMCCompletedResult isTradeManagementConfirmationCompleted(String appId)
+ throws WxErrorException;
+
+ /**
+ * 特殊发货报备
+ * @param orderId 需要特殊发货报备的订单号,可传入微信支付单号或商户单号
+ * @param type 特殊发货报备类型,1为预售商品订单,2为测试订单
+ * @param delayTo 预计发货时间的unix时间戳,type为1时必填,type为2可省略
+ * @return WxMaOrderShippingInfoBaseResponse
+ * @throws WxErrorException e
+ */
+ WxMaOrderShippingInfoBaseResponse opSpecialOrder(String orderId, Integer type, Long delayTo)
+ throws WxErrorException;
}
diff --git a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/WxMaOrderShippingServiceImpl.java b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/WxMaOrderShippingServiceImpl.java
index 4aee53e15d..98135cb466 100644
--- a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/WxMaOrderShippingServiceImpl.java
+++ b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/WxMaOrderShippingServiceImpl.java
@@ -4,10 +4,7 @@
import cn.binarywang.wx.miniapp.api.WxMaService;
import cn.binarywang.wx.miniapp.bean.shop.request.WxMaOrderShippingIsTradeManagedRequest;
import cn.binarywang.wx.miniapp.bean.shop.request.shipping.*;
-import cn.binarywang.wx.miniapp.bean.shop.response.WxMaOrderShippingInfoBaseResponse;
-import cn.binarywang.wx.miniapp.bean.shop.response.WxMaOrderShippingInfoGetListResponse;
-import cn.binarywang.wx.miniapp.bean.shop.response.WxMaOrderShippingInfoGetResponse;
-import cn.binarywang.wx.miniapp.bean.shop.response.WxMaOrderShippingIsTradeManagedResponse;
+import cn.binarywang.wx.miniapp.bean.shop.response.*;
import cn.binarywang.wx.miniapp.json.WxMaGsonBuilder;
import com.google.gson.JsonObject;
import lombok.RequiredArgsConstructor;
@@ -123,6 +120,34 @@ public WxMaOrderShippingInfoBaseResponse setMsgJumpPath(String path) throws WxEr
return request(SET_MSG_JUMP_PATH, jsonObject, WxMaOrderShippingInfoBaseResponse.class);
}
+ /**
+ * 查询小程序是否已完成交易结算管理确认
+ *
+ * @param appId 待查询小程序的 appid,非服务商调用时仅能查询本账号
+ * @return WxMaOrderShippingITMCCompletedResult
+ * @throws WxErrorException e
+ */
+ @Override
+ public WxMaOrderShippingITMCCompletedResult isTradeManagementConfirmationCompleted(String appId) throws WxErrorException {
+ JsonObject jsonObject = GsonHelper.buildJsonObject("appid", appId);
+ return request(IS_TRADE_MANAGEMENT_CONFIRMATION_COMPLETED, jsonObject, WxMaOrderShippingITMCCompletedResult.class);
+ }
+
+ /**
+ * 特殊发货报备
+ *
+ * @param orderId 需要特殊发货报备的订单号,可传入微信支付单号或商户单号
+ * @param type 特殊发货报备类型,1为预售商品订单,2为测试订单
+ * @param delayTo 预计发货时间的unix时间戳,type为1时必填,type为2可省略
+ * @return WxMaOrderShippingInfoBaseResponse
+ * @throws WxErrorException e
+ */
+ @Override
+ public WxMaOrderShippingInfoBaseResponse opSpecialOrder(String orderId, Integer type, Long delayTo) throws WxErrorException {
+ JsonObject jsonObject = GsonHelper.buildJsonObject("order_id", orderId, "type", type, "delay_to", delayTo);
+ return request(OP_SPECIAL_ORDER, jsonObject, WxMaOrderShippingInfoBaseResponse.class);
+ }
+
private T request(String url, Object request, Class resultT) throws WxErrorException {
String responseContent = this.wxMaService.post(url, request);
JsonObject jsonObject = GsonParser.parse(responseContent);
diff --git a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/shop/response/WxMaOrderShippingITMCCompletedResult.java b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/shop/response/WxMaOrderShippingITMCCompletedResult.java
new file mode 100644
index 0000000000..e2f352a543
--- /dev/null
+++ b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/shop/response/WxMaOrderShippingITMCCompletedResult.java
@@ -0,0 +1,34 @@
+package cn.binarywang.wx.miniapp.bean.shop.response;
+
+import com.google.gson.annotations.SerializedName;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @author xzh
+ * @Description 小程序是否已完成交易结算管理确认结果
+ * @createTime 2024/12/21 15:01
+ */
+@Data
+public class WxMaOrderShippingITMCCompletedResult implements Serializable {
+
+ private static final long serialVersionUID = -5397007157487018762L;
+ /**
+ * 错误码
+ */
+ @SerializedName("errcode")
+ private Integer errCode;
+
+ /**
+ * 错误原因
+ */
+ @SerializedName("errmsg")
+ private String errMsg;
+
+ /**
+ * 是否已完成交易结算管理确认
+ */
+ @SerializedName("completed")
+ private Boolean completed;
+}
diff --git a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/constant/WxMaApiUrlConstants.java b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/constant/WxMaApiUrlConstants.java
index ab47d3e64d..5908385790 100644
--- a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/constant/WxMaApiUrlConstants.java
+++ b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/constant/WxMaApiUrlConstants.java
@@ -789,6 +789,24 @@ public interface OrderShipping {
*
*/
String SET_MSG_JUMP_PATH = "https://api.weixin.qq.com/wxa/sec/order/set_msg_jump_path";
+
+ /**
+ * 查询小程序是否已完成交易结算管理确认.
+ *
+ *
+ * 文档地址: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/order-shipping/order-shipping.html#%E5%85%AB%E3%80%81%E6%9F%A5%E8%AF%A2%E5%B0%8F%E7%A8%8B%E5%BA%8F%E6%98%AF%E5%90%A6%E5%B7%B2%E5%AE%8C%E6%88%90%E4%BA%A4%E6%98%93%E7%BB%93%E7%AE%97%E7%AE%A1%E7%90%86%E7%A1%AE%E8%AE%A4
+ *
+ */
+ String IS_TRADE_MANAGEMENT_CONFIRMATION_COMPLETED = "https://api.weixin.qq.com/wxa/sec/order/is_trade_management_confirmation_completed";
+ /**
+ * 特殊发货报备.
+ *
+ *
+ * 文档地址:https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/order-shipping/order-shipping.html#%E5%8D%81%E3%80%81%E7%89%B9%E6%AE%8A%E5%8F%91%E8%B4%A7%E6%8A%A5%E5%A4%87
+ *
+ */
+ String OP_SPECIAL_ORDER = "https://api.weixin.qq.com/wxa/sec/order/opspecialorder";
+
}
public interface Vod {
From 8fe1e6ea861fa3c532db705744ea2be0a926fe50 Mon Sep 17 00:00:00 2001
From: Jacky Tse
Date: Tue, 24 Dec 2024 13:21:00 +0800
Subject: [PATCH 033/326] =?UTF-8?q?:new:=20#3452=20=E3=80=90=E5=BE=AE?=
=?UTF-8?q?=E4=BF=A1=E6=94=AF=E4=BB=98=E3=80=91=E6=96=B0=E5=A2=9E=E6=B6=88?=
=?UTF-8?q?=E8=B4=B9=E8=80=85=E6=8A=95=E8=AF=892.0=E7=9A=84=E6=9B=B4?=
=?UTF-8?q?=E6=96=B0=E9=80=80=E6=AC=BE=E5=AE=A1=E6=89=B9=E7=BB=93=E6=9E=9C?=
=?UTF-8?q?=E7=9A=84=E6=8E=A5=E5=8F=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../UpdateRefundProgressRequest.java | 90 +++++++++++++++++++
.../wxpay/service/ComplaintService.java | 14 +++
.../service/impl/ComplaintServiceImpl.java | 8 ++
3 files changed, 112 insertions(+)
create mode 100644 weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/UpdateRefundProgressRequest.java
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/UpdateRefundProgressRequest.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/UpdateRefundProgressRequest.java
new file mode 100644
index 0000000000..f7715c522e
--- /dev/null
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/UpdateRefundProgressRequest.java
@@ -0,0 +1,90 @@
+package com.github.binarywang.wxpay.bean.complaint;
+
+import com.google.gson.annotations.Expose;
+import com.google.gson.annotations.SerializedName;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * 微信消费者投诉2.0
+ * 更新退款审批结果请求实体
+ *
+ * @author jackytse
+ * created on 2024-12-21
+ */
+@Data
+@Builder(builderMethodName = "newBuilder")
+@NoArgsConstructor
+@AllArgsConstructor
+public class UpdateRefundProgressRequest implements Serializable {
+ private static final long serialVersionUID = 6975811815225228118L;
+
+ /**
+ *
+ * 字段名:投诉单号
+ * 是否必填:是
+ * 描述:投诉单对应的投诉单号
+ *
+ */
+ @SerializedName("complaint_id")
+ @Expose
+ private String complaintId;
+
+ /**
+ *
+ * 字段名:审批动作
+ * 是否必填:是
+ * 描述:同意 或 拒绝
+ * 可选取值:
+ * REJECT: 拒绝退款
+ * APPROVE: 同意退款
+ *
+ */
+ @SerializedName("action")
+ private String action;
+
+ /**
+ *
+ * 字段名:预计发起退款时间
+ * 是否必填:否
+ * 描述:在同意退款时返回,预计将在多少个工作日内能发起退款, 0代表当天
+ *
+ */
+ @SerializedName("launch_refund_day")
+ private Integer launchRefundDay;
+
+ /**
+ *
+ * 字段名:拒绝退款原因
+ * 是否必填:否
+ * 描述:在拒绝退款时返回拒绝退款的原因
+ *
+ */
+ @SerializedName("reject_reason")
+ private String rejectReason;
+
+ /**
+ *
+ * 字段名:拒绝退款的举证图片列表
+ * 是否必填:否
+ * 描述:在拒绝退款时,如果有拒绝的图片举证,可以提供 最多上传4张图片, 传入调用“商户上传反馈图片”接口返回的media_id,最多上传4张图片凭证
+ *
+ */
+ @SerializedName("reject_media_list")
+ private List rejectMediaList;
+
+ /**
+ *
+ * 字段名:备注
+ * 是否必填:否
+ * 描述:任何需要向微信支付客服反馈的信息
+ *
+ */
+ @SerializedName("remark")
+ private String remark;
+}
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/ComplaintService.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/ComplaintService.java
index 8e86692cd6..66de1458a3 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/ComplaintService.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/ComplaintService.java
@@ -135,6 +135,20 @@ public interface ComplaintService {
*/
void complete(CompleteRequest request) throws WxPayException;
+ /**
+ *
+ * 更新退款审批结果API
+ * 针对“申请退款单”,需要商户明确返回是否可退款的审批结果。
+ * 若根据用户描述,核实可以退款,审批动作传入“APPROVE”,同意退款,并给出一个预计退款时间。传入“同意退款”后,需要额外调退款接口发起原路退款。退款到账后,投诉单的状态将自动扭转为“处理完成”。
+ * 若根据用户描述,核实不能退款,审批动作传入“REJECT”,拒绝退款,并说明拒绝退款原因。驳回退款后,投诉单的状态将自动扭转为“处理完成”。
+ * 文档详见: ...
+ *
+ *
+ * @param request {@link UpdateRefundProgressRequest} 请求数据
+ * @throws WxPayException the wx pay exception
+ */
+ void updateRefundProgress(UpdateRefundProgressRequest request) throws WxPayException;
+
/**
*
* 商户上传反馈图片API
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/ComplaintServiceImpl.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/ComplaintServiceImpl.java
index 51d9609c41..32d57e081e 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/ComplaintServiceImpl.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/ComplaintServiceImpl.java
@@ -112,6 +112,14 @@ public void complete(CompleteRequest request) throws WxPayException {
this.payService.postV3(url, GSON.toJson(request));
}
+ @Override
+ public void updateRefundProgress(UpdateRefundProgressRequest request) throws WxPayException {
+ String url = String.format("%s/v3/merchant-service/complaints-v2/%s/update-refund-progress", this.payService.getPayBaseUrl(), request.getComplaintId());
+ // 上面url已经含有complaintId,这里设置为空,避免在body中再次传递,否则微信会报错
+ request.setComplaintId(null);
+ this.payService.postV3(url, GSON.toJson(request));
+ }
+
@Override
public ImageUploadResult uploadResponseImage(File imageFile) throws WxPayException, IOException {
String url = String.format("%s/v3/merchant-service/images/upload", this.payService.getPayBaseUrl());
From a29e00f00f188c9948e89a492ca9ba7ff4e6b73e Mon Sep 17 00:00:00 2001
From: junbaor
Date: Fri, 3 Jan 2025 14:23:20 +0800
Subject: [PATCH 034/326] =?UTF-8?q?:art:=20#3461=E3=80=90=E5=B0=8F?=
=?UTF-8?q?=E7=A8=8B=E5=BA=8F=E3=80=91spring=20boot=20starter=20=E5=92=8C?=
=?UTF-8?q?=20solon=20plugin=20=E5=A2=9E=E5=8A=A0=E8=8E=B7=E5=8F=96?=
=?UTF-8?q?=E7=A8=B3=E5=AE=9A=E7=89=88=E6=8E=A5=E5=8F=A3=E8=B0=83=E7=94=A8?=
=?UTF-8?q?=E5=87=AD=E6=8D=AE=E7=9A=84=E5=8F=82=E6=95=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../storage/AbstractWxMaConfigStorageConfiguration.java | 1 +
.../solon/wxjava/miniapp/properties/WxMaProperties.java | 5 +++++
.../wx-java-miniapp-spring-boot-starter/README.md | 3 ++-
.../storage/AbstractWxMaConfigStorageConfiguration.java | 1 +
.../starter/wxjava/miniapp/properties/WxMaProperties.java | 5 +++++
5 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/solon-plugins/wx-java-miniapp-solon-plugin/src/main/java/com/binarywang/solon/wxjava/miniapp/config/storage/AbstractWxMaConfigStorageConfiguration.java b/solon-plugins/wx-java-miniapp-solon-plugin/src/main/java/com/binarywang/solon/wxjava/miniapp/config/storage/AbstractWxMaConfigStorageConfiguration.java
index 9cc4fe161b..acc147a705 100644
--- a/solon-plugins/wx-java-miniapp-solon-plugin/src/main/java/com/binarywang/solon/wxjava/miniapp/config/storage/AbstractWxMaConfigStorageConfiguration.java
+++ b/solon-plugins/wx-java-miniapp-solon-plugin/src/main/java/com/binarywang/solon/wxjava/miniapp/config/storage/AbstractWxMaConfigStorageConfiguration.java
@@ -15,6 +15,7 @@ protected WxMaDefaultConfigImpl config(WxMaDefaultConfigImpl config, WxMaPropert
config.setToken(StringUtils.trimToNull(properties.getToken()));
config.setAesKey(StringUtils.trimToNull(properties.getAesKey()));
config.setMsgDataFormat(StringUtils.trimToNull(properties.getMsgDataFormat()));
+ config.useStableAccessToken(properties.isUseStableAccessToken());
WxMaProperties.ConfigStorage configStorageProperties = properties.getConfigStorage();
config.setHttpProxyHost(configStorageProperties.getHttpProxyHost());
diff --git a/solon-plugins/wx-java-miniapp-solon-plugin/src/main/java/com/binarywang/solon/wxjava/miniapp/properties/WxMaProperties.java b/solon-plugins/wx-java-miniapp-solon-plugin/src/main/java/com/binarywang/solon/wxjava/miniapp/properties/WxMaProperties.java
index 5a993cf667..1c3e495f4e 100644
--- a/solon-plugins/wx-java-miniapp-solon-plugin/src/main/java/com/binarywang/solon/wxjava/miniapp/properties/WxMaProperties.java
+++ b/solon-plugins/wx-java-miniapp-solon-plugin/src/main/java/com/binarywang/solon/wxjava/miniapp/properties/WxMaProperties.java
@@ -45,6 +45,11 @@ public class WxMaProperties {
*/
private String msgDataFormat;
+ /**
+ * 是否使用稳定版 Access Token
+ */
+ private boolean useStableAccessToken = false;
+
/**
* 存储策略
*/
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/src/main/java/com/binarywang/spring/starter/wxjava/miniapp/config/storage/AbstractWxMaConfigStorageConfiguration.java b/spring-boot-starters/wx-java-miniapp-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/miniapp/config/storage/AbstractWxMaConfigStorageConfiguration.java
index 6f44ac27ee..fef0824767 100644
--- a/spring-boot-starters/wx-java-miniapp-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/miniapp/config/storage/AbstractWxMaConfigStorageConfiguration.java
+++ b/spring-boot-starters/wx-java-miniapp-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/miniapp/config/storage/AbstractWxMaConfigStorageConfiguration.java
@@ -15,6 +15,7 @@ protected WxMaDefaultConfigImpl config(WxMaDefaultConfigImpl config, WxMaPropert
config.setToken(StringUtils.trimToNull(properties.getToken()));
config.setAesKey(StringUtils.trimToNull(properties.getAesKey()));
config.setMsgDataFormat(StringUtils.trimToNull(properties.getMsgDataFormat()));
+ config.useStableAccessToken(properties.isUseStableAccessToken());
WxMaProperties.ConfigStorage configStorageProperties = properties.getConfigStorage();
config.setHttpProxyHost(configStorageProperties.getHttpProxyHost());
diff --git a/spring-boot-starters/wx-java-miniapp-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/miniapp/properties/WxMaProperties.java b/spring-boot-starters/wx-java-miniapp-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/miniapp/properties/WxMaProperties.java
index b7ccb45374..b6384aabd2 100644
--- a/spring-boot-starters/wx-java-miniapp-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/miniapp/properties/WxMaProperties.java
+++ b/spring-boot-starters/wx-java-miniapp-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/miniapp/properties/WxMaProperties.java
@@ -44,6 +44,11 @@ public class WxMaProperties {
*/
private String msgDataFormat;
+ /**
+ * 是否使用稳定版 Access Token
+ */
+ private boolean useStableAccessToken = false;
+
/**
* 存储策略
*/
From 6decd2839b9a591043dea37c0e600490035ce8f9 Mon Sep 17 00:00:00 2001
From: Binary Wang
Date: Fri, 3 Jan 2025 20:34:55 +0800
Subject: [PATCH 035/326] =?UTF-8?q?:memo:=20=E6=9B=B4=E6=96=B0=E7=89=88?=
=?UTF-8?q?=E6=9C=AC=E4=BF=A1=E6=81=AF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
README.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index ab645b7c4f..f55394ef60 100644
--- a/README.md
+++ b/README.md
@@ -59,7 +59,7 @@
### 重要信息
1. [`WxJava` 荣获 `GitCode` 2024年度十大开源社区奖项](https://mp.weixin.qq.com/s/wM_UlMsDm3IZ1CPPDvcvQw)。
2. 项目合作洽谈请联系微信`binary0000`(在微信里自行搜索并添加好友,请注明来意,如有关于SDK问题需讨论请参考下文入群讨论,不要加此微信)。
-3. **2023-12-28 发布 [【4.6.0正式版】](https://mp.weixin.qq.com/s/9Hhc_8w-v7ogS_TEAsqfAg)**!
+3. **2024-12-30 发布 [【4.7.0正式版】](https://mp.weixin.qq.com/s/_7k-XLYBqeJJhvHWCsdT0A)**!
4. 贡献源码可以参考视频:[【贡献源码全过程(上集)】](https://mp.weixin.qq.com/s/3xUZSATWwHR_gZZm207h7Q)、[【贡献源码全过程(下集)】](https://mp.weixin.qq.com/s/nyzJwVVoYSJ4hSbwyvTx9A) ,友情提供:[程序员小山与Bug](https://space.bilibili.com/473631007)
5. 新手重要提示:本项目仅是一个SDK开发工具包,未提供Web实现,建议使用 `maven` 或 `gradle` 引用本项目即可使用本SDK提供的各种功能,详情可参考 **[【Demo项目】](demo.md)** 或本项目中的部分单元测试代码;
6. 微信开发新手请务必阅读【开发文档】([Gitee Wiki](https://gitee.com/binary/weixin-java-tools/wikis/Home) 或者 [Github Wiki](https://github.com/binarywang/WxJava/wiki))的常见问题部分,可以少走很多弯路,节省不少时间。
@@ -90,7 +90,7 @@
com.github.binarywang
(不同模块参考下文)
- 4.6.0
+ 4.7.0
```
From 9730e9a38712d0dd06a6a7f97a5ca26c5bdcf28e Mon Sep 17 00:00:00 2001
From: lzq52066 <50949059+lzq52066@users.noreply.github.com>
Date: Mon, 6 Jan 2025 15:22:21 +0800
Subject: [PATCH 036/326] =?UTF-8?q?:art:=20#3054=20=E3=80=90=E5=B0=8F?=
=?UTF-8?q?=E7=A8=8B=E5=BA=8F=E3=80=91=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?=
=?UTF-8?q?=EF=BC=8C=E9=81=BF=E5=85=8D=E9=AB=98=E7=89=88=E6=9C=ACjdk?=
=?UTF-8?q?=E7=8E=AF=E5=A2=83=E4=B8=8B=E5=87=BA=E7=8E=B0=E5=BA=8F=E5=88=97?=
=?UTF-8?q?=E5=8C=96=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../binarywang/wx/miniapp/api/impl/BaseWxMaServiceImpl.java | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/BaseWxMaServiceImpl.java b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/BaseWxMaServiceImpl.java
index 8af0626b92..344418e318 100644
--- a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/BaseWxMaServiceImpl.java
+++ b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/BaseWxMaServiceImpl.java
@@ -499,7 +499,10 @@ public WxMaConfig getWxMaConfig() {
@Override
public void setWxMaConfig(WxMaConfig maConfig) {
final String appid = maConfig.getAppid();
- this.setMultiConfigs(ImmutableMap.of(appid, maConfig), appid);
+ Map map = new HashMap<>();
+ map.put(appid, maConfig);
+ Map configMap = Collections.unmodifiableMap(map);
+ this.setMultiConfigs(configMap, appid);
}
@Override
From 6d9fadf86d33bd1e81eda33b0cfc9312aceeeed6 Mon Sep 17 00:00:00 2001
From: huangj <15150599658@163.com>
Date: Thu, 9 Jan 2025 16:37:40 +0800
Subject: [PATCH 037/326] =?UTF-8?q?:art:=E3=80=90=E4=BC=81=E4=B8=9A?=
=?UTF-8?q?=E5=BE=AE=E4=BF=A1=E3=80=91=E4=BC=9A=E8=AF=9D=E5=86=85=E5=AE=B9?=
=?UTF-8?q?=E5=AD=98=E6=A1=A3=20-=20=E8=A7=A3=E5=AF=86=E5=90=8E=E7=9A=84?=
=?UTF-8?q?=E4=BC=9A=E8=AF=9D=E5=86=85=E5=AE=B9=E5=AE=9E=E4=BD=93=E7=B1=BB?=
=?UTF-8?q?=E9=87=8C=E5=8E=BB=E6=8E=89=E5=A4=9A=E4=BD=99=E7=9A=84=E5=AD=97?=
=?UTF-8?q?=E6=AE=B5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../java/me/chanjar/weixin/cp/bean/msgaudit/WxCpChatModel.java | 3 ---
1 file changed, 3 deletions(-)
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/msgaudit/WxCpChatModel.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/msgaudit/WxCpChatModel.java
index d843cad6cf..8a9d2130d6 100644
--- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/msgaudit/WxCpChatModel.java
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/msgaudit/WxCpChatModel.java
@@ -25,9 +25,6 @@ public class WxCpChatModel implements Serializable {
@SerializedName("action")
private String action;
- @SerializedName("send")
- private String send;
-
@SerializedName("from")
private String from;
From 83bd92d2605cbadabc7202d3571126721ccfa6c8 Mon Sep 17 00:00:00 2001
From: Binary Wang
Date: Mon, 13 Jan 2025 08:51:16 +0800
Subject: [PATCH 038/326] =?UTF-8?q?:bookmark:=20=E5=8F=91=E5=B8=83=204.7.1?=
=?UTF-8?q?.B=20=E6=B5=8B=E8=AF=95=E7=89=88=E6=9C=AC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pom.xml | 2 +-
solon-plugins/pom.xml | 2 +-
solon-plugins/wx-java-channel-multi-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-channel-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-cp-multi-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-cp-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-miniapp-multi-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-miniapp-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-mp-multi-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-mp-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-open-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-pay-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-qidian-solon-plugin/pom.xml | 2 +-
spring-boot-starters/pom.xml | 2 +-
.../wx-java-channel-multi-spring-boot-starter/pom.xml | 2 +-
.../wx-java-channel-spring-boot-starter/pom.xml | 2 +-
.../wx-java-cp-multi-spring-boot-starter/pom.xml | 2 +-
spring-boot-starters/wx-java-cp-spring-boot-starter/pom.xml | 2 +-
.../wx-java-miniapp-multi-spring-boot-starter/pom.xml | 2 +-
.../wx-java-miniapp-spring-boot-starter/pom.xml | 2 +-
.../wx-java-mp-multi-spring-boot-starter/pom.xml | 2 +-
spring-boot-starters/wx-java-mp-spring-boot-starter/pom.xml | 2 +-
spring-boot-starters/wx-java-open-spring-boot-starter/pom.xml | 2 +-
spring-boot-starters/wx-java-pay-spring-boot-starter/pom.xml | 2 +-
spring-boot-starters/wx-java-qidian-spring-boot-starter/pom.xml | 2 +-
weixin-graal/pom.xml | 2 +-
weixin-java-channel/pom.xml | 2 +-
weixin-java-common/pom.xml | 2 +-
weixin-java-cp/pom.xml | 2 +-
weixin-java-miniapp/pom.xml | 2 +-
weixin-java-mp/pom.xml | 2 +-
weixin-java-open/pom.xml | 2 +-
weixin-java-pay/pom.xml | 2 +-
weixin-java-qidian/pom.xml | 2 +-
34 files changed, 34 insertions(+), 34 deletions(-)
diff --git a/pom.xml b/pom.xml
index 730f6b5809..9f0362816d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -3,7 +3,7 @@
4.0.0
com.github.binarywang
wx-java
- 4.7.0
+ 4.7.1.B
pom
WxJava - Weixin/Wechat Java SDK
微信开发Java SDK
diff --git a/solon-plugins/pom.xml b/solon-plugins/pom.xml
index bf956526c8..9e52bec0ca 100644
--- a/solon-plugins/pom.xml
+++ b/solon-plugins/pom.xml
@@ -6,7 +6,7 @@
com.github.binarywang
wx-java
- 4.7.0
+ 4.7.1.B
pom
wx-java-solon-plugins
diff --git a/solon-plugins/wx-java-channel-multi-solon-plugin/pom.xml b/solon-plugins/wx-java-channel-multi-solon-plugin/pom.xml
index aa9911e115..687ac3e998 100644
--- a/solon-plugins/wx-java-channel-multi-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-channel-multi-solon-plugin/pom.xml
@@ -5,7 +5,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.7.0
+ 4.7.1.B
4.0.0
diff --git a/solon-plugins/wx-java-channel-solon-plugin/pom.xml b/solon-plugins/wx-java-channel-solon-plugin/pom.xml
index dda371c780..bc8c46627b 100644
--- a/solon-plugins/wx-java-channel-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-channel-solon-plugin/pom.xml
@@ -3,7 +3,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.7.0
+ 4.7.1.B
4.0.0
diff --git a/solon-plugins/wx-java-cp-multi-solon-plugin/pom.xml b/solon-plugins/wx-java-cp-multi-solon-plugin/pom.xml
index d2218490b9..5787c42ee4 100644
--- a/solon-plugins/wx-java-cp-multi-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-cp-multi-solon-plugin/pom.xml
@@ -4,7 +4,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.7.0
+ 4.7.1.B
4.0.0
diff --git a/solon-plugins/wx-java-cp-solon-plugin/pom.xml b/solon-plugins/wx-java-cp-solon-plugin/pom.xml
index 05598d6b9c..7c39166d1f 100644
--- a/solon-plugins/wx-java-cp-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-cp-solon-plugin/pom.xml
@@ -4,7 +4,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.7.0
+ 4.7.1.B
4.0.0
diff --git a/solon-plugins/wx-java-miniapp-multi-solon-plugin/pom.xml b/solon-plugins/wx-java-miniapp-multi-solon-plugin/pom.xml
index deca9a2ffa..7740ce99c4 100644
--- a/solon-plugins/wx-java-miniapp-multi-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-miniapp-multi-solon-plugin/pom.xml
@@ -5,7 +5,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.7.0
+ 4.7.1.B
4.0.0
diff --git a/solon-plugins/wx-java-miniapp-solon-plugin/pom.xml b/solon-plugins/wx-java-miniapp-solon-plugin/pom.xml
index 5075140322..8654c698ed 100644
--- a/solon-plugins/wx-java-miniapp-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-miniapp-solon-plugin/pom.xml
@@ -4,7 +4,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.7.0
+ 4.7.1.B
4.0.0
diff --git a/solon-plugins/wx-java-mp-multi-solon-plugin/pom.xml b/solon-plugins/wx-java-mp-multi-solon-plugin/pom.xml
index 67f9e2da37..1bb1960151 100644
--- a/solon-plugins/wx-java-mp-multi-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-mp-multi-solon-plugin/pom.xml
@@ -5,7 +5,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.7.0
+ 4.7.1.B
4.0.0
diff --git a/solon-plugins/wx-java-mp-solon-plugin/pom.xml b/solon-plugins/wx-java-mp-solon-plugin/pom.xml
index 5dcea9ac93..f2925cd1a2 100644
--- a/solon-plugins/wx-java-mp-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-mp-solon-plugin/pom.xml
@@ -5,7 +5,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.7.0
+ 4.7.1.B
4.0.0
diff --git a/solon-plugins/wx-java-open-solon-plugin/pom.xml b/solon-plugins/wx-java-open-solon-plugin/pom.xml
index bd8c9e3e45..87d5c08c40 100644
--- a/solon-plugins/wx-java-open-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-open-solon-plugin/pom.xml
@@ -5,7 +5,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.7.0
+ 4.7.1.B
4.0.0
diff --git a/solon-plugins/wx-java-pay-solon-plugin/pom.xml b/solon-plugins/wx-java-pay-solon-plugin/pom.xml
index 47153d8f13..bfc53597df 100644
--- a/solon-plugins/wx-java-pay-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-pay-solon-plugin/pom.xml
@@ -5,7 +5,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.7.0
+ 4.7.1.B
4.0.0
diff --git a/solon-plugins/wx-java-qidian-solon-plugin/pom.xml b/solon-plugins/wx-java-qidian-solon-plugin/pom.xml
index b5488655ec..e95b835109 100644
--- a/solon-plugins/wx-java-qidian-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-qidian-solon-plugin/pom.xml
@@ -3,7 +3,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.7.0
+ 4.7.1.B
4.0.0
diff --git a/spring-boot-starters/pom.xml b/spring-boot-starters/pom.xml
index 75f2d94865..3f5839696c 100644
--- a/spring-boot-starters/pom.xml
+++ b/spring-boot-starters/pom.xml
@@ -6,7 +6,7 @@
com.github.binarywang
wx-java
- 4.7.0
+ 4.7.1.B
pom
wx-java-spring-boot-starters
diff --git a/spring-boot-starters/wx-java-channel-multi-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-channel-multi-spring-boot-starter/pom.xml
index b67cc1733e..e8dde09746 100644
--- a/spring-boot-starters/wx-java-channel-multi-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-channel-multi-spring-boot-starter/pom.xml
@@ -5,7 +5,7 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.7.0
+ 4.7.1.B
4.0.0
diff --git a/spring-boot-starters/wx-java-channel-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-channel-spring-boot-starter/pom.xml
index 4a4567198c..6a63849e64 100644
--- a/spring-boot-starters/wx-java-channel-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-channel-spring-boot-starter/pom.xml
@@ -3,7 +3,7 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.7.0
+ 4.7.1.B
4.0.0
diff --git a/spring-boot-starters/wx-java-cp-multi-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-cp-multi-spring-boot-starter/pom.xml
index 0128c7bf52..65419e065e 100644
--- a/spring-boot-starters/wx-java-cp-multi-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-cp-multi-spring-boot-starter/pom.xml
@@ -4,7 +4,7 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.7.0
+ 4.7.1.B
4.0.0
diff --git a/spring-boot-starters/wx-java-cp-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-cp-spring-boot-starter/pom.xml
index 59c2f63f8a..73e70ce07a 100644
--- a/spring-boot-starters/wx-java-cp-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-cp-spring-boot-starter/pom.xml
@@ -4,7 +4,7 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.7.0
+ 4.7.1.B
4.0.0
diff --git a/spring-boot-starters/wx-java-miniapp-multi-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-miniapp-multi-spring-boot-starter/pom.xml
index c90f2b741d..74e5082e30 100644
--- a/spring-boot-starters/wx-java-miniapp-multi-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-miniapp-multi-spring-boot-starter/pom.xml
@@ -5,7 +5,7 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.7.0
+ 4.7.1.B
4.0.0
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 2eaa6f1c77..b2495d9d77 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 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.7.0
+ 4.7.1.B
4.0.0
diff --git a/spring-boot-starters/wx-java-mp-multi-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-mp-multi-spring-boot-starter/pom.xml
index 3ec7cf5163..48bf3c4837 100644
--- a/spring-boot-starters/wx-java-mp-multi-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-mp-multi-spring-boot-starter/pom.xml
@@ -5,7 +5,7 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.7.0
+ 4.7.1.B
4.0.0
diff --git a/spring-boot-starters/wx-java-mp-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-mp-spring-boot-starter/pom.xml
index 4bc7037c22..4d0b88794a 100644
--- a/spring-boot-starters/wx-java-mp-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-mp-spring-boot-starter/pom.xml
@@ -5,7 +5,7 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.7.0
+ 4.7.1.B
4.0.0
diff --git a/spring-boot-starters/wx-java-open-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-open-spring-boot-starter/pom.xml
index cd6f25e892..6505cafac6 100644
--- a/spring-boot-starters/wx-java-open-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-open-spring-boot-starter/pom.xml
@@ -5,7 +5,7 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.7.0
+ 4.7.1.B
4.0.0
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 960556dad7..96c6e8b7ae 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 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.7.0
+ 4.7.1.B
4.0.0
diff --git a/spring-boot-starters/wx-java-qidian-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-qidian-spring-boot-starter/pom.xml
index 5fe49991e1..e735cb82d1 100644
--- a/spring-boot-starters/wx-java-qidian-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-qidian-spring-boot-starter/pom.xml
@@ -3,7 +3,7 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.7.0
+ 4.7.1.B
4.0.0
diff --git a/weixin-graal/pom.xml b/weixin-graal/pom.xml
index 44c7c952fe..7f2eb89e43 100644
--- a/weixin-graal/pom.xml
+++ b/weixin-graal/pom.xml
@@ -6,7 +6,7 @@
com.github.binarywang
wx-java
- 4.7.0
+ 4.7.1.B
weixin-graal
diff --git a/weixin-java-channel/pom.xml b/weixin-java-channel/pom.xml
index 0cb27642ab..c1fe4637d4 100644
--- a/weixin-java-channel/pom.xml
+++ b/weixin-java-channel/pom.xml
@@ -6,7 +6,7 @@
com.github.binarywang
wx-java
- 4.7.0
+ 4.7.1.B
weixin-java-channel
diff --git a/weixin-java-common/pom.xml b/weixin-java-common/pom.xml
index b775fab23b..7cfce1c1aa 100644
--- a/weixin-java-common/pom.xml
+++ b/weixin-java-common/pom.xml
@@ -6,7 +6,7 @@
com.github.binarywang
wx-java
- 4.7.0
+ 4.7.1.B
weixin-java-common
diff --git a/weixin-java-cp/pom.xml b/weixin-java-cp/pom.xml
index 85a37ba2f9..e3a64d0006 100644
--- a/weixin-java-cp/pom.xml
+++ b/weixin-java-cp/pom.xml
@@ -7,7 +7,7 @@
com.github.binarywang
wx-java
- 4.7.0
+ 4.7.1.B
weixin-java-cp
diff --git a/weixin-java-miniapp/pom.xml b/weixin-java-miniapp/pom.xml
index a9bb5f37dc..5b85813dcf 100644
--- a/weixin-java-miniapp/pom.xml
+++ b/weixin-java-miniapp/pom.xml
@@ -7,7 +7,7 @@
com.github.binarywang
wx-java
- 4.7.0
+ 4.7.1.B
weixin-java-miniapp
diff --git a/weixin-java-mp/pom.xml b/weixin-java-mp/pom.xml
index c8c3f298c8..ffb3eae284 100644
--- a/weixin-java-mp/pom.xml
+++ b/weixin-java-mp/pom.xml
@@ -7,7 +7,7 @@
com.github.binarywang
wx-java
- 4.7.0
+ 4.7.1.B
weixin-java-mp
diff --git a/weixin-java-open/pom.xml b/weixin-java-open/pom.xml
index 0146f516ad..58ecb292d2 100644
--- a/weixin-java-open/pom.xml
+++ b/weixin-java-open/pom.xml
@@ -7,7 +7,7 @@
com.github.binarywang
wx-java
- 4.7.0
+ 4.7.1.B
weixin-java-open
diff --git a/weixin-java-pay/pom.xml b/weixin-java-pay/pom.xml
index cba2ede006..1c64b458f2 100644
--- a/weixin-java-pay/pom.xml
+++ b/weixin-java-pay/pom.xml
@@ -5,7 +5,7 @@
com.github.binarywang
wx-java
- 4.7.0
+ 4.7.1.B
4.0.0
diff --git a/weixin-java-qidian/pom.xml b/weixin-java-qidian/pom.xml
index 31a0c21dc0..25718264fe 100644
--- a/weixin-java-qidian/pom.xml
+++ b/weixin-java-qidian/pom.xml
@@ -7,7 +7,7 @@
com.github.binarywang
wx-java
- 4.7.0
+ 4.7.1.B
weixin-java-qidian
From be0dd8b692873af324292a4a85baae391a141cc8 Mon Sep 17 00:00:00 2001
From: allovine
Date: Thu, 16 Jan 2025 13:46:02 +0800
Subject: [PATCH 039/326] =?UTF-8?q?:new:=20#3474=20=E3=80=90=E5=BE=AE?=
=?UTF-8?q?=E4=BF=A1=E6=94=AF=E4=BB=98=E3=80=91=E5=A2=9E=E5=8A=A02025.1.15?=
=?UTF-8?q?=E6=AD=A3=E5=BC=8F=E4=B8=8A=E7=BA=BF=E7=9A=84=E5=95=86=E6=88=B7?=
=?UTF-8?q?=E8=BD=AC=E8=B4=A6=E6=96=B0=E7=89=88=E6=9C=AC=E7=9A=84=E7=9B=B8?=
=?UTF-8?q?=E5=85=B3=E6=8E=A5=E5=8F=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../transfer/TransferBillsNotifyResult.java | 79 +++++++++++++
.../bean/transfer/TransferBillsRequest.java | 108 ++++++++++++++++++
.../bean/transfer/TransferBillsResult.java | 55 +++++++++
.../wxpay/service/TransferService.java | 27 +++++
.../wxpay/service/WxPayService.java | 12 ++
.../service/impl/BaseWxPayServiceImpl.java | 6 +
.../service/impl/TransferServiceImpl.java | 16 +++
.../service/impl/TransferServiceImplTest.java | 14 +++
8 files changed, 317 insertions(+)
create mode 100644 weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/TransferBillsNotifyResult.java
create mode 100644 weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/TransferBillsRequest.java
create mode 100644 weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/TransferBillsResult.java
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/TransferBillsNotifyResult.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/TransferBillsNotifyResult.java
new file mode 100644
index 0000000000..80709a1022
--- /dev/null
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/TransferBillsNotifyResult.java
@@ -0,0 +1,79 @@
+package com.github.binarywang.wxpay.bean.transfer;
+
+import com.github.binarywang.wxpay.bean.notify.OriginNotifyResponse;
+import com.github.binarywang.wxpay.bean.notify.WxPayBaseNotifyV3Result;
+import com.google.gson.annotations.SerializedName;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+/**
+ *
+ * 商家转账到零钱接口将转账结果通知用户
+ * 文档地址:https://pay.weixin.qq.com/doc/v3/merchant/4012716434
+ *
+ */
+@Data
+public class TransferBillsNotifyResult implements Serializable, WxPayBaseNotifyV3Result {
+ /**
+ * 源数据
+ */
+ private OriginNotifyResponse rawData;
+ /**
+ * 解密后的数据
+ */
+ private TransferBillsNotifyResult.DecryptNotifyResult result;
+
+ @Data
+ @NoArgsConstructor
+ public static class DecryptNotifyResult implements Serializable {
+ /**
+ * 商户号
+ */
+ @SerializedName(value = "mch_id")
+ private String mchId;
+ /**
+ * 商家批次单号
+ */
+ @SerializedName(value = "out_bill_no")
+ private String outBillNo;
+ /**
+ * 微信批次单号
+ */
+ @SerializedName(value = "transfer_bill_no")
+ private String transferBillNo;
+ /**
+ * 批次状态
+ */
+ @SerializedName(value = "state")
+ private String state;
+ /**
+ * 转账金额
+ */
+ @SerializedName(value = "transfer_amount")
+ private Integer transferAmount;
+
+ /**
+ * 批次状态
+ */
+ @SerializedName(value = "openid")
+ private String openid;
+
+ /**
+ * 单据创建时间
+ */
+ @SerializedName(value = "create_time")
+ private String createTime;
+ /**
+ * 最后一次状态变更时间
+ */
+ @SerializedName(value = "update_time")
+ private String updateTime;
+ /**
+ * 错误原因
+ */
+ @SerializedName(value = "fail_reason")
+ private String failReason;
+ }
+}
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/TransferBillsRequest.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/TransferBillsRequest.java
new file mode 100644
index 0000000000..230e564e4b
--- /dev/null
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/TransferBillsRequest.java
@@ -0,0 +1,108 @@
+package com.github.binarywang.wxpay.bean.transfer;
+
+import com.github.binarywang.wxpay.v3.SpecEncrypt;
+import com.google.gson.annotations.SerializedName;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * 发起商家转账API参数
+ *
+ * @author allovine
+ * created on 2025/1/15
+ **/
+@Data
+@Builder(builderMethodName = "newBuilder")
+@NoArgsConstructor
+@AllArgsConstructor
+public class TransferBillsRequest implements Serializable {
+ private static final long serialVersionUID = -2175582517588397437L;
+
+ /**
+ * 直连商户的appid
+ */
+ @SerializedName("appid")
+ private String appid;
+
+ /**
+ * 商户系统内部的商家单号
+ */
+ @SerializedName("out_bill_no")
+ private String outBillNo;
+
+ /**
+ * 转账场景ID
+ * 商户平台-产品中心-商家转账 申请
+ * 佣金报酬 ID:1005
+ */
+ @SerializedName("transfer_scene_id")
+ private String transferSceneId;
+
+ /**
+ * 用户在直连商户应用下的用户标示
+ */
+ @SerializedName("openid")
+ private String openid;
+
+ /**
+ * 收款用户姓名
+ */
+ @SpecEncrypt
+ @SerializedName("user_name")
+ private String userName;
+
+ /**
+ * 转账金额
+ */
+ @SerializedName("transfer_amount")
+ private Integer transferAmount;
+
+ /**
+ * 转账备注
+ */
+ @SerializedName("transfer_remark")
+ private String transferRemark;
+
+ /**
+ * 异步接收微信支付结果通知的回调地址,通知url必须为公网可访问的url,必须为https,不能携带参数
+ */
+ @SerializedName("notify_url")
+ private String notifyUrl;
+
+ /**
+ * 用户收款感知
+ */
+ @SerializedName("user_recv_perception")
+ private String userRecvPerception;
+
+
+ /**
+ * 转账场景报备信息
+ */
+ @SerializedName("transfer_scene_report_infos")
+ private List transferSceneReportInfos;
+
+
+ @Data
+ @Builder(builderMethodName = "newBuilder")
+ @AllArgsConstructor
+ @NoArgsConstructor
+ public static class TransferSceneReportInfo {
+ /**
+ * 信息类型
+ */
+ @SerializedName("info_type")
+ private String infoType;
+
+ /**
+ * 信息内容
+ */
+ @SerializedName("info_content")
+ private String infoContent;
+ }
+}
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/TransferBillsResult.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/TransferBillsResult.java
new file mode 100644
index 0000000000..9f7aac7fbb
--- /dev/null
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/TransferBillsResult.java
@@ -0,0 +1,55 @@
+package com.github.binarywang.wxpay.bean.transfer;
+
+import com.google.gson.annotations.SerializedName;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+/**
+ * 商家转账结果
+ *
+ * @author allovine
+ * created on 2025/1/15
+ **/
+@Data
+@NoArgsConstructor
+public class TransferBillsResult implements Serializable {
+ private static final long serialVersionUID = -2175582517588397437L;
+
+ /**
+ * 商户单号
+ */
+ @SerializedName("out_bill_no")
+ private String outBillNo;
+
+ /**
+ * 微信转账单号
+ */
+ @SerializedName("transfer_bill_no")
+ private String transferBillNo;
+
+ /**
+ * 单据创建时间
+ */
+ @SerializedName("create_time")
+ private String createTime;
+
+ /**
+ * 单据状态
+ */
+ @SerializedName("status")
+ private String status;
+
+ /**
+ * 失败原因
+ */
+ @SerializedName("fail_reason")
+ private String failReason;
+
+ /**
+ * 跳转领取页面的package信息
+ */
+ @SerializedName("package_info")
+ private String packageInfo;
+}
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/TransferService.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/TransferService.java
index ebf746214d..c02430a960 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/TransferService.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/TransferService.java
@@ -111,4 +111,31 @@ public interface TransferService {
*/
TransferBatchDetailResult transferBatchesOutBatchNoDetail(String outBatchNo, String outDetailNo) throws WxPayException;
+ /**
+ *
+ *
+ * 2025.1.15 开始新接口 发起商家转账API
+ *
+ * 请求方式:POST(HTTPS)
+ * 请求地址:请求地址
+ *
+ * 文档地址:发起商家转账API
+ *
+ *
+ * @param request 转账请求参数
+ * @return TransferBillsResult 转账结果
+ * @throws WxPayException .
+ */
+ TransferBillsResult transferBills(TransferBillsRequest request) throws WxPayException;
+
+ /**
+ * 2025.1.15 开始新接口 解析商家转账结果
+ * 详见
+ *
+ * @param notifyData 通知数据
+ * @param header 通知头部数据,不传则表示不校验头
+ * @return the wx transfer notify result
+ * @throws WxPayException the wx pay exception
+ */
+ TransferBillsNotifyResult parseTransferBillsNotifyResult(String notifyData, SignatureHeader header) throws WxPayException;
}
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/WxPayService.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/WxPayService.java
index 57c2937c62..19b4ed0a07 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/WxPayService.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/WxPayService.java
@@ -6,6 +6,7 @@
import com.github.binarywang.wxpay.bean.request.*;
import com.github.binarywang.wxpay.bean.result.*;
import com.github.binarywang.wxpay.bean.result.enums.TradeTypeEnum;
+import com.github.binarywang.wxpay.bean.transfer.TransferBillsNotifyResult;
import com.github.binarywang.wxpay.config.WxPayConfig;
import com.github.binarywang.wxpay.constant.WxPayConstants;
import com.github.binarywang.wxpay.exception.WxPayException;
@@ -991,6 +992,17 @@ WxPayRefundQueryResult refundQuery(String transactionId, String outTradeNo, Stri
*/
WxPayTransferBatchesNotifyV3Result parseTransferBatchesNotifyV3Result(String notifyData, SignatureHeader header) throws WxPayException;
+ /**
+ * 解析商家转账批次回调通知
+ * https://pay.weixin.qq.com/doc/v3/merchant/4012712115
+ *
+ * @param notifyData
+ * @param header
+ * @return
+ * @throws WxPayException
+ */
+ TransferBillsNotifyResult parseTransferBillsNotifyV3Result(String notifyData, SignatureHeader header) throws WxPayException;
+
/**
* 解析服务商模式退款结果通知
* 详见https://pay.weixin.qq.com/wiki/doc/apiv3_partner/apis/chapter4_1_11.shtml
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java
index c9fc1e7bd2..7c2055cec3 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java
@@ -11,6 +11,7 @@
import com.github.binarywang.wxpay.bean.request.*;
import com.github.binarywang.wxpay.bean.result.*;
import com.github.binarywang.wxpay.bean.result.enums.TradeTypeEnum;
+import com.github.binarywang.wxpay.bean.transfer.TransferBillsNotifyResult;
import com.github.binarywang.wxpay.config.WxPayConfig;
import com.github.binarywang.wxpay.config.WxPayConfigHolder;
import com.github.binarywang.wxpay.constant.WxPayConstants;
@@ -442,6 +443,11 @@ public WxPayTransferBatchesNotifyV3Result parseTransferBatchesNotifyV3Result(Str
return this.baseParseOrderNotifyV3Result(notifyData, header, WxPayTransferBatchesNotifyV3Result.class, WxPayTransferBatchesNotifyV3Result.DecryptNotifyResult.class);
}
+ @Override
+ public TransferBillsNotifyResult parseTransferBillsNotifyV3Result(String notifyData, SignatureHeader header) throws WxPayException {
+ return this.baseParseOrderNotifyV3Result(notifyData, header, TransferBillsNotifyResult.class, TransferBillsNotifyResult.DecryptNotifyResult.class);
+ }
+
@Override
public WxPayPartnerRefundNotifyV3Result parsePartnerRefundNotifyV3Result(String notifyData, SignatureHeader header) throws WxPayException {
return this.baseParseOrderNotifyV3Result(notifyData, header, WxPayPartnerRefundNotifyV3Result.class, WxPayPartnerRefundNotifyV3Result.DecryptNotifyResult.class);
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/TransferServiceImpl.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/TransferServiceImpl.java
index e62dc9c053..23bf7b13ee 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/TransferServiceImpl.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/TransferServiceImpl.java
@@ -85,4 +85,20 @@ public TransferBatchDetailResult transferBatchesOutBatchNoDetail(String outBatch
String result = this.payService.getV3(url);
return GSON.fromJson(result, TransferBatchDetailResult.class);
}
+
+ @Override
+ public TransferBillsResult transferBills(TransferBillsRequest request) throws WxPayException {
+ String url = String.format("%s/v3/fund-app/mch-transfer/transfer-bills", this.payService.getPayBaseUrl());
+ if (request.getUserName() != null && request.getUserName().length() > 0) {
+ X509Certificate validCertificate = this.payService.getConfig().getVerifier().getValidCertificate();
+ RsaCryptoUtil.encryptFields(request, validCertificate);
+ }
+ String result = this.payService.postV3WithWechatpaySerial(url, GSON.toJson(request));
+ return GSON.fromJson(result, TransferBillsResult.class);
+ }
+
+ @Override
+ public TransferBillsNotifyResult parseTransferBillsNotifyResult(String notifyData, SignatureHeader header) throws WxPayException {
+ return this.payService.baseParseOrderNotifyV3Result(notifyData, header, TransferBillsNotifyResult.class, TransferBillsNotifyResult.DecryptNotifyResult.class);
+ }
}
diff --git a/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/service/impl/TransferServiceImplTest.java b/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/service/impl/TransferServiceImplTest.java
index 7f89bd4721..cd607dff03 100644
--- a/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/service/impl/TransferServiceImplTest.java
+++ b/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/service/impl/TransferServiceImplTest.java
@@ -2,6 +2,7 @@
import com.github.binarywang.wxpay.bean.transfer.QueryTransferBatchesRequest;
import com.github.binarywang.wxpay.bean.transfer.TransferBatchesRequest;
+import com.github.binarywang.wxpay.bean.transfer.TransferBillsRequest;
import com.github.binarywang.wxpay.exception.WxPayException;
import com.github.binarywang.wxpay.service.WxPayService;
import com.github.binarywang.wxpay.testbase.ApiTestModule;
@@ -73,4 +74,17 @@ public void testTransferBatchesOutBatchNo() throws WxPayException {
public void testTransferBatchesOutBatchNoDetail() throws WxPayException {
log.info("商家明细单号查询明细单:{}", this.payService.getTransferService().transferBatchesOutBatchNoDetail("1655447999520", "1655447989156"));
}
+
+ @Test
+ public void testTransferBills() throws WxPayException {
+ TransferBillsRequest transferBillsRequest = TransferBillsRequest.newBuilder()
+ .appid("wxf636efh5xxxxx")
+ .outBillNo("1655447989156")
+ .transferSceneId("1005")
+ .transferAmount(100)
+ .transferRemark("测试转账")
+ .openid("oX_7Jzr9gSZz4X_Xc9-_7HGf8XzI")
+ .userName("测试用户").build();
+ log.info("发起商家转账:{}", this.payService.getTransferService().transferBills(transferBillsRequest));
+ }
}
From b4b73ad40acdda3853ddc2c06f3098d10ba7be34 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=BD=98=E5=AE=89?=
Date: Thu, 16 Jan 2025 13:47:55 +0800
Subject: [PATCH 040/326] =?UTF-8?q?:art:=20#3467=20=E3=80=90=E5=BE=AE?=
=?UTF-8?q?=E4=BF=A1=E6=94=AF=E4=BB=98=E3=80=91=E5=95=86=E6=88=B7=E8=BF=9B?=
=?UTF-8?q?=E4=BB=B6=E5=BC=80=E6=88=B7=E6=84=8F=E6=84=BF=E6=8E=A5=E5=8F=A3?=
=?UTF-8?q?=E7=9B=B8=E5=85=B3=E5=AD=97=E6=AE=B5=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../ApplySubjectConfirmCreateRequest.java | 37 +++++--------------
1 file changed, 9 insertions(+), 28 deletions(-)
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/applyconfirm/ApplySubjectConfirmCreateRequest.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/applyconfirm/ApplySubjectConfirmCreateRequest.java
index b95061461c..d77522ecce 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/applyconfirm/ApplySubjectConfirmCreateRequest.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/applyconfirm/ApplySubjectConfirmCreateRequest.java
@@ -119,8 +119,8 @@ public static class ApplySubConfirmIdentificationInfo implements Serializable {
* IDENTIFICATION_TYPE_TAIWAN_RESIDENT:台湾居民证
* 示例值:IDENTIFICATION_TYPE_IDCARD
*/
- @SerializedName("id_doc_type")
- private IdTypeEnum idDocType;
+ @SerializedName("identification_type")
+ private IdTypeEnum identificationType;
/**
* 法定代表人说明函
@@ -414,13 +414,13 @@ public static class ApplySubConfirmSubjectInfo implements Serializable {
* 若未传入将默认填写:false。
* 示例值:true
*/
- @SerializedName("finance_institution")
+ @SerializedName("is_finance_institution")
private Boolean financeInstitution;
/**
* 营业执照
*/
- @SerializedName("business_license_info")
+ @SerializedName("business_licence_info")
private ApplySubConfirmBusinessLicenseInfo businessLicenseInfo;
/**
* 登记证书
@@ -736,8 +736,8 @@ public static class ApplySubConfirmSpecialOperationList implements Serializable
* 参看微信支付提供的特殊行业id对照表
* 示例值:100
*/
- @SerializedName("finance_type")
- private Integer financeType;
+ @SerializedName("category_id")
+ private Integer categoryId;
/**
* 行业经营许可证资质照片
@@ -791,29 +791,10 @@ public static class ApplySubConfirmAdditionInfo implements Serializable {
private static final long serialVersionUID = 1L;
/**
- * 法人开户承诺函
- */
- @SerializedName("legal_person_commitment")
- private String legalPersonCommitment;
-
- /**
- * 法人开户意愿视频
+ * 待确认商户号列表
*/
- @SerializedName("legal_person_video")
- private String legalPersonVideo;
-
- /**
- * 补充材料
- */
- @SerializedName("business_addition_pics")
- private List businessAdditionPics;
-
- /**
- * 补充说明
- */
- @SerializedName("business_addition_msg")
- private String businessAdditionMsg;
-
+ @SerializedName("confirm_mchid_list")
+ private List confirmMchidList;
}
}
From ab1c150febebdb206e32c48a402207f74731cf06 Mon Sep 17 00:00:00 2001
From: mrsiu
Date: Thu, 16 Jan 2025 13:50:24 +0800
Subject: [PATCH 041/326] =?UTF-8?q?:art:=20#3478=20=E3=80=90=E4=BC=81?=
=?UTF-8?q?=E4=B8=9A=E5=BE=AE=E4=BF=A1=E3=80=91OA=E5=AE=A1=E6=89=B9?=
=?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=A2=9E=E5=8A=A0=E5=AF=B9=E8=AF=B4=E6=98=8E?=
=?UTF-8?q?=E6=96=87=E5=AD=97=E6=8E=A7=E4=BB=B6=EF=BC=88control=E5=8F=82?=
=?UTF-8?q?=E6=95=B0=E4=B8=BATips=EF=BC=89=E7=9A=84=E6=94=AF=E6=8C=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../bean/oa/WxCpOaApprovalTemplateResult.java | 4 ++++
.../bean/oa/templatedata/TemplateConfig.java | 2 ++
.../cp/bean/oa/templatedata/TemplateTips.java | 18 ++++++++++++++++++
.../oa/templatedata/TemplateTipsContent.java | 15 +++++++++++++++
.../oa/templatedata/TemplateTipsSubText.java | 14 ++++++++++++++
.../TemplateTipsSubTextContent.java | 16 ++++++++++++++++
.../TemplateTipsSubTextContentLink.java | 14 ++++++++++++++
.../TemplateTipsSubTextContentPlainText.java | 13 +++++++++++++
.../bean/oa/templatedata/TemplateTipsText.java | 17 +++++++++++++++++
9 files changed, 113 insertions(+)
create mode 100644 weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/templatedata/TemplateTips.java
create mode 100644 weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/templatedata/TemplateTipsContent.java
create mode 100644 weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/templatedata/TemplateTipsSubText.java
create mode 100644 weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/templatedata/TemplateTipsSubTextContent.java
create mode 100644 weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/templatedata/TemplateTipsSubTextContentLink.java
create mode 100644 weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/templatedata/TemplateTipsSubTextContentPlainText.java
create mode 100644 weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/templatedata/TemplateTipsText.java
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/WxCpOaApprovalTemplateResult.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/WxCpOaApprovalTemplateResult.java
index 2a497d15fc..d10594a546 100644
--- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/WxCpOaApprovalTemplateResult.java
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/WxCpOaApprovalTemplateResult.java
@@ -6,6 +6,7 @@
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
+import me.chanjar.weixin.cp.bean.oa.templatedata.TemplateTips;
import me.chanjar.weixin.cp.bean.oa.templatedata.TemplateTitle;
import me.chanjar.weixin.cp.bean.oa.templatedata.control.*;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
@@ -94,6 +95,9 @@ public static class TemplateConfig implements Serializable {
@SerializedName("vacation_list")
private TemplateVacation vacationList;
+ @SerializedName("tips")
+ private TemplateTips tips;
+
}
@Data
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/templatedata/TemplateConfig.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/templatedata/TemplateConfig.java
index 1a00baad0f..91ee8b7cde 100644
--- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/templatedata/TemplateConfig.java
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/templatedata/TemplateConfig.java
@@ -37,4 +37,6 @@ public class TemplateConfig implements Serializable {
@SerializedName("vacation_list")
private TemplateVacation vacationList;
+ private TemplateTips tips;
+
}
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/templatedata/TemplateTips.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/templatedata/TemplateTips.java
new file mode 100644
index 0000000000..58daeb007c
--- /dev/null
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/templatedata/TemplateTips.java
@@ -0,0 +1,18 @@
+package me.chanjar.weixin.cp.bean.oa.templatedata;
+
+import com.google.gson.annotations.SerializedName;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * @author mrsiu@msn.com
+ * @version 1.0
+ * @date 2025/1/16 09:40
+ */
+@Data
+public class TemplateTips {
+
+ @SerializedName("tips_content")
+ private List tipsContent;
+}
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/templatedata/TemplateTipsContent.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/templatedata/TemplateTipsContent.java
new file mode 100644
index 0000000000..939e6819a0
--- /dev/null
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/templatedata/TemplateTipsContent.java
@@ -0,0 +1,15 @@
+package me.chanjar.weixin.cp.bean.oa.templatedata;
+
+import lombok.Data;
+
+/**
+ * @author mrsiu@msn.com
+ * @version 1.0
+ * @date 2025/1/16 09:42
+ */
+@Data
+public class TemplateTipsContent {
+
+ private TemplateTipsText text;
+ private String lang;
+}
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/templatedata/TemplateTipsSubText.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/templatedata/TemplateTipsSubText.java
new file mode 100644
index 0000000000..ac4681038c
--- /dev/null
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/templatedata/TemplateTipsSubText.java
@@ -0,0 +1,14 @@
+package me.chanjar.weixin.cp.bean.oa.templatedata;
+
+import lombok.Data;
+
+/**
+ * @author mrsiu@msn.com
+ * @version 1.0
+ * @date 2025/1/16 09:45
+ */
+@Data
+public class TemplateTipsSubText {
+ private Integer type;
+ private TemplateTipsSubTextContent content;
+}
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/templatedata/TemplateTipsSubTextContent.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/templatedata/TemplateTipsSubTextContent.java
new file mode 100644
index 0000000000..9c99b2688e
--- /dev/null
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/templatedata/TemplateTipsSubTextContent.java
@@ -0,0 +1,16 @@
+package me.chanjar.weixin.cp.bean.oa.templatedata;
+
+import com.google.gson.annotations.SerializedName;
+import lombok.Data;
+
+/**
+ * @author mrsiu@msn.com
+ * @version 1.0
+ * @date 2025/1/16 09:46
+ */
+@Data
+public class TemplateTipsSubTextContent {
+ @SerializedName("plain_text")
+ private TemplateTipsSubTextContentPlainText plainText;
+ private TemplateTipsSubTextContentLink link;
+}
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/templatedata/TemplateTipsSubTextContentLink.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/templatedata/TemplateTipsSubTextContentLink.java
new file mode 100644
index 0000000000..4cd198409a
--- /dev/null
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/templatedata/TemplateTipsSubTextContentLink.java
@@ -0,0 +1,14 @@
+package me.chanjar.weixin.cp.bean.oa.templatedata;
+
+import lombok.Data;
+
+/**
+ * @author mrsiu@msn.com
+ * @version 1.0
+ * @date 2025/1/16 09:49
+ */
+@Data
+public class TemplateTipsSubTextContentLink {
+ private String title;
+ private String url;
+}
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/templatedata/TemplateTipsSubTextContentPlainText.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/templatedata/TemplateTipsSubTextContentPlainText.java
new file mode 100644
index 0000000000..12969cdcdb
--- /dev/null
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/templatedata/TemplateTipsSubTextContentPlainText.java
@@ -0,0 +1,13 @@
+package me.chanjar.weixin.cp.bean.oa.templatedata;
+
+import lombok.Data;
+
+/**
+ * @author mrsiu@msn.com
+ * @date 2025/1/16 09:47
+ * @version 1.0
+ */
+@Data
+public class TemplateTipsSubTextContentPlainText {
+ private String content;
+}
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/templatedata/TemplateTipsText.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/templatedata/TemplateTipsText.java
new file mode 100644
index 0000000000..100c5bb137
--- /dev/null
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/templatedata/TemplateTipsText.java
@@ -0,0 +1,17 @@
+package me.chanjar.weixin.cp.bean.oa.templatedata;
+
+import com.google.gson.annotations.SerializedName;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * @author mrsiu@msn.com
+ * @date 2025/1/16 09:43
+ * @version 1.0
+ */
+@Data
+public class TemplateTipsText {
+ @SerializedName("sub_text")
+ private List subText;
+}
From b0daf8428e3590898011391366ca6c816a3713dd Mon Sep 17 00:00:00 2001
From: Molzx <31435895+Molzx@users.noreply.github.com>
Date: Fri, 17 Jan 2025 12:02:48 +0800
Subject: [PATCH 042/326] =?UTF-8?q?:new:=20#3479=20=E3=80=90=E5=B0=8F?=
=?UTF-8?q?=E7=A8=8B=E5=BA=8F=E3=80=91=E6=96=B0=E5=A2=9E=E8=AE=A2=E5=8D=95?=
=?UTF-8?q?=E7=AE=A1=E7=90=86=E7=9A=84=E9=85=8D=E7=BD=AE=E5=92=8C=E6=9F=A5?=
=?UTF-8?q?=E8=AF=A2=E8=AE=A2=E5=8D=95=E9=85=8D=E7=BD=AE=E8=B7=AF=E5=BE=84?=
=?UTF-8?q?=E7=9A=84=E6=8E=A5=E5=8F=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../api/WxMaOrderManagementService.java | 40 +++++++++++
.../wx/miniapp/api/WxMaService.java | 6 ++
.../miniapp/api/impl/BaseWxMaServiceImpl.java | 13 ++++
.../impl/WxMaOrderManagementServiceImpl.java | 72 +++++++++++++++++++
...WxMaOrderManagementGetOrderDetailPath.java | 24 +++++++
.../bean/order/WxMaOrderManagementResult.java | 27 +++++++
.../miniapp/constant/WxMaApiUrlConstants.java | 33 ++++++++-
7 files changed, 213 insertions(+), 2 deletions(-)
create mode 100644 weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/WxMaOrderManagementService.java
create mode 100644 weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/WxMaOrderManagementServiceImpl.java
create mode 100644 weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/order/WxMaOrderManagementGetOrderDetailPath.java
create mode 100644 weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/order/WxMaOrderManagementResult.java
diff --git a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/WxMaOrderManagementService.java b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/WxMaOrderManagementService.java
new file mode 100644
index 0000000000..d82cfd19cc
--- /dev/null
+++ b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/WxMaOrderManagementService.java
@@ -0,0 +1,40 @@
+package cn.binarywang.wx.miniapp.api;
+
+import cn.binarywang.wx.miniapp.bean.order.WxMaOrderManagementGetOrderDetailPath;
+import cn.binarywang.wx.miniapp.bean.order.WxMaOrderManagementResult;
+import cn.binarywang.wx.miniapp.bean.shop.response.WxMaOrderShippingInfoBaseResponse;
+import me.chanjar.weixin.common.error.WxErrorException;
+
+/**
+ * @author xzh
+ * @Description
+ * @createTime 2025/01/16 15:20
+ */
+public interface WxMaOrderManagementService {
+
+ /**
+ * 查询订单详情路径
+ * 注意事项
+ * 如果没有配置过订单详情路径,会返回成功,其中path为''。
+ *
+ * @return WxMaOrderManagementGetOrderDetailPath
+ * @throws WxErrorException e
+ */
+ WxMaOrderManagementGetOrderDetailPath getOrderDetailPath()
+ throws WxErrorException;
+
+
+ /**
+ * 配置订单详情路径
+ * 注意事项
+ * 调用接口前需要先完成订单中心授权协议签署。
+ * 请确保配置的path可正常跳转到小程序,并且path必须包含字符串“${商品订单号}”。
+ *
+ * @param path 订单详情路径
+ * @return WxMaOrderManagementResult
+ * @throws WxErrorException e
+ */
+ WxMaOrderManagementResult updateOrderDetailPath(String path)
+ throws WxErrorException;
+
+}
diff --git a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/WxMaService.java b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/WxMaService.java
index 9d55df3797..a5446361a3 100644
--- a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/WxMaService.java
+++ b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/WxMaService.java
@@ -550,6 +550,12 @@ WxMaApiResponse execute(
* @return getWxMaOrderShippingService
*/
WxMaOrderShippingService getWxMaOrderShippingService();
+ /**
+ * 小程序订单管理服务
+ *
+ * @return WxMaOrderManagementService
+ */
+ WxMaOrderManagementService getWxMaOrderManagementService();
/**
* 小程序openApi管理
diff --git a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/BaseWxMaServiceImpl.java b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/BaseWxMaServiceImpl.java
index 344418e318..aa7b061fb1 100644
--- a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/BaseWxMaServiceImpl.java
+++ b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/BaseWxMaServiceImpl.java
@@ -153,6 +153,9 @@ public abstract class BaseWxMaServiceImpl implements WxMaService, RequestH
private final WxMaOrderShippingService wxMaOrderShippingService =
new WxMaOrderShippingServiceImpl(this);
+ private final WxMaOrderManagementService wxMaOrderManagementService =
+ new WxMaOrderManagementServiceImpl(this);
+
private final WxMaOpenApiService wxMaOpenApiService = new WxMaOpenApiServiceImpl(this);
private final WxMaVodService wxMaVodService = new WxMaVodServiceImpl(this);
private final WxMaXPayService wxMaXPayService = new WxMaXPayServiceImpl(this);
@@ -817,6 +820,16 @@ public WxMaOrderShippingService getWxMaOrderShippingService() {
return this.wxMaOrderShippingService;
}
+ /**
+ * 小程序订单管理服务
+ *
+ * @return WxMaOrderManagementService
+ */
+ @Override
+ public WxMaOrderManagementService getWxMaOrderManagementService() {
+ return this.wxMaOrderManagementService;
+ }
+
@Override
public WxMaOpenApiService getWxMaOpenApiService() {
return this.wxMaOpenApiService;
diff --git a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/WxMaOrderManagementServiceImpl.java b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/WxMaOrderManagementServiceImpl.java
new file mode 100644
index 0000000000..7fcf73f5a3
--- /dev/null
+++ b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/WxMaOrderManagementServiceImpl.java
@@ -0,0 +1,72 @@
+package cn.binarywang.wx.miniapp.api.impl;
+
+import cn.binarywang.wx.miniapp.api.WxMaOrderManagementService;
+import cn.binarywang.wx.miniapp.api.WxMaService;
+import cn.binarywang.wx.miniapp.bean.order.WxMaOrderManagementGetOrderDetailPath;
+import cn.binarywang.wx.miniapp.bean.order.WxMaOrderManagementResult;
+import cn.binarywang.wx.miniapp.bean.shop.response.WxMaOrderShippingInfoBaseResponse;
+import cn.binarywang.wx.miniapp.json.WxMaGsonBuilder;
+import com.google.gson.JsonObject;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import me.chanjar.weixin.common.api.WxConsts;
+import me.chanjar.weixin.common.enums.WxType;
+import me.chanjar.weixin.common.error.WxError;
+import me.chanjar.weixin.common.error.WxErrorException;
+import me.chanjar.weixin.common.util.json.GsonHelper;
+import me.chanjar.weixin.common.util.json.GsonParser;
+
+import static cn.binarywang.wx.miniapp.constant.WxMaApiUrlConstants.OrderManagement.*;
+
+
+/**
+ * @author xzh
+ * @Description
+ * @createTime 2025/01/16 15:31
+ */
+@Slf4j
+@RequiredArgsConstructor
+public class WxMaOrderManagementServiceImpl implements WxMaOrderManagementService {
+
+ private final WxMaService wxMaService;
+
+ /**
+ * 查询订单详情路径
+ * 注意事项
+ * 如果没有配置过订单详情路径,会返回成功,其中path为''。
+ *
+ * @return WxMaOrderManagementGetOrderDetailPath
+ * @throws WxErrorException e
+ */
+ @Override
+ public WxMaOrderManagementGetOrderDetailPath getOrderDetailPath() throws WxErrorException {
+ return request(GET_ORDER_DETAIL_PATH, new Object(), WxMaOrderManagementGetOrderDetailPath.class);
+
+ }
+
+ /**
+ * 配置订单详情路径
+ * 注意事项
+ * 调用接口前需要先完成订单中心授权协议签署。
+ * 请确保配置的path可正常跳转到小程序,并且path必须包含字符串“${商品订单号}”。
+ *
+ * @param path 订单详情路径
+ * @return WxMaOrderManagementResult
+ * @throws WxErrorException e
+ */
+ @Override
+ public WxMaOrderManagementResult updateOrderDetailPath(String path) throws WxErrorException {
+ JsonObject jsonObject = GsonHelper.buildJsonObject("path", path);
+ return request(UPDATE_ORDER_DETAIL_PATH, jsonObject, WxMaOrderManagementResult.class);
+
+ }
+
+ private T request(String url, Object request, Class resultT) throws WxErrorException {
+ String responseContent = this.wxMaService.post(url, request);
+ JsonObject jsonObject = GsonParser.parse(responseContent);
+ if (jsonObject.get(WxConsts.ERR_CODE).getAsInt() != 0) {
+ throw new WxErrorException(WxError.fromJson(responseContent, WxType.MiniApp));
+ }
+ return WxMaGsonBuilder.create().fromJson(responseContent, resultT);
+ }
+}
diff --git a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/order/WxMaOrderManagementGetOrderDetailPath.java b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/order/WxMaOrderManagementGetOrderDetailPath.java
new file mode 100644
index 0000000000..02c53a53f8
--- /dev/null
+++ b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/order/WxMaOrderManagementGetOrderDetailPath.java
@@ -0,0 +1,24 @@
+package cn.binarywang.wx.miniapp.bean.order;
+
+import com.google.gson.annotations.SerializedName;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.io.Serializable;
+
+/**
+ * @author xzh
+ * @Description
+ * @createTime 2025/01/16 15:27
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+public class WxMaOrderManagementGetOrderDetailPath extends WxMaOrderManagementResult {
+ private static final long serialVersionUID = -5288666524298706169L;
+
+ /**
+ * 订单详情路径
+ */
+ @SerializedName("path")
+ private String path;
+}
diff --git a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/order/WxMaOrderManagementResult.java b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/order/WxMaOrderManagementResult.java
new file mode 100644
index 0000000000..5a903b8980
--- /dev/null
+++ b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/order/WxMaOrderManagementResult.java
@@ -0,0 +1,27 @@
+package cn.binarywang.wx.miniapp.bean.order;
+
+import com.google.gson.annotations.SerializedName;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @author xzh
+ * @Description
+ * @createTime 2025/01/16 15:27
+ */
+@Data
+public class WxMaOrderManagementResult implements Serializable {
+ private static final long serialVersionUID = 1468925151935770503L;
+ /**
+ * 错误码
+ */
+ @SerializedName("errcode")
+ private Integer errCode;
+
+ /**
+ * 错误原因
+ */
+ @SerializedName("errmsg")
+ private String errMsg;
+}
diff --git a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/constant/WxMaApiUrlConstants.java b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/constant/WxMaApiUrlConstants.java
index 5908385790..d61ade73c3 100644
--- a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/constant/WxMaApiUrlConstants.java
+++ b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/constant/WxMaApiUrlConstants.java
@@ -751,7 +751,7 @@ public interface OrderShipping {
*
*/
String UPLOAD_COMBINED_SHIPPING_INFO =
- "https://api.weixin.qq.com/wxa/sec/order/upload_combined_shipping_info";
+ "https://api.weixin.qq.com/wxa/sec/order/upload_combined_shipping_info";
/**
* 查询订单发货状态.
@@ -779,7 +779,7 @@ public interface OrderShipping {
*
*/
String NOTIFY_CONFIRM_RECEIVE =
- "https://api.weixin.qq.com/wxa/sec/order/notify_confirm_receive";
+ "https://api.weixin.qq.com/wxa/sec/order/notify_confirm_receive";
/**
* 消息跳转路径设置接口.
@@ -809,6 +809,35 @@ public interface OrderShipping {
}
+ /**
+ * 小程序订单管理
+ *
+ *
+ * 文档地址: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/order_center/order_center.html
+ *
+ */
+ public interface OrderManagement {
+
+ /**
+ * 配置订单详情路径.
+ *
+ *
+ * 文档地址:https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/order_center/order_center.html
+ *
+ */
+ String UPDATE_ORDER_DETAIL_PATH = "https://api.weixin.qq.com/wxa/sec/order/update_order_detail_path";
+
+ /**
+ * 查询订单详情路径.
+ *
+ *
+ * 文档地址:https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/order_center/order_center.html
+ *
+ */
+ String GET_ORDER_DETAIL_PATH = "https://api.weixin.qq.com/wxa/sec/order/get_order_detail_path";
+
+ }
+
public interface Vod {
String LIST_MEDIA_URL = "https://api.weixin.qq.com/wxa/sec/vod/listmedia";
String GET_MEDIA_URL = "https://api.weixin.qq.com/wxa/sec/vod/getmedia";
From 704fba4d853d5f65ae7372b38b4fd3ba9e2caba1 Mon Sep 17 00:00:00 2001
From: julb
Date: Sat, 18 Jan 2025 07:53:19 +0000
Subject: [PATCH 043/326] =?UTF-8?q?:art:=20=E3=80=90=E5=BE=AE=E4=BF=A1?=
=?UTF-8?q?=E6=94=AF=E4=BB=98=E3=80=91=E5=85=BC=E5=AE=B9=E5=85=AC=E9=92=A5?=
=?UTF-8?q?=E6=A8=A1=E5=BC=8F=E4=B8=8B=E8=AF=B7=E6=B1=82=E5=A4=B4=E5=BA=8F?=
=?UTF-8?q?=E5=88=97=E5=8F=B7=20!148?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../impl/WxPayServiceApacheHttpImpl.java | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceApacheHttpImpl.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceApacheHttpImpl.java
index e2b6d43fa1..7fd7939797 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceApacheHttpImpl.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceApacheHttpImpl.java
@@ -1,6 +1,7 @@
package com.github.binarywang.wxpay.service.impl;
import com.github.binarywang.wxpay.bean.WxPayApiData;
+import com.github.binarywang.wxpay.config.WxPayConfig;
import com.github.binarywang.wxpay.exception.WxPayException;
import com.github.binarywang.wxpay.v3.WxPayV3DownloadHttpGet;
import com.google.gson.JsonElement;
@@ -171,7 +172,7 @@ public String postV3WithWechatpaySerial(String url, String requestStr) throws Wx
HttpPost httpPost = this.createHttpPost(url, requestStr);
httpPost.addHeader(ACCEPT, APPLICATION_JSON);
httpPost.addHeader(CONTENT_TYPE, APPLICATION_JSON);
- String serialNumber = getConfig().getVerifier().getValidCertificate().getSerialNumber().toString(16).toUpperCase();
+ String serialNumber = getWechatpaySerial(getConfig());
httpPost.addHeader("Wechatpay-Serial", serialNumber);
try (CloseableHttpResponse response = httpClient.execute(httpPost)) {
//v3已经改为通过状态码判断200 204 成功
@@ -251,7 +252,7 @@ public String getV3WithWechatPaySerial(String url) throws WxPayException {
HttpGet httpGet = new HttpGet(url);
httpGet.addHeader(ACCEPT, APPLICATION_JSON);
httpGet.addHeader(CONTENT_TYPE, APPLICATION_JSON);
- String serialNumber = getConfig().getVerifier().getValidCertificate().getSerialNumber().toString(16).toUpperCase();
+ String serialNumber = getWechatpaySerial(getConfig());
httpGet.addHeader("Wechatpay-Serial", serialNumber);
return this.requestV3(url, httpGet);
}
@@ -380,4 +381,16 @@ private WxPayException convertException(JsonObject jsonObject) {
return wxPayException;
}
+ /**
+ * 兼容微信支付公钥模式
+ * @param wxPayConfig
+ * @return
+ */
+ private String getWechatpaySerial(WxPayConfig wxPayConfig) {
+ String serialNumber = wxPayConfig.getVerifier().getValidCertificate().getSerialNumber().toString(16).toUpperCase();
+ if (StringUtils.isNotBlank(wxPayConfig.getPublicKeyId())) {
+ serialNumber = wxPayConfig.getPublicKeyId();
+ }
+ return serialNumber;
+ }
}
From 8e5ee97378d07467a57c6307fdcb86971dd1267e Mon Sep 17 00:00:00 2001
From: giveup
Date: Tue, 21 Jan 2025 18:41:11 +0800
Subject: [PATCH 044/326] =?UTF-8?q?:art:=20#3458=20=E3=80=90=E4=BC=81?=
=?UTF-8?q?=E4=B8=9A=E5=BE=AE=E4=BF=A1=E3=80=91=E5=AE=B6=E6=A0=A1=E6=B2=9F?=
=?UTF-8?q?=E9=80=9A=E8=8E=B7=E5=8F=96=E9=83=A8=E9=97=A8=E5=88=97=E8=A1=A8?=
=?UTF-8?q?=E6=8E=A5=E5=8F=A3=E4=BC=98=E5=8C=96=EF=BC=8C=E5=A6=82=E6=9E=9C?=
=?UTF-8?q?=E9=83=A8=E9=97=A8id=E4=B8=BA=E7=A9=BA=E5=88=99=E8=8E=B7?=
=?UTF-8?q?=E5=8F=96=E5=85=A8=E9=87=8F=E7=BB=84=E7=BB=87=E6=9E=B6=E6=9E=84?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../weixin/cp/api/WxCpSchoolUserService.java | 2 +-
.../api/impl/WxCpSchoolUserServiceImpl.java | 3 +-
.../weixin/cp/constant/WxCpApiPathConsts.java | 2 +-
.../impl/WxCpSchoolUserServiceImplTest.java | 139 ++++++++++++++++++
4 files changed, 143 insertions(+), 3 deletions(-)
create mode 100644 weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/impl/WxCpSchoolUserServiceImplTest.java
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpSchoolUserService.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpSchoolUserService.java
index 26cfe3a019..a92bfcc100 100644
--- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpSchoolUserService.java
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpSchoolUserService.java
@@ -334,7 +334,7 @@ WxCpBaseResp updateStudent(@NonNull String studentUserId, String newStudentUserI
* 请求方式:GET(HTTPS)
* 请求地址:https://qyapi.weixin.qq.com/cgi-bin/school/department/list?access_token=ACCESS_TOKEN&id=ID
*
- * @param id the id
+ * @param id 部门id。获取指定部门及其下的子部门。 如果不填,默认获取全量组织架构
* @return wx cp department list
* @throws WxErrorException the wx error exception
*/
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpSchoolUserServiceImpl.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpSchoolUserServiceImpl.java
index fac1689e08..58bf20873f 100644
--- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpSchoolUserServiceImpl.java
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpSchoolUserServiceImpl.java
@@ -16,6 +16,7 @@
import org.apache.commons.lang3.StringUtils;
import java.util.List;
+import java.util.Objects;
import static me.chanjar.weixin.cp.constant.WxCpApiPathConsts.ExternalContact.*;
import static me.chanjar.weixin.cp.constant.WxCpApiPathConsts.School.*;
@@ -246,7 +247,7 @@ public String convertToOpenId(@NonNull String externalUserId) throws WxErrorExce
@Override
public WxCpDepartmentList listDepartment(Integer id) throws WxErrorException {
- String apiUrl = this.cpService.getWxCpConfigStorage().getApiUrl(DEPARTMENT_LIST) + id;
+ String apiUrl = Objects.isNull(id) ? this.cpService.getWxCpConfigStorage().getApiUrl(DEPARTMENT_LIST) : String.format("%s?id=%s", this.cpService.getWxCpConfigStorage().getApiUrl(DEPARTMENT_LIST), id);
String responseContent = this.cpService.get(apiUrl, null);
return WxCpDepartmentList.fromJson(responseContent);
}
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/constant/WxCpApiPathConsts.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/constant/WxCpApiPathConsts.java
index b53f7549d7..dfb38a5243 100644
--- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/constant/WxCpApiPathConsts.java
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/constant/WxCpApiPathConsts.java
@@ -691,7 +691,7 @@ interface School {
/**
* The constant DEPARTMENT_LIST.
*/
- String DEPARTMENT_LIST = "/cgi-bin/school/department/list?id=";
+ String DEPARTMENT_LIST = "/cgi-bin/school/department/list";
/**
* The constant GET_PAYMENT_RESULT.
diff --git a/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/impl/WxCpSchoolUserServiceImplTest.java b/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/impl/WxCpSchoolUserServiceImplTest.java
new file mode 100644
index 0000000000..da1cc25542
--- /dev/null
+++ b/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/impl/WxCpSchoolUserServiceImplTest.java
@@ -0,0 +1,139 @@
+package me.chanjar.weixin.cp.api.impl;
+
+import com.google.gson.Gson;
+import me.chanjar.weixin.common.error.WxErrorException;
+import me.chanjar.weixin.cp.api.WxCpService;
+import me.chanjar.weixin.cp.bean.school.user.WxCpDepartmentList;
+import me.chanjar.weixin.cp.config.impl.WxCpDefaultConfigImpl;
+import org.mockito.Mockito;
+import org.testng.annotations.Test;
+
+import static me.chanjar.weixin.cp.constant.WxCpApiPathConsts.School.DEPARTMENT_LIST;
+import static org.testng.Assert.assertEquals;
+
+public class WxCpSchoolUserServiceImplTest {
+
+
+ String allDeptListJson = "{\n" +
+ "\t\"errcode\": 0,\n" +
+ "\t\"errmsg\": \"ok\",\n" +
+ "\t\"departments\": [\n" +
+ "\t\t{\n" +
+ "\t\t\t\"name\": \"一年级\",\n" +
+ "\t\t\t\"parentid\": 1,\n" +
+ "\t\t\t\"id\": 2,\n" +
+ "\t\t\t\"type\":2,\n" +
+ "\t\t\t\"register_year\":2018,\n" +
+ "\t\t\t\"standard_grade\":1,\n" +
+ "\t\t\t\"order\":1,\n" +
+ "\t\t\t\"department_admins\": [\n" +
+ "\t\t\t\t{\n" +
+ "\t\t\t\t\t\"userid\": \"zhangsan\",\n" +
+ "\t\t\t\t\t\"type\": 1\n" +
+ "\t\t\t\t},\n" +
+ "\t\t\t\t{\n" +
+ "\t\t\t\t\t\"userid\": \"lisi\",\n" +
+ "\t\t\t\t\t\"type\": 2\n" +
+ "\t\t\t\t}\n" +
+ "\t\t\t],\n" +
+ " \"is_graduated\": 0\n" +
+ "\t\t},\n" +
+ "\t\t{\n" +
+ "\t\t\t\"name\": \"一年级一班\",\n" +
+ "\t\t\t\"parentid\": 1,\n" +
+ "\t\t\t\"id\": 3,\n" +
+ "\t\t\t\"type\": 1,\n" +
+ "\t\t\t\"department_admins\": [\n" +
+ "\t\t\t\t{\n" +
+ "\t\t\t\t\t\"userid\": \"zhangsan\",\n" +
+ "\t\t\t\t\t\"type\": 3,\n" +
+ "\t\t\t\t\t\"subject\":\"语文\"\n" +
+ "\t\t\t\t},\n" +
+ "\t\t\t\t{\n" +
+ "\t\t\t\t\t\"userid\": \"lisi\",\n" +
+ "\t\t\t\t\t\"type\": 4,\n" +
+ "\t\t\t\t\t\"subject\":\"数学\"\n" +
+ "\t\t\t\t}\n" +
+ "\t\t\t],\n" +
+ "\t\t\t\"open_group_chat\": 1,\n" +
+ " \"group_chat_id\": \"group_chat_id\"\n" +
+ "\t\t}\n" +
+ "\t]\n" +
+ "}\n";
+
+ String deptId3Json = "{\n" +
+ " \"errcode\": 0,\n" +
+ " \"errmsg\": \"ok\",\n" +
+ " \"departments\": [\n" +
+ " {\n" +
+ " \"name\": \"一年级一班\",\n" +
+ " \"parentid\": 1,\n" +
+ " \"id\": 3,\n" +
+ " \"type\": 1,\n" +
+ " \"department_admins\": [\n" +
+ " {\n" +
+ " \"userid\": \"zhangsan\",\n" +
+ " \"type\": 3,\n" +
+ " \"subject\":\"语文\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"userid\": \"lisi\",\n" +
+ " \"type\": 4,\n" +
+ " \"subject\":\"数学\"\n" +
+ " }\n" +
+ " ],\n" +
+ " \"open_group_chat\": 1,\n" +
+ " \"group_chat_id\": \"group_chat_id\"\n" +
+ " }\n" +
+ " ]\n" +
+ "}";
+
+ String deptId2Json = "{\n" +
+ " \"errcode\": 0,\n" +
+ " \"errmsg\": \"ok\",\n" +
+ " \"departments\": []\n" +
+ "}\n";
+
+
+ @Test
+ public void testListDepartmentWhenIdIsNull() throws WxErrorException {
+
+ WxCpService mockCpService = Mockito.mock(WxCpService.class);
+ WxCpSchoolUserServiceImpl wxCpSchoolUserService = new WxCpSchoolUserServiceImpl(mockCpService);
+ Mockito.when(mockCpService.getWxCpConfigStorage()).thenReturn(new WxCpDefaultConfigImpl());
+ Mockito.when(mockCpService.get(mockCpService.getWxCpConfigStorage().getApiUrl(DEPARTMENT_LIST), null)).thenReturn(allDeptListJson);
+ WxCpDepartmentList wxCpDepartmentList = wxCpSchoolUserService.listDepartment(null);
+ //WxCpDepartmentList没有重写Equals和Hashcode,不能直接比较
+ Gson gson = new Gson();
+ assertEquals(gson.toJson(wxCpDepartmentList), gson.toJson(gson.fromJson(allDeptListJson, WxCpDepartmentList.class)), "should be equal");
+
+ }
+
+ @Test
+ public void testListDepartmentWhenIdIs2() throws WxErrorException {
+
+ WxCpService mockCpService = Mockito.mock(WxCpService.class);
+ WxCpSchoolUserServiceImpl wxCpSchoolUserService = new WxCpSchoolUserServiceImpl(mockCpService);
+ Mockito.when(mockCpService.getWxCpConfigStorage()).thenReturn(new WxCpDefaultConfigImpl());
+ Gson gson = new Gson();
+ int deptId = 2;
+ Mockito.when(mockCpService.get(String.format("%s?id=%s", mockCpService.getWxCpConfigStorage().getApiUrl(DEPARTMENT_LIST), deptId), null)).thenReturn(deptId2Json);
+ //WxCpDepartmentList没有重写Equals和Hashcode,不能直接比较
+ assertEquals(gson.toJson(wxCpSchoolUserService.listDepartment(deptId)), gson.toJson(gson.fromJson(deptId2Json, WxCpDepartmentList.class)), "should be equal");
+
+ }
+
+ @Test
+ public void testListDepartmentWhenIdIs3() throws WxErrorException {
+
+ WxCpService mockCpService = Mockito.mock(WxCpService.class);
+ WxCpSchoolUserServiceImpl wxCpSchoolUserService = new WxCpSchoolUserServiceImpl(mockCpService);
+ Mockito.when(mockCpService.getWxCpConfigStorage()).thenReturn(new WxCpDefaultConfigImpl());
+ Gson gson = new Gson();
+ int deptId = 3;
+ Mockito.when(mockCpService.get(String.format("%s?id=%s", mockCpService.getWxCpConfigStorage().getApiUrl(DEPARTMENT_LIST), deptId), null)).thenReturn(deptId3Json);
+ //WxCpDepartmentList没有重写Equals和Hashcode,不能直接比较
+ assertEquals(gson.toJson(wxCpSchoolUserService.listDepartment(deptId)), gson.toJson(gson.fromJson(deptId3Json, WxCpDepartmentList.class)), "should be equal");
+
+ }
+}
From 1e003ee571848bbc5c27d18eb96440921546a7c6 Mon Sep 17 00:00:00 2001
From: GadflyFang
Date: Tue, 21 Jan 2025 18:44:33 +0800
Subject: [PATCH 045/326] =?UTF-8?q?:art:=20=E4=BF=AE=E5=A4=8D=2094aaff4=20?=
=?UTF-8?q?=E5=BC=95=E5=85=A5=E7=9A=84=E9=94=99=E8=AF=AF=E8=AF=BB=E5=8F=96?=
=?UTF-8?q?=E8=AF=81=E4=B9=A6=E7=9A=84=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../java/com/github/binarywang/wxpay/config/WxPayConfig.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java
index 293c52eac6..8cbf954ee2 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java
@@ -14,6 +14,7 @@
import java.security.PublicKey;
import java.security.cert.Certificate;
import java.security.cert.X509Certificate;
+import java.util.Base64;
import java.util.Optional;
import javax.net.ssl.SSLContext;
import lombok.Data;
@@ -371,7 +372,7 @@ private InputStream loadConfigInputStream(String configString, String configPath
if (configContent != null) {
inputStream = new ByteArrayInputStream(configContent);
} else if (StringUtils.isNotEmpty(configString)) {
- configContent = configString.getBytes(StandardCharsets.UTF_8);
+ configContent = Base64.getDecoder().decode(configString);
inputStream = new ByteArrayInputStream(configContent);
} else {
if (StringUtils.isBlank(configPath)) {
From 24ebc91dca899bc9248b2e4b8067987e45515f5c Mon Sep 17 00:00:00 2001
From: Neror <7885514+NerorRepository@user.noreply.gitee.com>
Date: Mon, 20 Jan 2025 16:12:00 +0000
Subject: [PATCH 046/326] =?UTF-8?q?:art:=20=E3=80=90=E5=BE=AE=E4=BF=A1?=
=?UTF-8?q?=E6=94=AF=E4=BB=98=E3=80=91=E5=A2=9E=E5=8A=A0=E5=A4=9A=E9=85=8D?=
=?UTF-8?q?=E7=BD=AE=E5=88=87=E6=8D=A2=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../wxpay/service/WxPayService.java | 25 ++++---
.../service/impl/BaseWxPayServiceImpl.java | 75 ++++++++++---------
2 files changed, 55 insertions(+), 45 deletions(-)
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/WxPayService.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/WxPayService.java
index 19b4ed0a07..8ceac2b6ba 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/WxPayService.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/WxPayService.java
@@ -39,16 +39,18 @@ public interface WxPayService {
* Map里 加入新的 {@link WxPayConfig},适用于动态添加新的微信商户配置.
*
* @param mchId 商户id
+ * @param appId 微信应用id
* @param wxPayConfig 新的微信配置
*/
- void addConfig(String mchId, WxPayConfig wxPayConfig);
+ void addConfig(String mchId, String appId, WxPayConfig wxPayConfig);
/**
- * 从 Map中 移除 {@link String mchId} 所对应的 {@link WxPayConfig},适用于动态移除微信商户配置.
+ * 从 Map中 移除 {@link String mchId} 和 {@link String appId} 所对应的 {@link WxPayConfig},适用于动态移除微信商户配置.
*
* @param mchId 对应商户的标识
+ * @param appId 微信应用id
*/
- void removeConfig(String mchId);
+ void removeConfig(String mchId, String appId);
/**
* 注入多个 {@link WxPayConfig} 的实现. 并为每个 {@link WxPayConfig} 赋予不同的 {@link String mchId} 值
@@ -70,17 +72,19 @@ public interface WxPayService {
* 进行相应的商户切换.
*
* @param mchId 商户标识
+ * @param appId 微信应用id
* @return 切换是否成功 boolean
*/
- boolean switchover(String mchId);
+ boolean switchover(String mchId, String appId);
/**
* 进行相应的商户切换.
*
* @param mchId 商户标识
+ * @param appId 微信应用id
* @return 切换成功 ,则返回当前对象,方便链式调用,否则抛出异常
*/
- WxPayService switchoverTo(String mchId);
+ WxPayService switchoverTo(String mchId, String appId);
/**
* 发送post请求,得到响应字节数组.
@@ -617,10 +621,10 @@ public interface WxPayService {
/**
* 调用统一下单接口,并组装生成支付所需参数对象.
*
- * @param 请使用{@link com.github.binarywang.wxpay.bean.result.WxPayUnifiedOrderV3Result}里的内部类或字段
+ * @param 请使用{@link WxPayUnifiedOrderV3Result}里的内部类或字段
* @param tradeType the trade type
* @param request 统一下单请求参数
- * @return 返回 {@link com.github.binarywang.wxpay.bean.result.WxPayUnifiedOrderV3Result}里的内部类或字段
+ * @return 返回 {@link WxPayUnifiedOrderV3Result}里的内部类或字段
* @throws WxPayException the wx pay exception
*/
T createOrderV3(TradeTypeEnum tradeType, WxPayUnifiedOrderV3Request request) throws WxPayException;
@@ -628,10 +632,10 @@ public interface WxPayService {
/**
* 服务商模式调用统一下单接口,并组装生成支付所需参数对象.
*
- * @param 请使用{@link com.github.binarywang.wxpay.bean.result.WxPayUnifiedOrderV3Result}里的内部类或字段
+ * @param 请使用{@link WxPayUnifiedOrderV3Result}里的内部类或字段
* @param tradeType the trade type
* @param request 统一下单请求参数
- * @return 返回 {@link com.github.binarywang.wxpay.bean.result.WxPayUnifiedOrderV3Result}里的内部类或字段
+ * @return 返回 {@link WxPayUnifiedOrderV3Result}里的内部类或字段
* @throws WxPayException the wx pay exception
*/
T createPartnerOrderV3(TradeTypeEnum tradeType, WxPayPartnerUnifiedOrderV3Request request) throws WxPayException;
@@ -1615,7 +1619,8 @@ WxPayRefundQueryResult refundQuery(String transactionId, String outTradeNo, Stri
/**
* 获取服务商直股份签约计划服务类
- * @return the partner pay score sign plan service
+ *
+ * @return the partner pay score sign plan service
*/
PartnerPayScoreSignPlanService getPartnerPayScoreSignPlanService();
}
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java
index 7c2055cec3..1fa2f8dc80 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java
@@ -14,7 +14,6 @@
import com.github.binarywang.wxpay.bean.transfer.TransferBillsNotifyResult;
import com.github.binarywang.wxpay.config.WxPayConfig;
import com.github.binarywang.wxpay.config.WxPayConfigHolder;
-import com.github.binarywang.wxpay.constant.WxPayConstants;
import com.github.binarywang.wxpay.constant.WxPayConstants.SignType;
import com.github.binarywang.wxpay.constant.WxPayConstants.TradeType;
import com.github.binarywang.wxpay.exception.WxPayException;
@@ -46,6 +45,7 @@
import java.nio.file.Paths;
import java.security.GeneralSecurityException;
import java.util.*;
+import java.util.concurrent.ConcurrentHashMap;
import java.util.zip.ZipException;
import static com.github.binarywang.wxpay.constant.WxPayConstants.QUERY_COMMENT_DATE_FORMAT;
@@ -122,7 +122,7 @@ public abstract class BaseWxPayServiceImpl implements WxPayService {
private final PartnerPayScoreService partnerPayScoreService = new PartnerPayScoreServiceImpl(this);
@Getter
- private final PartnerPayScoreSignPlanService partnerPayScoreSignPlanService=new PartnerPayScoreSignPlanServiceImpl(this);
+ private final PartnerPayScoreSignPlanService partnerPayScoreSignPlanService = new PartnerPayScoreSignPlanServiceImpl(this);
@Getter
private final MerchantTransferService merchantTransferService = new MerchantTransferServiceImpl(this);
@@ -130,7 +130,7 @@ public abstract class BaseWxPayServiceImpl implements WxPayService {
@Getter
private final BrandMerchantTransferService brandMerchantTransferService = new BrandMerchantTransferServiceImpl(this);
- protected Map configMap = new HashMap<>();
+ protected Map configMap = new ConcurrentHashMap<>();
@Override
public WxPayConfig getConfig() {
@@ -143,38 +143,37 @@ public WxPayConfig getConfig() {
@Override
public void setConfig(WxPayConfig config) {
- final String defaultMchId = config.getMchId();
- this.setMultiConfig(ImmutableMap.of(defaultMchId, config), defaultMchId);
+ final String defaultKey = this.getConfigKey(config.getMchId(), config.getAppId());
+ this.setMultiConfig(ImmutableMap.of(defaultKey, config), defaultKey);
}
@Override
- public void addConfig(String mchId, WxPayConfig wxPayConfig) {
+ public void addConfig(String mchId, String appId, WxPayConfig wxPayConfig) {
synchronized (this) {
if (this.configMap == null) {
this.setConfig(wxPayConfig);
} else {
- WxPayConfigHolder.set(mchId);
- this.configMap.put(mchId, wxPayConfig);
+ String configKey = this.getConfigKey(mchId, appId);
+ WxPayConfigHolder.set(configKey);
+ this.configMap.put(configKey, wxPayConfig);
}
}
}
@Override
- public void removeConfig(String mchId) {
+ public void removeConfig(String mchId, String appId) {
synchronized (this) {
- if (this.configMap.size() == 1) {
- this.configMap.remove(mchId);
- log.warn("已删除最后一个商户号配置:{},须立即使用setConfig或setMultiConfig添加配置", mchId);
+ String configKey = this.getConfigKey(mchId, appId);
+ this.configMap.remove(configKey);
+ if (this.configMap.isEmpty()) {
+ log.warn("已删除最后一个商户号配置:mchId[{}],appid[{}],须立即使用setConfig或setMultiConfig添加配置", mchId, appId);
return;
}
- if (WxPayConfigHolder.get().equals(mchId)) {
- this.configMap.remove(mchId);
- final String defaultMpId = this.configMap.keySet().iterator().next();
- WxPayConfigHolder.set(defaultMpId);
- log.warn("已删除默认商户号配置,商户号【{}】被设为默认配置", defaultMpId);
- return;
+ if (WxPayConfigHolder.get().equals(configKey)) {
+ final String nextConfigKey = this.configMap.keySet().iterator().next();
+ WxPayConfigHolder.set(nextConfigKey);
+ log.warn("已删除默认商户号配置,商户号【{}】被设为默认配置", nextConfigKey);
}
- this.configMap.remove(mchId);
}
}
@@ -184,28 +183,34 @@ public void setMultiConfig(Map wxPayConfigs) {
}
@Override
- public void setMultiConfig(Map wxPayConfigs, String defaultMchId) {
+ public void setMultiConfig(Map wxPayConfigs, String defaultConfigKey) {
this.configMap = Maps.newHashMap(wxPayConfigs);
- WxPayConfigHolder.set(defaultMchId);
+ WxPayConfigHolder.set(defaultConfigKey);
}
@Override
- public boolean switchover(String mchId) {
- if (this.configMap.containsKey(mchId)) {
- WxPayConfigHolder.set(mchId);
+ public boolean switchover(String mchId, String appId) {
+ String configKey = this.getConfigKey(mchId, appId);
+ if (this.configMap.containsKey(configKey)) {
+ WxPayConfigHolder.set(configKey);
return true;
}
- log.error("无法找到对应【{}】的商户号配置信息,请核实!", mchId);
+ log.error("无法找到对应mchId=【{}】,appId=【{}】的商户号配置信息,请核实!", mchId, appId);
return false;
}
@Override
- public WxPayService switchoverTo(String mchId) {
- if (this.configMap.containsKey(mchId)) {
- WxPayConfigHolder.set(mchId);
+ public WxPayService switchoverTo(String mchId, String appId) {
+ String configKey = this.getConfigKey(mchId, appId);
+ if (this.configMap.containsKey(configKey)) {
+ WxPayConfigHolder.set(configKey);
return this;
}
- throw new WxRuntimeException(String.format("无法找到对应【%s】的商户号配置信息,请核实!", mchId));
+ throw new WxRuntimeException(String.format("无法找到对应mchId=【%s】,appId=【%s】的商户号配置信息,请核实!", mchId, appId));
+ }
+
+ private String getConfigKey(String mchId, String appId) {
+ return mchId + "_" + appId;
}
@Override
@@ -302,7 +307,7 @@ public WxPayRefundQueryV3Result refundQueryV3(WxPayRefundQueryV3Request request)
@Override
public WxPayRefundQueryV3Result refundPartnerQueryV3(WxPayRefundQueryV3Request request) throws WxPayException {
- String url = String.format("%s/v3/refund/domestic/refunds/%s?sub_mchid=%s", this.getPayBaseUrl(), request.getOutRefundNo(),request.getSubMchid());
+ String url = String.format("%s/v3/refund/domestic/refunds/%s?sub_mchid=%s", this.getPayBaseUrl(), request.getOutRefundNo(), request.getSubMchid());
String response = this.getV3(url);
return GSON.fromJson(response, WxPayRefundQueryV3Result.class);
}
@@ -324,7 +329,7 @@ public WxPayOrderNotifyResult parseOrderNotifyResult(String xmlData, String sign
} else if (configMap.get(result.getMchId()).getSignType() != null) {
// 如果配置中signType有值,则使用它进行验签
signType = configMap.get(result.getMchId()).getSignType();
- this.switchover(result.getMchId());
+ this.switchover(result.getMchId(), result.getAppid());
}
}
@@ -347,7 +352,7 @@ public WxPayOrderNotifyResult parseOrderNotifyResult(String xmlData, String sign
*/
private boolean verifyNotifySign(SignatureHeader header, String data) throws WxSignTestException {
String wxPaySign = header.getSignature();
- if(wxPaySign.startsWith("WECHATPAY/SIGNTEST/")){
+ if (wxPaySign.startsWith("WECHATPAY/SIGNTEST/")) {
throw new WxSignTestException("微信支付签名探测流量");
}
String beforeSign = String.format("%s\n%s\n%s\n",
@@ -421,7 +426,7 @@ public WxPayRefundNotifyResult parseRefundNotifyResult(String xmlData) throws Wx
WxPayRefundNotifyResult result;
if (XmlConfig.fastMode) {
result = BaseWxPayResult.fromXML(xmlData, WxPayRefundNotifyResult.class);
- this.switchover(result.getMchId());
+ this.switchover(result.getMchId(), result.getAppid());
result.decryptReqInfo(this.getConfig().getMchKey());
} else {
result = WxPayRefundNotifyResult.fromXML(xmlData, this.getConfig().getMchKey());
@@ -458,7 +463,7 @@ public WxScanPayNotifyResult parseScanPayNotifyResult(String xmlData, @Deprecate
try {
log.debug("扫码支付回调通知请求参数:{}", xmlData);
WxScanPayNotifyResult result = BaseWxPayResult.fromXML(xmlData, WxScanPayNotifyResult.class);
- this.switchover(result.getMchId());
+ this.switchover(result.getMchId(), result.getAppid());
log.debug("扫码支付回调通知解析后的对象:{}", result);
result.checkResult(this, this.getConfig().getSignType(), false);
return result;
@@ -1306,7 +1311,7 @@ public String queryComment(WxPayQueryCommentRequest request) throws WxPayExcepti
@Override
public WxPayFaceAuthInfoResult getWxPayFaceAuthInfo(WxPayFaceAuthInfoRequest request) throws WxPayException {
if (StringUtils.isEmpty(request.getSignType())) {
- request.setSignType(WxPayConstants.SignType.MD5);
+ request.setSignType(SignType.MD5);
}
request.checkAndSign(this.getConfig());
From c3b16228c00c885b9456b8cceec484110994b55a Mon Sep 17 00:00:00 2001
From: Neror <7885514+NerorRepository@user.noreply.gitee.com>
Date: Tue, 21 Jan 2025 11:49:38 +0000
Subject: [PATCH 047/326] =?UTF-8?q?:art:=20=E3=80=90=E5=BE=AE=E4=BF=A1?=
=?UTF-8?q?=E6=94=AF=E4=BB=98=E3=80=91=E5=AE=8C=E5=96=84=E5=BE=AE=E4=BF=A1?=
=?UTF-8?q?=E5=95=86=E5=AE=B6=E8=BD=AC=E8=B4=A6=E5=8A=9F=E8=83=BDAPI=20!15?=
=?UTF-8?q?1?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../transfer/TransferBillsCancelResult.java | 48 ++++++++
.../bean/transfer/TransferBillsGetResult.java | 103 ++++++++++++++++++
.../bean/transfer/TransferBillsResult.java | 7 +-
.../wxpay/constant/WxPayConstants.java | 83 ++++++++++++++
.../wxpay/service/TransferService.java | 51 +++++++++
.../service/impl/TransferServiceImpl.java | 31 +++++-
.../service/impl/TransferServiceImplTest.java | 15 +++
7 files changed, 332 insertions(+), 6 deletions(-)
create mode 100644 weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/TransferBillsCancelResult.java
create mode 100644 weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/TransferBillsGetResult.java
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/TransferBillsCancelResult.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/TransferBillsCancelResult.java
new file mode 100644
index 0000000000..9e59fecf73
--- /dev/null
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/TransferBillsCancelResult.java
@@ -0,0 +1,48 @@
+package com.github.binarywang.wxpay.bean.transfer;
+
+import com.google.gson.annotations.SerializedName;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+/**
+ *
+ * 商家转账到零钱撤销转账接口
+ * 文档地址:https://pay.weixin.qq.com/doc/v3/merchant/4012716458
+ *
+ *
+ * @author Nor
+ * @date 2025/1/17
+ */
+@Data
+@NoArgsConstructor
+public class TransferBillsCancelResult implements Serializable {
+ private static final long serialVersionUID = -4935840810530008418L;
+
+ /**
+ * 【商户单号】 商户系统内部的商家单号,要求此参数只能由数字、大小写字母组成,在商户系统内部唯一
+ */
+ @SerializedName("out_bill_no")
+ private String outBillNo;
+
+ /**
+ * 【微信转账单号】 微信转账单号,微信商家转账系统返回的唯一标识
+ */
+ @SerializedName("transfer_bill_no")
+ private String transferBillNo;
+
+ /**
+ * 【单据状态】 商家转账订单状态
+ * 可选取值
+ * CANCELING: 商户撤销请求受理成功,该笔转账正在撤销中
+ * CANCELLED: 转账撤销完成
+ */
+ private String state;
+
+ /**
+ * 【最后一次单据状态变更时间】 按照使用rfc3339所定义的格式,格式为yyyy-MM-DDThh:mm:ss+TIMEZONE
+ */
+ @SerializedName("update_time")
+ private String updateTime;
+}
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/TransferBillsGetResult.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/TransferBillsGetResult.java
new file mode 100644
index 0000000000..2e24a4a3c6
--- /dev/null
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/TransferBillsGetResult.java
@@ -0,0 +1,103 @@
+package com.github.binarywang.wxpay.bean.transfer;
+
+import com.github.binarywang.wxpay.constant.WxPayConstants;
+import com.google.gson.annotations.SerializedName;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+/**
+ *
+ * 商家转账到零钱查询转账单接口
+ * 文档地址:https://pay.weixin.qq.com/doc/v3/merchant/4012716457 https://pay.weixin.qq.com/doc/v3/merchant/4012716437
+ *
+ *
+ * @author Nor
+ * @date 2025/1/17
+ */
+@Data
+@NoArgsConstructor
+public class TransferBillsGetResult implements Serializable {
+ private static final long serialVersionUID = -6376955113492371763L;
+
+ /**
+ * 【商户号】 微信支付分配的商户号
+ */
+ @SerializedName("mch_id")
+ private String mchId;
+
+ /**
+ * 【商户单号】 商户系统内部的商家单号,要求此参数只能由数字、大小写字母组成,在商户系统内部唯一
+ */
+ @SerializedName("out_bill_no")
+ private String outBillNo;
+
+ /**
+ * 【商家转账订单号】 商家转账订单的主键,唯一定义此资源的标识
+ */
+ @SerializedName("transfer_bill_no")
+ private String transferBillNo;
+
+ /**
+ * 【商户AppID】 申请商户号的AppID或商户号绑定的AppID(企业号corpid即为此AppID)
+ */
+ private String appid;
+
+ /**
+ * 【单据状态】
+ * 可选取值
+ * ACCEPTED: 转账已受理
+ * PROCESSING: 转账处理中,转账结果尚未明确,如一直处于此状态,建议检查账户余额是否足够
+ * WAIT_USER_CONFIRM: 待收款用户确认,可拉起微信收款确认页面进行收款确认
+ * TRANSFERING: 转账结果尚未明确,可拉起微信收款确认页面再次重试确认收款
+ * SUCCESS: 转账成功
+ * FAIL: 转账失败
+ * CANCELING: 商户撤销请求受理成功,该笔转账正在撤销中
+ * CANCELLED: 转账撤销完成
+ *
+ * @see WxPayConstants.TransformBillState
+ */
+ private String state;
+
+ /**
+ * 【转账金额】 转账金额单位为“分”。
+ */
+ @SerializedName("transfer_amount")
+ private String transferAmount;
+
+ /**
+ * 【转账备注】 单条转账备注(微信用户会收到该备注),UTF8编码,最多允许32个字符
+ */
+ @SerializedName("transfer_remark")
+ private String transferRemark;
+
+ /**
+ * 【失败原因】 订单已失败或者已退资金时,返回失败原因
+ */
+ @SerializedName("fail_reason")
+ private String failReason;
+
+ /**
+ * 【收款用户OpenID】 商户AppID下,某用户的OpenID
+ */
+ private String openid;
+
+ /**
+ * 【收款用户姓名】 收款方真实姓名。支持标准RSA算法和国密算法,公钥由微信侧提供转账金额 >= 2,000元时,该笔明细必须填写若商户传入收款用户姓名,微信支付会校验用户OpenID与姓名是否一致,并提供电子回单
+ */
+ @SerializedName("user_name")
+ private String userName;
+
+ /**
+ * 【单据创建时间】 单据受理成功时返回,按照使用rfc3339所定义的格式,格式为yyyy-MM-DDThh:mm:ss+TIMEZONE
+ */
+ @SerializedName("create_time")
+ private String createTime;
+
+ /**
+ * 【最后一次状态变更时间】 单据最后更新时间,按照使用rfc3339所定义的格式,格式为yyyy-MM-DDThh:mm:ss+TIMEZONE
+ */
+ @SerializedName("update_time")
+ private String updateTime;
+}
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/TransferBillsResult.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/TransferBillsResult.java
index 9f7aac7fbb..78e0aec6ab 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/TransferBillsResult.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/TransferBillsResult.java
@@ -1,5 +1,6 @@
package com.github.binarywang.wxpay.bean.transfer;
+import com.github.binarywang.wxpay.constant.WxPayConstants;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
import lombok.NoArgsConstructor;
@@ -37,9 +38,11 @@ public class TransferBillsResult implements Serializable {
/**
* 单据状态
+ *
+ * @see WxPayConstants.TransformBillState
*/
- @SerializedName("status")
- private String status;
+ @SerializedName("state")
+ private String state;
/**
* 失败原因
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/constant/WxPayConstants.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/constant/WxPayConstants.java
index 819cdfe731..e8a6b6acb3 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/constant/WxPayConstants.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/constant/WxPayConstants.java
@@ -6,6 +6,7 @@
import com.github.binarywang.wxpay.bean.order.WxPayNativeOrderResult;
import com.github.binarywang.wxpay.bean.result.WxPayMicropayResult;
import com.google.common.collect.Lists;
+import lombok.experimental.UtilityClass;
import org.apache.commons.lang3.time.FastDateFormat;
import java.text.Format;
@@ -353,4 +354,86 @@ public static class ReceiverType {
public static final String PERSONAL_SUB_OPENID = "PERSONAL_SUB_OPENID";
}
+ /**
+ * 微信商户转账订单状态
+ */
+ @UtilityClass
+ public static class TransformBillState {
+ /**
+ * 转账已受理
+ */
+ public static final String ACCEPTED = "ACCEPTED";
+
+ /**
+ * 转账处理中,转账结果尚未明确,如一直处于此状态,建议检查账户余额是否足够
+ */
+ public static final String PROCESSING = "PROCESSING";
+
+ /**
+ * 待收款用户确认,可拉起微信收款确认页面进行收款确认
+ */
+ public static final String WAIT_USER_CONFIRM = "WAIT_USER_CONFIRM";
+
+ /**
+ * 转账结果尚未明确,可拉起微信收款确认页面再次重试确认收款
+ */
+ public static final String TRANSFERING = "TRANSFERING";
+
+ /**
+ * 转账成功
+ */
+ public static final String SUCCESS = "SUCCESS";
+
+ /**
+ * 转账失败
+ */
+ public static final String FAIL = "FAIL";
+
+ /**
+ * 商户撤销请求受理成功,该笔转账正在撤销中
+ */
+ public static final String CANCELING = "CANCELING";
+
+ /**
+ * 转账撤销完成
+ */
+ public static final String CANCELLED = "CANCELLED";
+
+ }
+
+ /**
+ * 【转账场景ID】 该笔转账使用的转账场景,可前往“商户平台-产品中心-商家转账”中申请。
+ */
+ @UtilityClass
+ public static class TransformSceneId {
+ /**
+ * 现金营销
+ */
+ public static final String CASH_MARKETING = "1001";
+ }
+
+ /**
+ * 用户收款感知
+ *
+ * @see 官方文档
+ */
+ @UtilityClass
+ public static class UserRecvPerception {
+ /**
+ * 转账场景 现金营销
+ * 场景介绍 向参与营销活动的用户发放现金奖励
+ */
+ public static class CASH_MARKETING {
+ /**
+ * 默认展示
+ */
+ public static final String ACTIVITY = "活动奖励";
+
+ /**
+ * 需在发起转账时,“用户收款感知”字段主动传入“现金奖励”才可展示
+ */
+ public static final String CASH = "现金奖励";
+ }
+
+ }
}
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/TransferService.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/TransferService.java
index c02430a960..01113c9506 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/TransferService.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/TransferService.java
@@ -128,6 +128,57 @@ public interface TransferService {
*/
TransferBillsResult transferBills(TransferBillsRequest request) throws WxPayException;
+ /**
+ *
+ *
+ * 2025.1.15 开始新接口 撤销转账API
+ *
+ * 请求方式:POST(HTTPS)
+ * 请求地址:请求地址
+ *
+ * 文档地址:商户撤销转账API
+ *
+ *
+ * @param outBillNo 【商户单号】 商户系统内部的商家单号,要求此参数只能由数字、大小写字母组成,在商户系统内部唯一
+ * @return TransformBillsGetResult 转账单
+ * @throws WxPayException .
+ */
+ TransferBillsCancelResult transformBillsCancel(String outBillNo) throws WxPayException;
+
+ /**
+ *
+ *
+ * 2025.1.15 开始新接口 发起商家转账API
+ *
+ * 请求方式:GET(HTTPS)
+ * 请求地址:请求地址
+ *
+ * 文档地址:商户单号查询转账单API
+ *
+ *
+ * @param outBillNo 【商户单号】 商户系统内部的商家单号,要求此参数只能由数字、大小写字母组成,在商户系统内部唯一
+ * @return TransformBillsGetResult 转账单
+ * @throws WxPayException .
+ */
+ TransferBillsGetResult getBillsByOutBillNo(String outBillNo) throws WxPayException;
+
+ /**
+ *
+ *
+ * 2025.1.15 开始新接口 微信单号查询转账单API
+ *
+ * 请求方式:GET(HTTPS)
+ * 请求地址:请求地址
+ *
+ * 文档地址:商户单号查询转账单API
+ *
+ *
+ * @param transferBillNo 【微信转账单号】 微信转账单号,微信商家转账系统返回的唯一标识
+ * @return TransformBillsGetResult 转账单
+ * @throws WxPayException .
+ */
+ TransferBillsGetResult getBillsByTransferBillNo(String transferBillNo) throws WxPayException;
+
/**
* 2025.1.15 开始新接口 解析商家转账结果
* 详见
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/TransferServiceImpl.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/TransferServiceImpl.java
index 23bf7b13ee..f43c887c16 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/TransferServiceImpl.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/TransferServiceImpl.java
@@ -48,8 +48,7 @@ public QueryTransferBatchesResult transferBatchesBatchId(QueryTransferBatchesReq
if (request.getNeedQueryDetail()) {
url = String.format("%s/v3/transfer/batches/batch-id/%s?need_query_detail=true&offset=%s&limit=%s&detail_status=%s",
this.payService.getPayBaseUrl(), request.getBatchId(), request.getOffset(), request.getLimit(), request.getDetailStatus());
- }
- else {
+ } else {
url = String.format("%s/v3/transfer/batches/batch-id/%s?need_query_detail=false",
this.payService.getPayBaseUrl(), request.getBatchId());
}
@@ -70,8 +69,7 @@ public QueryTransferBatchesResult transferBatchesOutBatchNo(QueryTransferBatches
if (request.getNeedQueryDetail()) {
url = String.format("%s/v3/transfer/batches/out-batch-no/%s?need_query_detail=true&offset=%s&limit=%s&detail_status=%s",
this.payService.getPayBaseUrl(), request.getOutBatchNo(), request.getOffset(), request.getLimit(), request.getDetailStatus());
- }
- else {
+ } else {
url = String.format("%s/v3/transfer/batches/out-batch-no/%s?need_query_detail=false",
this.payService.getPayBaseUrl(), request.getOutBatchNo());
}
@@ -97,6 +95,31 @@ public TransferBillsResult transferBills(TransferBillsRequest request) throws Wx
return GSON.fromJson(result, TransferBillsResult.class);
}
+ @Override
+ public TransferBillsCancelResult transformBillsCancel(String outBillNo) throws WxPayException {
+ String url = String.format("%s/v3/fund-app/mch-transfer/transfer-bills/out-bill-no/%s/cancel",
+ this.payService.getPayBaseUrl(), outBillNo);
+ String result = this.payService.postV3(url, "");
+
+ return GSON.fromJson(result, TransferBillsCancelResult.class);
+ }
+
+ @Override
+ public TransferBillsGetResult getBillsByOutBillNo(String outBillNo) throws WxPayException {
+ String url = String.format("%s/v3/fund-app/mch-transfer/transfer-bills/out-bill-no/%s",
+ this.payService.getPayBaseUrl(), outBillNo);
+ String result = this.payService.getV3(url);
+ return GSON.fromJson(result, TransferBillsGetResult.class);
+ }
+
+ @Override
+ public TransferBillsGetResult getBillsByTransferBillNo(String transferBillNo) throws WxPayException {
+ String url = String.format("%s/v3/fund-app/mch-transfer/transfer-bills/transfer-bill-no/%s",
+ this.payService.getPayBaseUrl(), transferBillNo);
+ String result = this.payService.getV3(url);
+ return GSON.fromJson(result, TransferBillsGetResult.class);
+ }
+
@Override
public TransferBillsNotifyResult parseTransferBillsNotifyResult(String notifyData, SignatureHeader header) throws WxPayException {
return this.payService.baseParseOrderNotifyV3Result(notifyData, header, TransferBillsNotifyResult.class, TransferBillsNotifyResult.DecryptNotifyResult.class);
diff --git a/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/service/impl/TransferServiceImplTest.java b/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/service/impl/TransferServiceImplTest.java
index cd607dff03..10c2a5da66 100644
--- a/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/service/impl/TransferServiceImplTest.java
+++ b/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/service/impl/TransferServiceImplTest.java
@@ -87,4 +87,19 @@ public void testTransferBills() throws WxPayException {
.userName("测试用户").build();
log.info("发起商家转账:{}", this.payService.getTransferService().transferBills(transferBillsRequest));
}
+
+ @Test
+ public void testTransformBillsCancel() throws WxPayException {
+ log.info("撤销商家转账:{}", this.payService.getTransferService().transformBillsCancel("123456"));
+ }
+
+ @Test
+ public void testGetBillsByOutBillNo() throws WxPayException {
+ log.info("商户单号查询转账单:{}", this.payService.getTransferService().getBillsByOutBillNo("123456"));
+ }
+
+ @Test
+ public void testGetBillsByTransferBillNo() throws WxPayException {
+ log.info("微信单号查询转账单:{}", this.payService.getTransferService().getBillsByTransferBillNo("123456"));
+ }
}
From d65e2f27a97bb0be7866e3f5ca0cff6f11317a62 Mon Sep 17 00:00:00 2001
From: giveup
Date: Fri, 24 Jan 2025 21:26:02 +0800
Subject: [PATCH 048/326] =?UTF-8?q?:art:=20WxMpSubscribeMessage=E5=AE=9E?=
=?UTF-8?q?=E7=8E=B0=E5=BA=8F=E5=88=97=E5=8C=96=E6=8E=A5=E5=8F=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../weixin/mp/bean/subscribe/WxMpSubscribeMessage.java | 2 +-
.../mp/bean/subscribe/WxMpSubscribeMessageTest.java | 8 ++++++++
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/bean/subscribe/WxMpSubscribeMessage.java b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/bean/subscribe/WxMpSubscribeMessage.java
index d2695959e8..6820d103b8 100644
--- a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/bean/subscribe/WxMpSubscribeMessage.java
+++ b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/bean/subscribe/WxMpSubscribeMessage.java
@@ -17,7 +17,7 @@
@NoArgsConstructor
@Builder
@AllArgsConstructor
-public class WxMpSubscribeMessage {
+public class WxMpSubscribeMessage implements Serializable {
/**
* 接收者openid.
diff --git a/weixin-java-mp/src/test/java/me/chanjar/weixin/mp/bean/subscribe/WxMpSubscribeMessageTest.java b/weixin-java-mp/src/test/java/me/chanjar/weixin/mp/bean/subscribe/WxMpSubscribeMessageTest.java
index 078ad51570..684211659f 100644
--- a/weixin-java-mp/src/test/java/me/chanjar/weixin/mp/bean/subscribe/WxMpSubscribeMessageTest.java
+++ b/weixin-java-mp/src/test/java/me/chanjar/weixin/mp/bean/subscribe/WxMpSubscribeMessageTest.java
@@ -2,6 +2,9 @@
import org.testng.annotations.*;
+import java.io.Serializable;
+import java.util.Arrays;
+
import static org.testng.AssertJUnit.*;
/**
@@ -43,4 +46,9 @@ public void testToJson() {
assertEquals(message.toJson(), actual);
}
+
+ @Test
+ void testWxMpSubscribeMessageIsSerializable() {
+ assertTrue(Arrays.stream(WxMpSubscribeMessage.class.getInterfaces()).anyMatch(anInterface -> anInterface.isInstance(Serializable.class)));
+ }
}
From f3c1422354ecba119c66020511bffd8de681286a Mon Sep 17 00:00:00 2001
From: superffan <33724896+superffan@users.noreply.github.com>
Date: Fri, 24 Jan 2025 21:27:34 +0800
Subject: [PATCH 049/326] =?UTF-8?q?:art:=E3=80=90=E5=BE=AE=E4=BF=A1?=
=?UTF-8?q?=E6=94=AF=E4=BB=98=E3=80=91spring-boot-starter=E6=A8=A1?=
=?UTF-8?q?=E5=9D=97=E5=A2=9E=E5=8A=A0=E5=85=AC=E9=92=A5ID=E5=92=8C?=
=?UTF-8?q?=E8=AF=81=E4=B9=A6=E6=96=87=E4=BB=B6=E8=B7=AF=E5=BE=84=E7=AD=89?=
=?UTF-8?q?=E9=85=8D=E7=BD=AE=E9=A1=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../wxjava/pay/config/WxPayAutoConfiguration.java | 2 ++
.../wxjava/pay/properties/WxPayProperties.java | 12 +++++++++++-
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/spring-boot-starters/wx-java-pay-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/pay/config/WxPayAutoConfiguration.java b/spring-boot-starters/wx-java-pay-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/pay/config/WxPayAutoConfiguration.java
index 9a9672de1a..e401a8cfba 100644
--- a/spring-boot-starters/wx-java-pay-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/pay/config/WxPayAutoConfiguration.java
+++ b/spring-boot-starters/wx-java-pay-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/pay/config/WxPayAutoConfiguration.java
@@ -57,6 +57,8 @@ public WxPayService wxPayService() {
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()));
wxPayService.setConfig(payConfig);
return wxPayService;
diff --git a/spring-boot-starters/wx-java-pay-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/pay/properties/WxPayProperties.java b/spring-boot-starters/wx-java-pay-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/pay/properties/WxPayProperties.java
index 232bd33c47..a1a8cc2297 100644
--- a/spring-boot-starters/wx-java-pay-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/pay/properties/WxPayProperties.java
+++ b/spring-boot-starters/wx-java-pay-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/pay/properties/WxPayProperties.java
@@ -73,7 +73,17 @@ public class WxPayProperties {
* apiv3 商户apiclient_cert.pem
*/
private String privateCertPath;
-
+
+ /**
+ * 公钥ID
+ */
+ private String publicKeyId;
+
+ /**
+ * pub_key.pem证书文件的绝对路径或者以classpath:开头的类路径.
+ */
+ private String publicKeyPath;
+
/**
* 微信支付是否使用仿真测试环境.
* 默认不使用
From 3e48dc7f8378f919f734bc08ff1abd78720d9861 Mon Sep 17 00:00:00 2001
From: Binary Wang
Date: Fri, 24 Jan 2025 22:18:57 +0800
Subject: [PATCH 050/326] =?UTF-8?q?:bookmark:=20=E5=8F=91=E5=B8=83=204.7.2?=
=?UTF-8?q?.B=20=E6=B5=8B=E8=AF=95=E7=89=88=E6=9C=AC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pom.xml | 2 +-
solon-plugins/pom.xml | 2 +-
solon-plugins/wx-java-channel-multi-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-channel-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-cp-multi-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-cp-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-miniapp-multi-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-miniapp-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-mp-multi-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-mp-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-open-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-pay-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-qidian-solon-plugin/pom.xml | 2 +-
spring-boot-starters/pom.xml | 2 +-
.../wx-java-channel-multi-spring-boot-starter/pom.xml | 2 +-
.../wx-java-channel-spring-boot-starter/pom.xml | 2 +-
.../wx-java-cp-multi-spring-boot-starter/pom.xml | 2 +-
spring-boot-starters/wx-java-cp-spring-boot-starter/pom.xml | 2 +-
.../wx-java-miniapp-multi-spring-boot-starter/pom.xml | 2 +-
.../wx-java-miniapp-spring-boot-starter/pom.xml | 2 +-
.../wx-java-mp-multi-spring-boot-starter/pom.xml | 2 +-
spring-boot-starters/wx-java-mp-spring-boot-starter/pom.xml | 2 +-
spring-boot-starters/wx-java-open-spring-boot-starter/pom.xml | 2 +-
spring-boot-starters/wx-java-pay-spring-boot-starter/pom.xml | 2 +-
spring-boot-starters/wx-java-qidian-spring-boot-starter/pom.xml | 2 +-
weixin-graal/pom.xml | 2 +-
weixin-java-channel/pom.xml | 2 +-
weixin-java-common/pom.xml | 2 +-
weixin-java-cp/pom.xml | 2 +-
weixin-java-miniapp/pom.xml | 2 +-
weixin-java-mp/pom.xml | 2 +-
weixin-java-open/pom.xml | 2 +-
weixin-java-pay/pom.xml | 2 +-
weixin-java-qidian/pom.xml | 2 +-
34 files changed, 34 insertions(+), 34 deletions(-)
diff --git a/pom.xml b/pom.xml
index 9f0362816d..c7c40521b5 100644
--- a/pom.xml
+++ b/pom.xml
@@ -3,7 +3,7 @@
4.0.0
com.github.binarywang
wx-java
- 4.7.1.B
+ 4.7.2.B
pom
WxJava - Weixin/Wechat Java SDK
微信开发Java SDK
diff --git a/solon-plugins/pom.xml b/solon-plugins/pom.xml
index 9e52bec0ca..9585e96179 100644
--- a/solon-plugins/pom.xml
+++ b/solon-plugins/pom.xml
@@ -6,7 +6,7 @@
com.github.binarywang
wx-java
- 4.7.1.B
+ 4.7.2.B
pom
wx-java-solon-plugins
diff --git a/solon-plugins/wx-java-channel-multi-solon-plugin/pom.xml b/solon-plugins/wx-java-channel-multi-solon-plugin/pom.xml
index 687ac3e998..a9b794a965 100644
--- a/solon-plugins/wx-java-channel-multi-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-channel-multi-solon-plugin/pom.xml
@@ -5,7 +5,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.7.1.B
+ 4.7.2.B
4.0.0
diff --git a/solon-plugins/wx-java-channel-solon-plugin/pom.xml b/solon-plugins/wx-java-channel-solon-plugin/pom.xml
index bc8c46627b..4e0dc723a8 100644
--- a/solon-plugins/wx-java-channel-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-channel-solon-plugin/pom.xml
@@ -3,7 +3,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.7.1.B
+ 4.7.2.B
4.0.0
diff --git a/solon-plugins/wx-java-cp-multi-solon-plugin/pom.xml b/solon-plugins/wx-java-cp-multi-solon-plugin/pom.xml
index 5787c42ee4..9cf2b31724 100644
--- a/solon-plugins/wx-java-cp-multi-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-cp-multi-solon-plugin/pom.xml
@@ -4,7 +4,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.7.1.B
+ 4.7.2.B
4.0.0
diff --git a/solon-plugins/wx-java-cp-solon-plugin/pom.xml b/solon-plugins/wx-java-cp-solon-plugin/pom.xml
index 7c39166d1f..46266b8e80 100644
--- a/solon-plugins/wx-java-cp-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-cp-solon-plugin/pom.xml
@@ -4,7 +4,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.7.1.B
+ 4.7.2.B
4.0.0
diff --git a/solon-plugins/wx-java-miniapp-multi-solon-plugin/pom.xml b/solon-plugins/wx-java-miniapp-multi-solon-plugin/pom.xml
index 7740ce99c4..1e5dab26b6 100644
--- a/solon-plugins/wx-java-miniapp-multi-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-miniapp-multi-solon-plugin/pom.xml
@@ -5,7 +5,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.7.1.B
+ 4.7.2.B
4.0.0
diff --git a/solon-plugins/wx-java-miniapp-solon-plugin/pom.xml b/solon-plugins/wx-java-miniapp-solon-plugin/pom.xml
index 8654c698ed..805018b81d 100644
--- a/solon-plugins/wx-java-miniapp-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-miniapp-solon-plugin/pom.xml
@@ -4,7 +4,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.7.1.B
+ 4.7.2.B
4.0.0
diff --git a/solon-plugins/wx-java-mp-multi-solon-plugin/pom.xml b/solon-plugins/wx-java-mp-multi-solon-plugin/pom.xml
index 1bb1960151..4ccc4fa7d7 100644
--- a/solon-plugins/wx-java-mp-multi-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-mp-multi-solon-plugin/pom.xml
@@ -5,7 +5,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.7.1.B
+ 4.7.2.B
4.0.0
diff --git a/solon-plugins/wx-java-mp-solon-plugin/pom.xml b/solon-plugins/wx-java-mp-solon-plugin/pom.xml
index f2925cd1a2..3aa2b9be41 100644
--- a/solon-plugins/wx-java-mp-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-mp-solon-plugin/pom.xml
@@ -5,7 +5,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.7.1.B
+ 4.7.2.B
4.0.0
diff --git a/solon-plugins/wx-java-open-solon-plugin/pom.xml b/solon-plugins/wx-java-open-solon-plugin/pom.xml
index 87d5c08c40..355ef6f939 100644
--- a/solon-plugins/wx-java-open-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-open-solon-plugin/pom.xml
@@ -5,7 +5,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.7.1.B
+ 4.7.2.B
4.0.0
diff --git a/solon-plugins/wx-java-pay-solon-plugin/pom.xml b/solon-plugins/wx-java-pay-solon-plugin/pom.xml
index bfc53597df..6357cc908b 100644
--- a/solon-plugins/wx-java-pay-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-pay-solon-plugin/pom.xml
@@ -5,7 +5,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.7.1.B
+ 4.7.2.B
4.0.0
diff --git a/solon-plugins/wx-java-qidian-solon-plugin/pom.xml b/solon-plugins/wx-java-qidian-solon-plugin/pom.xml
index e95b835109..4ff6dba008 100644
--- a/solon-plugins/wx-java-qidian-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-qidian-solon-plugin/pom.xml
@@ -3,7 +3,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.7.1.B
+ 4.7.2.B
4.0.0
diff --git a/spring-boot-starters/pom.xml b/spring-boot-starters/pom.xml
index 3f5839696c..c5cb2954d3 100644
--- a/spring-boot-starters/pom.xml
+++ b/spring-boot-starters/pom.xml
@@ -6,7 +6,7 @@
com.github.binarywang
wx-java
- 4.7.1.B
+ 4.7.2.B
pom
wx-java-spring-boot-starters
diff --git a/spring-boot-starters/wx-java-channel-multi-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-channel-multi-spring-boot-starter/pom.xml
index e8dde09746..dca311c015 100644
--- a/spring-boot-starters/wx-java-channel-multi-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-channel-multi-spring-boot-starter/pom.xml
@@ -5,7 +5,7 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.7.1.B
+ 4.7.2.B
4.0.0
diff --git a/spring-boot-starters/wx-java-channel-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-channel-spring-boot-starter/pom.xml
index 6a63849e64..8f427c6d03 100644
--- a/spring-boot-starters/wx-java-channel-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-channel-spring-boot-starter/pom.xml
@@ -3,7 +3,7 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.7.1.B
+ 4.7.2.B
4.0.0
diff --git a/spring-boot-starters/wx-java-cp-multi-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-cp-multi-spring-boot-starter/pom.xml
index 65419e065e..6ea0eb005f 100644
--- a/spring-boot-starters/wx-java-cp-multi-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-cp-multi-spring-boot-starter/pom.xml
@@ -4,7 +4,7 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.7.1.B
+ 4.7.2.B
4.0.0
diff --git a/spring-boot-starters/wx-java-cp-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-cp-spring-boot-starter/pom.xml
index 73e70ce07a..fdbe3d1e54 100644
--- a/spring-boot-starters/wx-java-cp-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-cp-spring-boot-starter/pom.xml
@@ -4,7 +4,7 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.7.1.B
+ 4.7.2.B
4.0.0
diff --git a/spring-boot-starters/wx-java-miniapp-multi-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-miniapp-multi-spring-boot-starter/pom.xml
index 74e5082e30..cedde81744 100644
--- a/spring-boot-starters/wx-java-miniapp-multi-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-miniapp-multi-spring-boot-starter/pom.xml
@@ -5,7 +5,7 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.7.1.B
+ 4.7.2.B
4.0.0
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 b2495d9d77..fba6da9e0a 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 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.7.1.B
+ 4.7.2.B
4.0.0
diff --git a/spring-boot-starters/wx-java-mp-multi-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-mp-multi-spring-boot-starter/pom.xml
index 48bf3c4837..867f570558 100644
--- a/spring-boot-starters/wx-java-mp-multi-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-mp-multi-spring-boot-starter/pom.xml
@@ -5,7 +5,7 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.7.1.B
+ 4.7.2.B
4.0.0
diff --git a/spring-boot-starters/wx-java-mp-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-mp-spring-boot-starter/pom.xml
index 4d0b88794a..cddf39300b 100644
--- a/spring-boot-starters/wx-java-mp-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-mp-spring-boot-starter/pom.xml
@@ -5,7 +5,7 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.7.1.B
+ 4.7.2.B
4.0.0
diff --git a/spring-boot-starters/wx-java-open-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-open-spring-boot-starter/pom.xml
index 6505cafac6..189ff94672 100644
--- a/spring-boot-starters/wx-java-open-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-open-spring-boot-starter/pom.xml
@@ -5,7 +5,7 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.7.1.B
+ 4.7.2.B
4.0.0
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 96c6e8b7ae..d4de4e77f8 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 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.7.1.B
+ 4.7.2.B
4.0.0
diff --git a/spring-boot-starters/wx-java-qidian-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-qidian-spring-boot-starter/pom.xml
index e735cb82d1..e118aba652 100644
--- a/spring-boot-starters/wx-java-qidian-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-qidian-spring-boot-starter/pom.xml
@@ -3,7 +3,7 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.7.1.B
+ 4.7.2.B
4.0.0
diff --git a/weixin-graal/pom.xml b/weixin-graal/pom.xml
index 7f2eb89e43..338a22a564 100644
--- a/weixin-graal/pom.xml
+++ b/weixin-graal/pom.xml
@@ -6,7 +6,7 @@
com.github.binarywang
wx-java
- 4.7.1.B
+ 4.7.2.B
weixin-graal
diff --git a/weixin-java-channel/pom.xml b/weixin-java-channel/pom.xml
index c1fe4637d4..8d34754cb3 100644
--- a/weixin-java-channel/pom.xml
+++ b/weixin-java-channel/pom.xml
@@ -6,7 +6,7 @@
com.github.binarywang
wx-java
- 4.7.1.B
+ 4.7.2.B
weixin-java-channel
diff --git a/weixin-java-common/pom.xml b/weixin-java-common/pom.xml
index 7cfce1c1aa..e89234d17a 100644
--- a/weixin-java-common/pom.xml
+++ b/weixin-java-common/pom.xml
@@ -6,7 +6,7 @@
com.github.binarywang
wx-java
- 4.7.1.B
+ 4.7.2.B
weixin-java-common
diff --git a/weixin-java-cp/pom.xml b/weixin-java-cp/pom.xml
index e3a64d0006..467ba98858 100644
--- a/weixin-java-cp/pom.xml
+++ b/weixin-java-cp/pom.xml
@@ -7,7 +7,7 @@
com.github.binarywang
wx-java
- 4.7.1.B
+ 4.7.2.B
weixin-java-cp
diff --git a/weixin-java-miniapp/pom.xml b/weixin-java-miniapp/pom.xml
index 5b85813dcf..cfe52b9686 100644
--- a/weixin-java-miniapp/pom.xml
+++ b/weixin-java-miniapp/pom.xml
@@ -7,7 +7,7 @@
com.github.binarywang
wx-java
- 4.7.1.B
+ 4.7.2.B
weixin-java-miniapp
diff --git a/weixin-java-mp/pom.xml b/weixin-java-mp/pom.xml
index ffb3eae284..0aecd36da2 100644
--- a/weixin-java-mp/pom.xml
+++ b/weixin-java-mp/pom.xml
@@ -7,7 +7,7 @@
com.github.binarywang
wx-java
- 4.7.1.B
+ 4.7.2.B
weixin-java-mp
diff --git a/weixin-java-open/pom.xml b/weixin-java-open/pom.xml
index 58ecb292d2..f7fac62e64 100644
--- a/weixin-java-open/pom.xml
+++ b/weixin-java-open/pom.xml
@@ -7,7 +7,7 @@
com.github.binarywang
wx-java
- 4.7.1.B
+ 4.7.2.B
weixin-java-open
diff --git a/weixin-java-pay/pom.xml b/weixin-java-pay/pom.xml
index 1c64b458f2..6eeb06624e 100644
--- a/weixin-java-pay/pom.xml
+++ b/weixin-java-pay/pom.xml
@@ -5,7 +5,7 @@
com.github.binarywang
wx-java
- 4.7.1.B
+ 4.7.2.B
4.0.0
diff --git a/weixin-java-qidian/pom.xml b/weixin-java-qidian/pom.xml
index 25718264fe..737af413d2 100644
--- a/weixin-java-qidian/pom.xml
+++ b/weixin-java-qidian/pom.xml
@@ -7,7 +7,7 @@
com.github.binarywang
wx-java
- 4.7.1.B
+ 4.7.2.B
weixin-java-qidian
From 783c89523dc800b863f91e578ecbc06597de2304 Mon Sep 17 00:00:00 2001
From: imyzt
Date: Fri, 7 Feb 2025 19:58:53 +0800
Subject: [PATCH 051/326] =?UTF-8?q?:new:=20#3488=E3=80=90=E4=BC=81?=
=?UTF-8?q?=E4=B8=9A=E5=BE=AE=E4=BF=A1=E3=80=91=E5=A2=9E=E5=8A=A0=E8=8E=B7?=
=?UTF-8?q?=E5=8F=96=E4=BC=81=E4=B8=9A=E5=B7=B2=E9=85=8D=E7=BD=AE=E7=9A=84?=
=?UTF-8?q?=E3=80=8C=E8=81=94=E7=B3=BB=E6=88=91=E3=80=8D=E5=88=97=E8=A1=A8?=
=?UTF-8?q?=E7=9A=84=E6=8E=A5=E5=8F=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../cp/api/WxCpExternalContactService.java | 19 ++++++
.../impl/WxCpExternalContactServiceImpl.java | 11 ++++
.../cp/bean/external/WxCpContactWayList.java | 63 +++++++++++++++++++
.../weixin/cp/constant/WxCpApiPathConsts.java | 4 ++
.../WxCpExternalContactServiceImplTest.java | 17 +++++
5 files changed, 114 insertions(+)
create mode 100644 weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpContactWayList.java
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpExternalContactService.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpExternalContactService.java
index f55d2f7b93..c886fcab61 100644
--- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpExternalContactService.java
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpExternalContactService.java
@@ -59,6 +59,25 @@ public interface WxCpExternalContactService {
*/
WxCpContactWayInfo getContactWay(String configId) throws WxErrorException;
+ /**
+ * 获取企业已配置的「联系我」列表
+ *
+ *
+ * 获取企业配置的「联系我」二维码和「联系我」小程序插件列表。不包含临时会话。
+ * 注意,该接口仅可获取2021年7月10日以后创建的「联系我」
+ *
+ *
+ * 文档地址: 获取企业已配置的「联系我」列表
+ *
+ * @param startTime 「联系我」创建起始时间戳, 默认为90天前
+ * @param endTime 「联系我」创建结束时间戳, 默认为当前时间
+ * @param cursor 分页查询使用的游标,为上次请求返回的 next_cursor
+ * @param limit 每次查询的分页大小,默认为100条,最多支持1000条
+ * @return contact way configId
+ * @throws WxErrorException the wx error exception
+ */
+ WxCpContactWayList listContactWay(Long startTime, Long endTime, String cursor, Long limit) throws WxErrorException;
+
/**
* 更新企业已配置的「联系我」方式
*
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpExternalContactServiceImpl.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpExternalContactServiceImpl.java
index c2fbdfe6ef..8e3a8d7b95 100644
--- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpExternalContactServiceImpl.java
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpExternalContactServiceImpl.java
@@ -65,6 +65,17 @@ public WxCpContactWayInfo getContactWay(String configId) throws WxErrorException
return WxCpContactWayInfo.fromJson(this.mainService.post(url, json.toString()));
}
+ @Override
+ public WxCpContactWayList listContactWay(Long startTime, Long endTime, String cursor, Long limit) throws WxErrorException {
+ JsonObject json = new JsonObject();
+ json.addProperty("start_time", startTime);
+ json.addProperty("end_time", endTime);
+ json.addProperty("cursor", cursor);
+ json.addProperty("limit", limit);
+ final String url = this.mainService.getWxCpConfigStorage().getApiUrl(LIST_CONTACT_WAY);
+ return WxCpContactWayList.fromJson(this.mainService.post(url, json.toString()));
+ }
+
@Override
public WxCpBaseResp updateContactWay(WxCpContactWayInfo info) throws WxErrorException {
if (StringUtils.isBlank(info.getContactWay().getConfigId())) {
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpContactWayList.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpContactWayList.java
new file mode 100644
index 0000000000..04918f64e4
--- /dev/null
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpContactWayList.java
@@ -0,0 +1,63 @@
+package me.chanjar.weixin.cp.bean.external;
+
+import com.google.gson.annotations.SerializedName;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import me.chanjar.weixin.cp.bean.WxCpBaseResp;
+import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * 「联系我」方式 列表返回对象
+ *
+ * @author imyzt
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+@NoArgsConstructor
+public class WxCpContactWayList extends WxCpBaseResp implements Serializable {
+ private static final long serialVersionUID = -8697184659526210472L;
+
+ @SerializedName("contact_way")
+ private List contactWay;
+
+ /**
+ * The type Contact way.
+ */
+ @Getter
+ @Setter
+ public static class ContactWay implements Serializable {
+ private static final long serialVersionUID = -8697184659526210472L;
+
+ /**
+ * 联系方式的配置id
+ */
+ @SerializedName("config_id")
+ private String configId;
+ }
+
+ /**
+ * From json wx cp contact way list.
+ *
+ * @param json the json
+ * @return the wx cp contact way list
+ */
+ public static WxCpContactWayList fromJson(String json) {
+ return WxCpGsonBuilder.create().fromJson(json, WxCpContactWayList.class);
+ }
+
+ /**
+ * To json string.
+ *
+ * @return the string
+ */
+ public String toJson() {
+ return WxCpGsonBuilder.create().toJson(this);
+ }
+
+}
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/constant/WxCpApiPathConsts.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/constant/WxCpApiPathConsts.java
index dfb38a5243..3aecf72120 100644
--- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/constant/WxCpApiPathConsts.java
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/constant/WxCpApiPathConsts.java
@@ -1085,6 +1085,10 @@ interface ExternalContact {
* The constant GET_CONTACT_WAY.
*/
String GET_CONTACT_WAY = "/cgi-bin/externalcontact/get_contact_way";
+ /**
+ * The constant LIST_CONTACT_WAY.
+ */
+ String LIST_CONTACT_WAY = "/cgi-bin/externalcontact/list_contact_way";
/**
* The constant UPDATE_CONTACT_WAY.
*/
diff --git a/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/impl/WxCpExternalContactServiceImplTest.java b/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/impl/WxCpExternalContactServiceImplTest.java
index c629165ca4..4bd80928bd 100644
--- a/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/impl/WxCpExternalContactServiceImplTest.java
+++ b/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/impl/WxCpExternalContactServiceImplTest.java
@@ -4,6 +4,9 @@
import com.google.common.collect.Lists;
import com.google.inject.Inject;
+
+import java.time.LocalDateTime;
+import java.time.ZoneOffset;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
@@ -90,6 +93,20 @@ public void testGetContactWay() throws WxErrorException {
assertNotNull(contactWayInfo);
}
+ /**
+ * Test list contact way.
+ *
+ * @throws WxErrorException the wx error exception
+ */
+ @Test
+ public void testListContactWay() throws WxErrorException {
+ long startTime = LocalDateTime.now().minusDays(1).toEpochSecond(ZoneOffset.of("+8"));
+ long endTime = LocalDateTime.now().toEpochSecond(ZoneOffset.of("+8"));
+ WxCpContactWayList wxCpContactWayList = this.wxCpService.getExternalContactService().listContactWay(startTime, endTime, null, 100L);
+ System.out.println(wxCpContactWayList.toJson());
+ assertNotNull(wxCpContactWayList);
+ }
+
/**
* Test update contact way.
*
From 410cc9dfd772145f9e5fdea8f5e1562eab3580f1 Mon Sep 17 00:00:00 2001
From: je45 <23151789+je45@users.noreply.github.com>
Date: Fri, 7 Feb 2025 21:22:39 +0800
Subject: [PATCH 052/326] =?UTF-8?q?:art:=20#3490=E3=80=90=E5=BE=AE?=
=?UTF-8?q?=E4=BF=A1=E6=94=AF=E4=BB=98=E3=80=91=E6=B6=88=E8=B4=B9=E8=80=85?=
=?UTF-8?q?=E6=8A=95=E8=AF=89=E7=9B=B8=E5=85=B3=E6=8E=A5=E5=8F=A3=E8=A1=A5?=
=?UTF-8?q?=E5=85=85=E6=9C=80=E6=96=B0=E5=A2=9E=E5=8A=A0=E7=9A=84=E4=B8=80?=
=?UTF-8?q?=E4=BA=9B=E5=8F=82=E6=95=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../bean/complaint/ComplaintDetailResult.java | 137 ++++++++++++++++++
.../complaint/NegotiationHistoryResult.java | 59 ++++++--
.../wxpay/bean/complaint/ResponseRequest.java | 53 +++++++
.../UpdateRefundProgressRequest.java | 8 +-
.../bean/notify/ComplaintNotifyResult.java | 12 +-
.../wxpay/service/ComplaintService.java | 4 +-
6 files changed, 253 insertions(+), 20 deletions(-)
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/ComplaintDetailResult.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/ComplaintDetailResult.java
index 157e095bba..f8562dce39 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/ComplaintDetailResult.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/ComplaintDetailResult.java
@@ -327,4 +327,141 @@ public static class ServiceOrder implements Serializable {
*/
@SerializedName("user_tag_list")
private String[] userTagList;
+
+ /**
+ *
+ * 字段名:补充信息
+ * 是否必填:否
+ * 描述: 用在特定行业或场景下返回的补充信息
+ *
+ */
+ @SerializedName("additional_info")
+ private AdditionalInfo additionalInfo;
+
+ @Data
+ public static class AdditionalInfo implements Serializable {
+ private static final long serialVersionUID = 7917816070738944147L;
+
+ /**
+ *
+ * 字段名:补充信息类型
+ * 是否必填:否
+ * 描述: 补充信息类型
+ * 示例值:SHARE_POWER_TYPE: 充电宝投诉相关行业
+ *
+ */
+ @SerializedName("type")
+ private String type;
+
+ /**
+ *
+ * 字段名:充电宝投诉相关信息
+ * 是否必填:否
+ * 描述:当type为充电宝投诉相关时有值
+ *
+ */
+ @SerializedName("share_power_info")
+ private SharePowerInfo sharePowerInfo;
+
+ /**
+ * 充电宝投诉相关信息
+ */
+ @Data
+ public static class SharePowerInfo implements Serializable {
+ private static final long serialVersionUID = -2878382307459369354L;
+
+ /**
+ *
+ * 字段名:归还时间
+ * 是否必填:否
+ * 描述:遵循rfc3339标准格式,格式为yyyy-MM-DDTHH:mm:ss+TIMEZONE,
+ * yyyy-MM-DD表示年月日,T出现在字符串中,表示time元素的开头,
+ * HH:mm:ss表示时分秒,
+ * TIMEZONE表示时区(+08:00表示东八区时间,领先UTC 8小时,即北京时间)。
+ * 示例值:2015-05-20T13:29:35+08:00表示,北京时间2015年5月20日 13点29分35秒
+ *
+ */
+ @SerializedName("return_time")
+ private String returnTime;
+
+ /**
+ *
+ * 字段名:归还地点信息
+ * 是否必填:否
+ * 描述: 归还地点信息
+ *
+ */
+ @SerializedName("return_address_info")
+ private ReturnAddressInfo returnAddressInfo;
+
+ @Data
+ public static class ReturnAddressInfo implements Serializable {
+ private static final long serialVersionUID = -7649986542568217256L;
+
+ /**
+ *
+ * 字段名:归还地点
+ * 是否必填:否 string(256)
+ * 描述:归还地点
+ *
+ */
+ @SerializedName("return_address")
+ private String returnAddress;
+
+ /**
+ *
+ * 字段名:归还地点经度
+ * 是否必填:否 string(32)
+ * 描述:经度,字符串,范围为-180~180,负数表示西经。使用GCJ-02坐标系
+ *
+ */
+ @SerializedName("longitude")
+ private String longitude;
+
+ /**
+ *
+ * 字段名:归还地点纬度
+ * 是否必填:否 string(32)
+ * 描述:纬度,字符串,范围为-90~90,负数表示南纬。使用GCJ-02坐标系
+ *
+ */
+ @SerializedName("latitude")
+ private String latitude;
+ }
+
+ /**
+ *
+ * 字段名:是否归还同一柜机
+ * 是否必填:否
+ * 描述:用户声明是否将充电宝归还至与借取时同一柜机
+ *
+ */
+ @SerializedName("is_returned_to_same_machine")
+ private Boolean isReturnedToSameMachine;
+ }
+ }
+
+ /**
+ *
+ * 字段名:是否在平台协助中
+ * 是否必填:否
+ * 描述:标识当前投诉单是否正处在平台协助流程中。
+ * 注:在协助期间由微信支付客服为用户服务,期间商户向用户发送的留言用户不可见
+ *
+ */
+ @SerializedName("in_platform_service")
+ private Boolean inPlatformService;
+
+ /**
+ *
+ * 字段名:是否需即时服务用户
+ * 是否必填:否
+ * 描述:因用户诉求紧急度、用户界面差异等因素,部分投诉单建议商户更即时地响应用户诉求。
+ * 如此处标识为“是”,建议商户提升服务时效,给用户带来更好的体验
+ *
+ */
+ @SerializedName("need_immediate_service")
+ private Boolean needImmediateService;
+
+
}
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/NegotiationHistoryResult.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/NegotiationHistoryResult.java
index 2da216446d..7c8738fe29 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/NegotiationHistoryResult.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/NegotiationHistoryResult.java
@@ -142,20 +142,30 @@ public static class ComplaintMedia implements Serializable {
* 是否必填:是
* 描述:
* 当前投诉协商记录的操作类型,对应枚举:
- * USER_CREATE_COMPLAINT:用户提交投诉
- * USER_CONTINUE_COMPLAINT:用户继续投诉
- * USER_RESPONSE:用户留言
- * PLATFORM_RESPONSE:平台留言
- * MERCHANT_RESPONSE:商户留言
- * MERCHANT_CONFIRM_COMPLETE:商户申请结单
- * COMPLAINT_FULL_REFUNDED:投诉单全额退款
- * USER_CREATE_COMPLAINT_SYSTEM_MESSAGE:用户提交投诉系统通知
- * COMPLAINT_FULL_REFUNDED_SYSTEM_MESSAGE:投诉单全额退款系统通知
- * USER_CONTINUE_COMPLAINT_SYSTEM_MESSAGE:用户继续投诉系统通知
- * MERCHANT_CONFIRM_COMPLETE_SYSTEM_MESSAGE:商户申请结单系统通知
- * USER_REVOKE_COMPLAINT:用户主动撤诉(只存在于历史投诉单的协商历史中)
- * PLATFORM_HELP_APPLICATION:平台问询
- * USER_APPLY_PLATFORM_HELP:申请协助
+ * USER_CREATE_COMPLAINT: 用户提交投诉
+ * USER_CONTINUE_COMPLAINT: 用户继续投诉
+ * USER_RESPONSE: 用户留言
+ * PLATFORM_RESPONSE: 平台留言
+ * MERCHANT_RESPONSE: 商户留言
+ * MERCHANT_CONFIRM_COMPLETE: 商户申请结单
+ * USER_CREATE_COMPLAINT_SYSTEM_MESSAGE: 用户提交投诉系统通知
+ * COMPLAINT_FULL_REFUNDED_SYSTEM_MESSAGE: 投诉单发起全额退款系统通知
+ * USER_CONTINUE_COMPLAINT_SYSTEM_MESSAGE: 用户继续投诉系统通知
+ * USER_REVOKE_COMPLAINT: 用户主动撤诉(只存在于历史投诉单的协商历史中)
+ * USER_COMFIRM_COMPLAINT: 用户确认投诉解决(只存在于历史投诉单的协商历史中)
+ * PLATFORM_HELP_APPLICATION: 平台催办
+ * USER_APPLY_PLATFORM_HELP: 用户申请平台协助
+ * MERCHANT_APPROVE_REFUND: 商户同意退款申请
+ * MERCHANT_REFUSE_RERUND: 商户拒绝退款申请, 此时操作内容里展示拒绝原因
+ * USER_SUBMIT_SATISFACTION: 用户提交满意度调查结果,此时操作内容里会展示满意度分数
+ * SERVICE_ORDER_CANCEL: 服务订单已取消
+ * SERVICE_ORDER_COMPLETE: 服务订单已完成
+ * COMPLAINT_PARTIAL_REFUNDED_SYSTEM_MESSAGE: 投诉单发起部分退款系统通知
+ * COMPLAINT_REFUND_RECEIVED_SYSTEM_MESSAGE: 投诉单退款到账系统通知
+ * COMPLAINT_ENTRUSTED_REFUND_SYSTEM_MESSAGE: 投诉单受托退款系统通知
+ * USER_APPLY_PLATFORM_SERVICE: 用户申请平台协助
+ * USER_CANCEL_PLATFORM_SERVICE: 用户取消平台协助
+ * PLATFORM_SERVICE_FINISHED: 客服结束平台协助
*
*/
@SerializedName("operate_type")
@@ -179,11 +189,32 @@ public static class ComplaintMedia implements Serializable {
* 描述:
* 当前投诉协商记录提交的图片凭证(url格式),最多返回4张图片,url有效时间为1小时。如未查询到协商历史图片凭证,则返回空数组。
* 注:本字段包含商户、微信支付客服在协商解决投诉时上传的图片凭证,若希望查看用户图片,请使用complaint_media_list字段并联系微信支付客服
+ * 注:此字段不包含用户提交的图片凭证,建议统一使用complaint_media_list字段接收和请求资料凭证,未来该字段将废弃
*
*/
@SerializedName("image_list")
private List imageList;
+ /**
+ *
+ * 字段名:用户申请平台协助原因
+ * 是否必填:否
+ * 描述:用户此次申请平台协助时选择的申请协助原因
+ *
+ */
+ @SerializedName("user_appy_platform_service_reason")
+ private String userApplyPlatformServiceReason;
+
+ /**
+ *
+ * 字段名:用户申请平台协助原因描述
+ * 是否必填:否
+ * 描述:用户此次申请平台协助时填写的具体申请协助原因描述
+ *
+ */
+ @SerializedName("user_appy_platform_service_reason_description")
+ private String userApplyPlatformServiceReasonDescription;
+
}
}
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/ResponseRequest.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/ResponseRequest.java
index 6f582b9301..470f2bed11 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/ResponseRequest.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/ResponseRequest.java
@@ -94,4 +94,57 @@ public class ResponseRequest implements Serializable {
@SerializedName("jump_url_text")
private String jumpUrlText;
+ /**
+ *
+ * 字段名:跳转小程序信息
+ * 是否必填:否
+ * 描述:商户可在回复中附加小程序信息,引导用户跳转至商户客诉处理小程序。
+ * 注:配置小程序属于灰度功能,若有需要请联系对接的行业运营进行咨询。
+ *
+ */
+ @SerializedName("mini_program_jump_info")
+ private MiniProgramJumpInfo miniProgramJumpInfo;
+
+
+ /**
+ * 跳转小程序信息
+ */
+ @Data
+ public static class MiniProgramJumpInfo implements Serializable {
+ private static final long serialVersionUID = 1169503275787468380L;
+
+ /**
+ *
+ * 字段名:跳转小程序APPID
+ * 是否必填:是
+ * 描述:商户可在回复中附加小程序页面路径,引导用户跳转至商户服务工具页面。
+ * 该字段为小程序APPID。
+ *
+ */
+ @SerializedName("appid")
+ private String appId;
+
+ /**
+ *
+ * 字段名:跳转小程序页面PATH
+ * 是否必填:是
+ * 描述:商户可在回复中附加小程序页面路径,引导用户跳转至商户服务工具页面。
+ * 该字段为小程序路径。
+ *
+ */
+ @SerializedName("path")
+ private String path;
+
+ /**
+ *
+ * 字段名:跳转小程序页面名称
+ * 是否必填:是
+ * 描述:商户可在回复中附加小程序页面路径,引导用户跳转至商户服务工具页面。
+ * 该字段为商户可自定义的页面名称。
+ *
+ */
+ @SerializedName("text")
+ private String text;
+ }
+
}
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/UpdateRefundProgressRequest.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/UpdateRefundProgressRequest.java
index f7715c522e..79668bd0ce 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/UpdateRefundProgressRequest.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/UpdateRefundProgressRequest.java
@@ -61,7 +61,7 @@ public class UpdateRefundProgressRequest implements Serializable {
/**
*
* 字段名:拒绝退款原因
- * 是否必填:否
+ * 是否必填:否 string(200)
* 描述:在拒绝退款时返回拒绝退款的原因
*
*/
@@ -72,7 +72,9 @@ public class UpdateRefundProgressRequest implements Serializable {
*
* 字段名:拒绝退款的举证图片列表
* 是否必填:否
- * 描述:在拒绝退款时,如果有拒绝的图片举证,可以提供 最多上传4张图片, 传入调用“商户上传反馈图片”接口返回的media_id,最多上传4张图片凭证
+ * 描述:在拒绝退款时,如果有拒绝的图片举证,可以提供 最多上传4张图片,
+ * 传入调用“商户上传反馈图片”接口返回的media_id,最多上传4张图片凭证
+ *
*
*/
@SerializedName("reject_media_list")
@@ -81,7 +83,7 @@ public class UpdateRefundProgressRequest implements Serializable {
/**
*
* 字段名:备注
- * 是否必填:否
+ * 是否必填:否 string(200)
* 描述:任何需要向微信支付客服反馈的信息
*
*/
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/notify/ComplaintNotifyResult.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/notify/ComplaintNotifyResult.java
index a5d18df6df..9464144c1d 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/notify/ComplaintNotifyResult.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/notify/ComplaintNotifyResult.java
@@ -47,13 +47,23 @@ public static class DecryptNotifyResult implements Serializable {
* 是否必填:是
* 描述:
* 触发本次投诉通知回调的具体动作类型,枚举如下:
+ * 常规通知:
* CREATE_COMPLAINT:用户提交投诉
* CONTINUE_COMPLAINT:用户继续投诉
* USER_RESPONSE:用户新留言
* RESPONSE_BY_PLATFORM:平台新留言
- * SELLER_REFUND:收款方全额退款
+ * SELLER_REFUND:商户发起全额退款
* MERCHANT_RESPONSE:商户新回复
* MERCHANT_CONFIRM_COMPLETE:商户反馈处理完成
+ * USER_APPLY_PLATFORM_SERVICE:用户申请平台协助
+ * USER_CANCEL_PLATFORM_SERVICE:用户取消平台协助
+ * PLATFORM_SERVICE_FINISHED:客服结束平台协助
+ *
+ * 申请退款单的附加通知:
+ * 以下通知会更新投诉单状态,建议收到后查询投诉单详情。
+ * MERCHANT_APPROVE_REFUND:商户同意退款
+ * MERCHANT_REJECT_REFUND:商户驳回退款
+ * REFUND_SUCCESS:退款到账
*
*/
@SerializedName(value = "action_type")
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/ComplaintService.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/ComplaintService.java
index 66de1458a3..6fc1367cf4 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/ComplaintService.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/ComplaintService.java
@@ -152,7 +152,7 @@ public interface ComplaintService {
/**
*
* 商户上传反馈图片API
- * 文档详见: ...
+ * 文档详见: ...
* 接口链接:https://api.mch.weixin.qq.com/v3/merchant-service/images/upload
*
*
@@ -165,7 +165,7 @@ public interface ComplaintService {
/**
*
* 商户上传反馈图片API
- * 文档详见: ...
+ * 文档详见: ...
* 接口链接:https://api.mch.weixin.qq.com/v3/merchant-service/images/upload
*
*
From 22ec3f0eca967b8df0ce3f8370cb69635985e1b7 Mon Sep 17 00:00:00 2001
From: Binary Wang
Date: Mon, 17 Feb 2025 11:10:49 +0800
Subject: [PATCH 053/326] =?UTF-8?q?:art:=20=E5=A2=9E=E5=8A=A0=E6=B3=A8?=
=?UTF-8?q?=E9=87=8A=E9=98=B2=E6=AD=A2=E8=AF=AF=E8=A7=A3=EF=BC=8C=E5=90=8C?=
=?UTF-8?q?=E6=97=B6=E4=BC=98=E5=8C=96=E9=87=8D=E6=9E=84=E4=BB=A3=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../binarywang/wxpay/config/WxPayConfig.java | 66 +++++++++++--------
1 file changed, 39 insertions(+), 27 deletions(-)
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java
index 8cbf954ee2..35558d5636 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java
@@ -6,6 +6,17 @@
import com.github.binarywang.wxpay.v3.WxPayV3HttpClientBuilder;
import com.github.binarywang.wxpay.v3.auth.*;
import com.github.binarywang.wxpay.v3.util.PemUtils;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.SneakyThrows;
+import lombok.ToString;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.RegExUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.ssl.SSLContexts;
+
+import javax.net.ssl.SSLContext;
import java.io.*;
import java.net.URL;
import java.nio.charset.StandardCharsets;
@@ -16,16 +27,6 @@
import java.security.cert.X509Certificate;
import java.util.Base64;
import java.util.Optional;
-import javax.net.ssl.SSLContext;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.SneakyThrows;
-import lombok.ToString;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.lang3.RegExUtils;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.http.impl.client.CloseableHttpClient;
-import org.apache.http.ssl.SSLContexts;
/**
* 微信支付配置
@@ -310,8 +311,8 @@ public CloseableHttpClient initApiV3HttpClient() throws WxPayException {
PublicKey publicKey = null;
if (this.getPublicKeyString() != null || this.getPublicKeyPath() != null || this.publicKeyContent != null) {
try (InputStream pubInputStream =
- this.loadConfigInputStream(this.getPublicKeyString(), this.getPublicKeyPath(),
- this.publicKeyContent, "publicKeyPath")) {
+ this.loadConfigInputStream(this.getPublicKeyString(), this.getPublicKeyPath(),
+ this.publicKeyContent, "publicKeyPath")) {
publicKey = PemUtils.loadPublicKey(pubInputStream);
}
}
@@ -322,10 +323,10 @@ public CloseableHttpClient initApiV3HttpClient() throws WxPayException {
Verifier certificatesVerifier;
if (publicKey == null) {
certificatesVerifier =
- new AutoUpdateCertificatesVerifier(
- new WxPayCredentials(mchId, new PrivateKeySigner(certSerialNo, merchantPrivateKey)),
- this.getApiV3Key().getBytes(StandardCharsets.UTF_8), this.getCertAutoUpdateTime(),
- this.getPayBaseUrl(), wxPayHttpProxy);
+ new AutoUpdateCertificatesVerifier(
+ new WxPayCredentials(mchId, new PrivateKeySigner(certSerialNo, merchantPrivateKey)),
+ this.getApiV3Key().getBytes(StandardCharsets.UTF_8), this.getCertAutoUpdateTime(),
+ this.getPayBaseUrl(), wxPayHttpProxy);
} else {
certificatesVerifier = new PublicCertificateVerifier(publicKey, publicKeyId);
}
@@ -366,21 +367,32 @@ private WxPayHttpProxy getWxPayHttpProxy() {
return null;
}
+ /**
+ * 从指定参数加载输入流
+ *
+ * @param configString 证书内容进行Base64加密后的字符串
+ * @param configPath 证书路径
+ * @param configContent 证书内容的字节数组
+ * @param certName 证书的标识
+ * @return 输入流
+ * @throws WxPayException 异常
+ */
private InputStream loadConfigInputStream(String configString, String configPath, byte[] configContent,
- String fileName) throws WxPayException {
- InputStream inputStream;
+ String certName) throws WxPayException {
if (configContent != null) {
- inputStream = new ByteArrayInputStream(configContent);
- } else if (StringUtils.isNotEmpty(configString)) {
+ return new ByteArrayInputStream(configContent);
+ }
+
+ if (StringUtils.isNotEmpty(configString)) {
configContent = Base64.getDecoder().decode(configString);
- inputStream = new ByteArrayInputStream(configContent);
- } else {
- if (StringUtils.isBlank(configPath)) {
- throw new WxPayException("请确保证书文件地址【" + fileName + "】或者内容已配置");
- }
- inputStream = this.loadConfigInputStream(configPath);
+ return new ByteArrayInputStream(configContent);
}
- return inputStream;
+
+ if (StringUtils.isBlank(configPath)) {
+ throw new WxPayException(String.format("请确保【%s】的文件地址【%s】存在", certName, configPath));
+ }
+
+ return this.loadConfigInputStream(configPath);
}
From 5da939647cea3c88e8ee9071f81a1efdca4c8ff4 Mon Sep 17 00:00:00 2001
From: zhangruhong
Date: Wed, 19 Feb 2025 19:50:49 +0800
Subject: [PATCH 054/326] =?UTF-8?q?:art:=20=20#3500=E3=80=90=E5=85=AC?=
=?UTF-8?q?=E4=BC=97=E5=8F=B7=E3=80=91=E6=B6=88=E6=81=AF=E6=8E=A5=E5=8F=97?=
=?UTF-8?q?=E7=B1=BB=E6=B7=BB=E5=8A=A0=E5=90=8D=E7=A7=B0=E5=AE=A1=E6=A0=B8?=
=?UTF-8?q?=E7=BB=93=E6=9E=9C=E4=BA=8B=E4=BB=B6=E6=8E=A8=E9=80=81=E6=89=80?=
=?UTF-8?q?=E9=9C=80=E5=AD=97=E6=AE=B5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../me/chanjar/weixin/mp/bean/message/WxMpXmlMessage.java | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/bean/message/WxMpXmlMessage.java b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/bean/message/WxMpXmlMessage.java
index 27b7eaecc7..4cd2d0e3b3 100644
--- a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/bean/message/WxMpXmlMessage.java
+++ b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/bean/message/WxMpXmlMessage.java
@@ -186,6 +186,14 @@ public class WxMpXmlMessage implements Serializable {
@JacksonXmlCData
private String unionId;
+ @XStreamAlias("ret")
+ @JacksonXmlProperty(localName = "ret")
+ private Integer ret;
+
+ @XStreamAlias("nickname")
+ @JacksonXmlProperty(localName = "nickname")
+ private String nickname;
+
///////////////////////////////////////
// 群发消息返回的结果
///////////////////////////////////////
From 933840e3b229ec75206aa13d6744211932ba2a58 Mon Sep 17 00:00:00 2001
From: zhangruhong
Date: Mon, 3 Mar 2025 15:11:44 +0800
Subject: [PATCH 055/326] =?UTF-8?q?:art:=20=E6=B6=88=E6=81=AF=E7=B1=BB?=
=?UTF-8?q?=E5=A2=9E=E5=8A=A0first/second=E5=AD=97=E6=AE=B5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../me/chanjar/weixin/mp/bean/message/WxMpXmlMessage.java | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/bean/message/WxMpXmlMessage.java b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/bean/message/WxMpXmlMessage.java
index 4cd2d0e3b3..3d5f4ac3a0 100644
--- a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/bean/message/WxMpXmlMessage.java
+++ b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/bean/message/WxMpXmlMessage.java
@@ -194,6 +194,14 @@ public class WxMpXmlMessage implements Serializable {
@JacksonXmlProperty(localName = "nickname")
private String nickname;
+ @XStreamAlias("first")
+ @JacksonXmlProperty(localName = "first")
+ private String first;
+
+ @XStreamAlias("second")
+ @JacksonXmlProperty(localName = "second")
+ private String second;
+
///////////////////////////////////////
// 群发消息返回的结果
///////////////////////////////////////
From 15b7460d922d93da56962df610c5d05cc0debeea Mon Sep 17 00:00:00 2001
From: Binary Wang
Date: Mon, 3 Mar 2025 15:25:33 +0800
Subject: [PATCH 056/326] =?UTF-8?q?:art:=20=E5=A2=9E=E5=8A=A0=E6=96=B0?=
=?UTF-8?q?=E7=9A=84=E8=B5=9E=E5=8A=A9=E5=95=86logo?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
README.md | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/README.md b/README.md
index f55394ef60..e02e046b33 100644
--- a/README.md
+++ b/README.md
@@ -21,24 +21,29 @@
-
+
+
+
+
+
+
-
+
-
+
-
+
From 71fbc2b1e83e7b96863c486f1f32380c33d8019e Mon Sep 17 00:00:00 2001
From: giveup
Date: Mon, 3 Mar 2025 15:28:35 +0800
Subject: [PATCH 057/326] =?UTF-8?q?:art:=20#3499=20=E3=80=90=E4=BC=81?=
=?UTF-8?q?=E4=B8=9A=E5=BE=AE=E4=BF=A1=E3=80=91=E9=85=8D=E7=BD=AE=E5=AE=A2?=
=?UTF-8?q?=E6=88=B7=E8=81=94=E7=B3=BB=E3=80=8C=E8=81=94=E7=B3=BB=E6=88=91?=
=?UTF-8?q?=E3=80=8D=E6=96=B9=E5=BC=8F=E7=9A=84=E6=8E=A5=E5=8F=A3=E5=A2=9E?=
=?UTF-8?q?=E5=8A=A0=20is=5Fexclusive=E5=AD=97=E6=AE=B5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../chanjar/weixin/cp/api/WxCpExternalContactService.java | 1 +
.../weixin/cp/bean/external/WxCpContactWayInfo.java | 7 +++++++
2 files changed, 8 insertions(+)
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpExternalContactService.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpExternalContactService.java
index c886fcab61..7f3cdeab7c 100644
--- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpExternalContactService.java
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpExternalContactService.java
@@ -38,6 +38,7 @@ public interface WxCpExternalContactService {
* 用户需要妥善存储返回的config_id,config_id丢失可能导致用户无法编辑或删除「联系我」。
* 临时会话模式不占用「联系我」数量,但每日最多添加10万个,并且仅支持单人。
* 临时会话模式的二维码,添加好友完成后该二维码即刻失效。
+ * 文档地址
*
*
* @param info 客户联系「联系我」方式
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpContactWayInfo.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpContactWayInfo.java
index 3a6a61902c..5da6a8fd5a 100644
--- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpContactWayInfo.java
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpContactWayInfo.java
@@ -152,6 +152,13 @@ public static class ContactWay implements Serializable {
@SerializedName("unionid")
private String unionId;
+
+ /**
+ *非必填,是否开启同一外部企业客户只能添加同一个员工,默认为否,开启后,同一个企业的客户会优先添加到同一个跟进人
+ */
+ @SerializedName("is_exclusive")
+ private boolean isExclusive;
+
/**
*
* 非必填
From 2bf31411c09dd81dee663b96b2797bc2521de0f1 Mon Sep 17 00:00:00 2001
From: altusea <114981887+altusea@users.noreply.github.com>
Date: Mon, 3 Mar 2025 15:34:00 +0800
Subject: [PATCH 058/326] =?UTF-8?q?:art:=20#3492=E3=80=90=E8=A7=86?=
=?UTF-8?q?=E9=A2=91=E5=8F=B7=E3=80=91=20=E5=BE=AE=E4=BF=A1=E5=B0=8F?=
=?UTF-8?q?=E5=BA=97=E8=8E=B7=E5=8F=96=E8=AE=A2=E5=8D=95=E8=AF=A6=E6=83=85?=
=?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=A2=9E=E5=8A=A0=E6=96=B0=E5=B8=A6=E8=B4=A7?=
=?UTF-8?q?=E5=B9=B3=E5=8F=B0Id=E5=AD=97=E6=AE=B5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../weixin/channel/bean/order/OrderCommissionInfo.java | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/OrderCommissionInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/OrderCommissionInfo.java
index 78e391e774..f3cab1f4bf 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/OrderCommissionInfo.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/OrderCommissionInfo.java
@@ -42,4 +42,8 @@ public class OrderCommissionInfo implements Serializable {
/** 达人openfinderid */
@JsonProperty("openfinderid")
private String openFinderId;
+
+ /** 新带货平台 id */
+ @JsonProperty("talent_id")
+ private String talentId;
}
From 44a95578d949987bb124728ef13f755f95c563dd Mon Sep 17 00:00:00 2001
From: sober
Date: Mon, 3 Mar 2025 15:39:23 +0800
Subject: [PATCH 059/326] =?UTF-8?q?:bug:=20#3508=20=E3=80=90=E4=BC=81?=
=?UTF-8?q?=E4=B8=9A=E5=BE=AE=E4=BF=A1=E3=80=91=E8=8E=B7=E5=8F=96=E4=BC=81?=
=?UTF-8?q?=E4=B8=9A=E7=94=A8=E6=88=B7=E4=BF=A1=E6=81=AF=E6=8E=A5=E5=8F=A3?=
=?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=94=A8=E6=88=B7=E4=BF=A1=E6=81=AF=E5=A4=A7?=
=?UTF-8?q?=E5=B0=8F=E5=86=99=E5=AF=BC=E8=87=B4=E7=9A=84=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../chanjar/weixin/cp/api/impl/WxCpOAuth2ServiceImpl.java | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpOAuth2ServiceImpl.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpOAuth2ServiceImpl.java
index 2a64f52bc7..d04a051c0e 100644
--- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpOAuth2ServiceImpl.java
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpOAuth2ServiceImpl.java
@@ -13,6 +13,8 @@
import me.chanjar.weixin.cp.bean.workbench.WxCpSecondVerificationInfo;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
+import java.util.Optional;
+
import static me.chanjar.weixin.common.api.WxConsts.OAuth2Scope.*;
import static me.chanjar.weixin.cp.constant.WxCpApiPathConsts.OAuth2.*;
@@ -74,9 +76,9 @@ public WxCpOauth2UserInfo getUserInfo(Integer agentId, String code) throws WxErr
JsonObject jo = GsonParser.parse(responseText);
return WxCpOauth2UserInfo.builder()
- .userId(GsonHelper.getString(jo, "UserId"))
+ .userId(Optional.ofNullable(GsonHelper.getString(jo, "UserId")).orElse(GsonHelper.getString(jo, "userid")))
.deviceId(GsonHelper.getString(jo, "DeviceId"))
- .openId(GsonHelper.getString(jo, "OpenId"))
+ .openId(Optional.ofNullable(GsonHelper.getString(jo, "OpenId")).orElse(GsonHelper.getString(jo, "openid")))
.userTicket(GsonHelper.getString(jo, "user_ticket"))
.expiresIn(GsonHelper.getString(jo, "expires_in"))
.externalUserId(GsonHelper.getString(jo, "external_userid"))
From 5decfcb917b9562fea49be35c728768a082d6fe6 Mon Sep 17 00:00:00 2001
From: raven <52941626+raven1997s@users.noreply.github.com>
Date: Mon, 3 Mar 2025 15:40:52 +0800
Subject: [PATCH 060/326] =?UTF-8?q?:art:=20=20#3505=E3=80=90=E5=BE=AE?=
=?UTF-8?q?=E4=BF=A1=E6=94=AF=E4=BB=98=E3=80=91=E4=BF=AE=E5=A4=8D=E5=BE=AE?=
=?UTF-8?q?=E4=BF=A1=E6=94=AF=E4=BB=98=E5=BC=82=E6=AD=A5=E9=80=9A=E7=9F=A5?=
=?UTF-8?q?=E8=AF=B7=E6=B1=82=E8=A7=A3=E6=9E=90=E5=A4=B1=E8=B4=A5=E9=97=AE?=
=?UTF-8?q?=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java
index 1fa2f8dc80..16fa7a799f 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java
@@ -323,12 +323,13 @@ public WxPayOrderNotifyResult parseOrderNotifyResult(String xmlData, String sign
log.debug("微信支付异步通知请求参数:{}", xmlData);
WxPayOrderNotifyResult result = WxPayOrderNotifyResult.fromXML(xmlData);
if (signType == null) {
+ String configKey = this.getConfigKey(result.getMchId(), result.getAppid());
if (result.getSignType() != null) {
// 如果解析的通知对象中signType有值,则使用它进行验签
signType = result.getSignType();
- } else if (configMap.get(result.getMchId()).getSignType() != null) {
+ } else if (configMap.get(configKey).getSignType() != null) {
// 如果配置中signType有值,则使用它进行验签
- signType = configMap.get(result.getMchId()).getSignType();
+ signType = configMap.get(configKey).getSignType();
this.switchover(result.getMchId(), result.getAppid());
}
}
From 404102a4c8a5df1bd93bf3cc3125cf28209d053b Mon Sep 17 00:00:00 2001
From: wzl <45782921+wzl-1221@users.noreply.github.com>
Date: Mon, 3 Mar 2025 15:42:26 +0800
Subject: [PATCH 061/326] =?UTF-8?q?:art:=20#3493=20=E3=80=90=E5=BE=AE?=
=?UTF-8?q?=E4=BF=A1=E6=94=AF=E4=BB=98=E3=80=91=E4=BF=AE=E5=A4=8D=E5=90=88?=
=?UTF-8?q?=E5=8D=95=E6=94=AF=E4=BB=98combineTransactions=E6=8E=A5?=
=?UTF-8?q?=E5=8F=A3=E5=8F=82=E6=95=B0=E9=94=99=E8=AF=AF=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java
index 16fa7a799f..077562f03c 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java
@@ -809,7 +809,7 @@ public CombineTransactionsResult combine(TradeTypeEnum tradeType, CombineTransac
@Override
public T combineTransactions(TradeTypeEnum tradeType, CombineTransactionsRequest request) throws WxPayException {
CombineTransactionsResult result = this.combine(tradeType, request);
- return result.getPayInfo(tradeType, request.getCombineAppid(), request.getCombineAppid(), this.getConfig().getPrivateKey());
+ return result.getPayInfo(tradeType, request.getCombineAppid(), request.getCombineMchid(), this.getConfig().getPrivateKey());
}
@Override
From 1f0dbcc2aa07f0dcb8c37a260567c1336ad9d7d2 Mon Sep 17 00:00:00 2001
From: Lyx Fly
Date: Mon, 3 Mar 2025 15:43:38 +0800
Subject: [PATCH 062/326] =?UTF-8?q?:art:=20#3516=E3=80=90=E5=85=AC?=
=?UTF-8?q?=E4=BC=97=E5=8F=B7=E3=80=91=E4=BF=AE=E6=AD=A3=E4=BB=A3=E7=90=86?=
=?UTF-8?q?=E8=AE=A4=E8=AF=81=E8=AF=B7=E6=B1=82=E5=A4=B4=E8=AE=BE=E7=BD=AE?=
=?UTF-8?q?=E9=94=99=E8=AF=AF=E7=9A=84=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../me/chanjar/weixin/mp/api/impl/WxMpServiceOkHttpImpl.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/impl/WxMpServiceOkHttpImpl.java b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/impl/WxMpServiceOkHttpImpl.java
index 6d4869b6a1..86555aa4a1 100644
--- a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/impl/WxMpServiceOkHttpImpl.java
+++ b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/impl/WxMpServiceOkHttpImpl.java
@@ -50,12 +50,12 @@ public void initHttp() {
clientBuilder.proxy(getRequestHttpProxy().getProxy());
//设置授权
- clientBuilder.authenticator(new Authenticator() {
+ clientBuilder.proxyAuthenticator(new Authenticator() {
@Override
public Request authenticate(Route route, Response response) throws IOException {
String credential = Credentials.basic(httpProxy.getProxyUsername(), httpProxy.getProxyPassword());
return response.request().newBuilder()
- .header("Authorization", credential)
+ .header("Proxy-Authorization", credential)
.build();
}
});
From 03790d64bcf56b2c0ac202a84997bd0bfb38ed0c Mon Sep 17 00:00:00 2001
From: zhongjq
Date: Thu, 6 Mar 2025 20:56:12 +0800
Subject: [PATCH 063/326] =?UTF-8?q?:art:=20WxMaMessage.allFieldsMap?=
=?UTF-8?q?=E6=94=AF=E6=8C=81json=E6=A0=BC=E5=BC=8F=E6=95=B0=E6=8D=AE?=
=?UTF-8?q?=E5=AD=98=E6=94=BE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../main/java/cn/binarywang/wx/miniapp/bean/WxMaMessage.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/WxMaMessage.java b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/WxMaMessage.java
index 7a004b845c..75d8174caf 100644
--- a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/WxMaMessage.java
+++ b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/WxMaMessage.java
@@ -31,7 +31,7 @@ public class WxMaMessage implements Serializable {
private static final long serialVersionUID = -3586245291677274914L;
/**
- * 使用dom4j解析的存放所有xml属性和值的map.
+ * 使用dom4j解析的存放所有xml或json属性和值的map.
*/
private Map allFieldsMap;
@@ -287,6 +287,7 @@ public static WxMaMessage fromJson(String json) {
}
message.setUselessMsg(null);
}
+ message.setAllFieldsMap(WxMaGsonBuilder.create().fromJson(json, Map.class));
return message;
}
From 5ac9922f8d56e345ecc4ded6b095a8a14957a1d5 Mon Sep 17 00:00:00 2001
From: SynchPj <46849861+SynchPj@users.noreply.github.com>
Date: Mon, 17 Mar 2025 10:58:50 +0800
Subject: [PATCH 064/326] =?UTF-8?q?:art:=20#3498=E3=80=90=E5=BE=AE?=
=?UTF-8?q?=E4=BF=A1=E6=94=AF=E4=BB=98=E3=80=91=E6=9C=8D=E5=8A=A1=E5=95=86?=
=?UTF-8?q?=E6=A8=A1=E5=BC=8F-=E5=85=BC=E5=AE=B9=E5=85=AC=E9=92=A5?=
=?UTF-8?q?=E6=A8=A1=E5=BC=8F=E4=B8=8B=E8=AF=B7=E6=B1=82=E5=A4=B4=E5=BA=8F?=
=?UTF-8?q?=E5=88=97=E5=8F=B7=E4=BB=A5=E5=8F=8A=E7=81=B0=E5=BA=A6=E5=88=87?=
=?UTF-8?q?=E6=8D=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../binarywang/wxpay/config/WxPayConfig.java | 26 +++++++++++--------
.../impl/WxPayServiceApacheHttpImpl.java | 7 ++---
.../v3/auth/PublicCertificateVerifier.java | 9 +++++++
.../binarywang/wxpay/v3/auth/Verifier.java | 2 ++
4 files changed, 30 insertions(+), 14 deletions(-)
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java
index 35558d5636..dedbc64137 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java
@@ -320,16 +320,7 @@ public CloseableHttpClient initApiV3HttpClient() throws WxPayException {
//构造Http Proxy正向代理
WxPayHttpProxy wxPayHttpProxy = getWxPayHttpProxy();
- Verifier certificatesVerifier;
- if (publicKey == null) {
- certificatesVerifier =
- new AutoUpdateCertificatesVerifier(
- new WxPayCredentials(mchId, new PrivateKeySigner(certSerialNo, merchantPrivateKey)),
- this.getApiV3Key().getBytes(StandardCharsets.UTF_8), this.getCertAutoUpdateTime(),
- this.getPayBaseUrl(), wxPayHttpProxy);
- } else {
- certificatesVerifier = new PublicCertificateVerifier(publicKey, publicKeyId);
- }
+ Verifier certificatesVerifier = getVerifier(merchantPrivateKey, wxPayHttpProxy, publicKey);
WxPayV3HttpClientBuilder wxPayV3HttpClientBuilder = WxPayV3HttpClientBuilder.create()
.withMerchant(mchId, certSerialNo, merchantPrivateKey)
@@ -355,6 +346,19 @@ public CloseableHttpClient initApiV3HttpClient() throws WxPayException {
}
}
+ private Verifier getVerifier(PrivateKey merchantPrivateKey, WxPayHttpProxy wxPayHttpProxy, PublicKey publicKey) {
+ Verifier certificatesVerifier = new AutoUpdateCertificatesVerifier(
+ new WxPayCredentials(mchId, new PrivateKeySigner(certSerialNo, merchantPrivateKey)),
+ this.getApiV3Key().getBytes(StandardCharsets.UTF_8), this.getCertAutoUpdateTime(),
+ this.getPayBaseUrl(), wxPayHttpProxy);
+ if (publicKey != null) {
+ Verifier publicCertificatesVerifier = new PublicCertificateVerifier(publicKey, publicKeyId);
+ publicCertificatesVerifier.setOtherVerifier(certificatesVerifier);
+ certificatesVerifier = publicCertificatesVerifier;
+ }
+ return certificatesVerifier;
+ }
+
/**
* 初始化一个WxPayHttpProxy对象
*
@@ -382,7 +386,7 @@ private InputStream loadConfigInputStream(String configString, String configPath
if (configContent != null) {
return new ByteArrayInputStream(configContent);
}
-
+
if (StringUtils.isNotEmpty(configString)) {
configContent = Base64.getDecoder().decode(configString);
return new ByteArrayInputStream(configContent);
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceApacheHttpImpl.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceApacheHttpImpl.java
index 7fd7939797..d8ba95971e 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceApacheHttpImpl.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceApacheHttpImpl.java
@@ -100,6 +100,8 @@ public String postV3(String url, String requestStr) throws WxPayException {
HttpPost httpPost = this.createHttpPost(url, requestStr);
httpPost.addHeader(ACCEPT, APPLICATION_JSON);
httpPost.addHeader(CONTENT_TYPE, APPLICATION_JSON);
+ String serialNumber = getWechatpaySerial(getConfig());
+ httpPost.addHeader("Wechatpay-Serial", serialNumber);
try (CloseableHttpResponse response = httpClient.execute(httpPost)) {
//v3已经改为通过状态码判断200 204 成功
int statusCode = response.getStatusLine().getStatusCode();
@@ -387,10 +389,9 @@ private WxPayException convertException(JsonObject jsonObject) {
* @return
*/
private String getWechatpaySerial(WxPayConfig wxPayConfig) {
- String serialNumber = wxPayConfig.getVerifier().getValidCertificate().getSerialNumber().toString(16).toUpperCase();
if (StringUtils.isNotBlank(wxPayConfig.getPublicKeyId())) {
- serialNumber = wxPayConfig.getPublicKeyId();
+ return wxPayConfig.getPublicKeyId();
}
- return serialNumber;
+ return wxPayConfig.getVerifier().getValidCertificate().getSerialNumber().toString(16).toUpperCase();
}
}
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/v3/auth/PublicCertificateVerifier.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/v3/auth/PublicCertificateVerifier.java
index 9344fc6f83..45f76818cd 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/v3/auth/PublicCertificateVerifier.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/v3/auth/PublicCertificateVerifier.java
@@ -9,6 +9,8 @@ public class PublicCertificateVerifier implements Verifier{
private final PublicKey publicKey;
+ private Verifier certificateVerifier;
+
private final X509PublicCertificate publicCertificate;
public PublicCertificateVerifier(PublicKey publicKey, String publicId) {
@@ -16,8 +18,15 @@ public PublicCertificateVerifier(PublicKey publicKey, String publicId) {
this.publicCertificate = new X509PublicCertificate(publicKey, publicId);
}
+ public void setOtherVerifier(Verifier verifier) {
+ this.certificateVerifier = verifier;
+ }
+
@Override
public boolean verify(String serialNumber, byte[] message, String signature) {
+ if (!serialNumber.contains("PUB_KEY_ID")) {
+ return this.certificateVerifier.verify(serialNumber, message, signature);
+ }
try {
Signature sign = Signature.getInstance("SHA256withRSA");
sign.initVerify(publicKey);
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/v3/auth/Verifier.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/v3/auth/Verifier.java
index 49f92e2f5b..22676601c0 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/v3/auth/Verifier.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/v3/auth/Verifier.java
@@ -7,4 +7,6 @@ public interface Verifier {
X509Certificate getValidCertificate();
+
+ default void setOtherVerifier(Verifier verifier) {};
}
From 25309e06ad0f631591f0c9bcdd85ed5b34de87f4 Mon Sep 17 00:00:00 2001
From: Binary Wang
Date: Tue, 18 Mar 2025 12:58:09 +0800
Subject: [PATCH 065/326] =?UTF-8?q?:bookmark:=20=E5=8F=91=E5=B8=83=204.7.3?=
=?UTF-8?q?.B=20=E6=B5=8B=E8=AF=95=E7=89=88=E6=9C=AC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pom.xml | 2 +-
solon-plugins/pom.xml | 2 +-
solon-plugins/wx-java-channel-multi-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-channel-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-cp-multi-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-cp-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-miniapp-multi-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-miniapp-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-mp-multi-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-mp-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-open-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-pay-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-qidian-solon-plugin/pom.xml | 2 +-
spring-boot-starters/pom.xml | 2 +-
.../wx-java-channel-multi-spring-boot-starter/pom.xml | 2 +-
.../wx-java-channel-spring-boot-starter/pom.xml | 2 +-
.../wx-java-cp-multi-spring-boot-starter/pom.xml | 2 +-
spring-boot-starters/wx-java-cp-spring-boot-starter/pom.xml | 2 +-
.../wx-java-miniapp-multi-spring-boot-starter/pom.xml | 2 +-
.../wx-java-miniapp-spring-boot-starter/pom.xml | 2 +-
.../wx-java-mp-multi-spring-boot-starter/pom.xml | 2 +-
spring-boot-starters/wx-java-mp-spring-boot-starter/pom.xml | 2 +-
spring-boot-starters/wx-java-open-spring-boot-starter/pom.xml | 2 +-
spring-boot-starters/wx-java-pay-spring-boot-starter/pom.xml | 2 +-
spring-boot-starters/wx-java-qidian-spring-boot-starter/pom.xml | 2 +-
weixin-graal/pom.xml | 2 +-
weixin-java-channel/pom.xml | 2 +-
weixin-java-common/pom.xml | 2 +-
weixin-java-cp/pom.xml | 2 +-
weixin-java-miniapp/pom.xml | 2 +-
weixin-java-mp/pom.xml | 2 +-
weixin-java-open/pom.xml | 2 +-
weixin-java-pay/pom.xml | 2 +-
weixin-java-qidian/pom.xml | 2 +-
34 files changed, 34 insertions(+), 34 deletions(-)
diff --git a/pom.xml b/pom.xml
index c7c40521b5..2151c117a7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -3,7 +3,7 @@
4.0.0
com.github.binarywang
wx-java
- 4.7.2.B
+ 4.7.3.B
pom
WxJava - Weixin/Wechat Java SDK
微信开发Java SDK
diff --git a/solon-plugins/pom.xml b/solon-plugins/pom.xml
index 9585e96179..8dbc6b43d1 100644
--- a/solon-plugins/pom.xml
+++ b/solon-plugins/pom.xml
@@ -6,7 +6,7 @@
com.github.binarywang
wx-java
- 4.7.2.B
+ 4.7.3.B
pom
wx-java-solon-plugins
diff --git a/solon-plugins/wx-java-channel-multi-solon-plugin/pom.xml b/solon-plugins/wx-java-channel-multi-solon-plugin/pom.xml
index a9b794a965..fc2796117c 100644
--- a/solon-plugins/wx-java-channel-multi-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-channel-multi-solon-plugin/pom.xml
@@ -5,7 +5,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.7.2.B
+ 4.7.3.B
4.0.0
diff --git a/solon-plugins/wx-java-channel-solon-plugin/pom.xml b/solon-plugins/wx-java-channel-solon-plugin/pom.xml
index 4e0dc723a8..83a00deace 100644
--- a/solon-plugins/wx-java-channel-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-channel-solon-plugin/pom.xml
@@ -3,7 +3,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.7.2.B
+ 4.7.3.B
4.0.0
diff --git a/solon-plugins/wx-java-cp-multi-solon-plugin/pom.xml b/solon-plugins/wx-java-cp-multi-solon-plugin/pom.xml
index 9cf2b31724..512cb41d40 100644
--- a/solon-plugins/wx-java-cp-multi-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-cp-multi-solon-plugin/pom.xml
@@ -4,7 +4,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.7.2.B
+ 4.7.3.B
4.0.0
diff --git a/solon-plugins/wx-java-cp-solon-plugin/pom.xml b/solon-plugins/wx-java-cp-solon-plugin/pom.xml
index 46266b8e80..f147e36eee 100644
--- a/solon-plugins/wx-java-cp-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-cp-solon-plugin/pom.xml
@@ -4,7 +4,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.7.2.B
+ 4.7.3.B
4.0.0
diff --git a/solon-plugins/wx-java-miniapp-multi-solon-plugin/pom.xml b/solon-plugins/wx-java-miniapp-multi-solon-plugin/pom.xml
index 1e5dab26b6..b8387c3c00 100644
--- a/solon-plugins/wx-java-miniapp-multi-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-miniapp-multi-solon-plugin/pom.xml
@@ -5,7 +5,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.7.2.B
+ 4.7.3.B
4.0.0
diff --git a/solon-plugins/wx-java-miniapp-solon-plugin/pom.xml b/solon-plugins/wx-java-miniapp-solon-plugin/pom.xml
index 805018b81d..712e1abfb2 100644
--- a/solon-plugins/wx-java-miniapp-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-miniapp-solon-plugin/pom.xml
@@ -4,7 +4,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.7.2.B
+ 4.7.3.B
4.0.0
diff --git a/solon-plugins/wx-java-mp-multi-solon-plugin/pom.xml b/solon-plugins/wx-java-mp-multi-solon-plugin/pom.xml
index 4ccc4fa7d7..39df8cfef7 100644
--- a/solon-plugins/wx-java-mp-multi-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-mp-multi-solon-plugin/pom.xml
@@ -5,7 +5,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.7.2.B
+ 4.7.3.B
4.0.0
diff --git a/solon-plugins/wx-java-mp-solon-plugin/pom.xml b/solon-plugins/wx-java-mp-solon-plugin/pom.xml
index 3aa2b9be41..cd2bca716c 100644
--- a/solon-plugins/wx-java-mp-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-mp-solon-plugin/pom.xml
@@ -5,7 +5,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.7.2.B
+ 4.7.3.B
4.0.0
diff --git a/solon-plugins/wx-java-open-solon-plugin/pom.xml b/solon-plugins/wx-java-open-solon-plugin/pom.xml
index 355ef6f939..bbd6b39ab0 100644
--- a/solon-plugins/wx-java-open-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-open-solon-plugin/pom.xml
@@ -5,7 +5,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.7.2.B
+ 4.7.3.B
4.0.0
diff --git a/solon-plugins/wx-java-pay-solon-plugin/pom.xml b/solon-plugins/wx-java-pay-solon-plugin/pom.xml
index 6357cc908b..31698e010c 100644
--- a/solon-plugins/wx-java-pay-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-pay-solon-plugin/pom.xml
@@ -5,7 +5,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.7.2.B
+ 4.7.3.B
4.0.0
diff --git a/solon-plugins/wx-java-qidian-solon-plugin/pom.xml b/solon-plugins/wx-java-qidian-solon-plugin/pom.xml
index 4ff6dba008..8a45c7284d 100644
--- a/solon-plugins/wx-java-qidian-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-qidian-solon-plugin/pom.xml
@@ -3,7 +3,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.7.2.B
+ 4.7.3.B
4.0.0
diff --git a/spring-boot-starters/pom.xml b/spring-boot-starters/pom.xml
index c5cb2954d3..fbb85e6861 100644
--- a/spring-boot-starters/pom.xml
+++ b/spring-boot-starters/pom.xml
@@ -6,7 +6,7 @@
com.github.binarywang
wx-java
- 4.7.2.B
+ 4.7.3.B
pom
wx-java-spring-boot-starters
diff --git a/spring-boot-starters/wx-java-channel-multi-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-channel-multi-spring-boot-starter/pom.xml
index dca311c015..4018347e6c 100644
--- a/spring-boot-starters/wx-java-channel-multi-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-channel-multi-spring-boot-starter/pom.xml
@@ -5,7 +5,7 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.7.2.B
+ 4.7.3.B
4.0.0
diff --git a/spring-boot-starters/wx-java-channel-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-channel-spring-boot-starter/pom.xml
index 8f427c6d03..7b9ae6ee29 100644
--- a/spring-boot-starters/wx-java-channel-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-channel-spring-boot-starter/pom.xml
@@ -3,7 +3,7 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.7.2.B
+ 4.7.3.B
4.0.0
diff --git a/spring-boot-starters/wx-java-cp-multi-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-cp-multi-spring-boot-starter/pom.xml
index 6ea0eb005f..03cb191fee 100644
--- a/spring-boot-starters/wx-java-cp-multi-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-cp-multi-spring-boot-starter/pom.xml
@@ -4,7 +4,7 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.7.2.B
+ 4.7.3.B
4.0.0
diff --git a/spring-boot-starters/wx-java-cp-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-cp-spring-boot-starter/pom.xml
index fdbe3d1e54..8de92d3eed 100644
--- a/spring-boot-starters/wx-java-cp-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-cp-spring-boot-starter/pom.xml
@@ -4,7 +4,7 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.7.2.B
+ 4.7.3.B
4.0.0
diff --git a/spring-boot-starters/wx-java-miniapp-multi-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-miniapp-multi-spring-boot-starter/pom.xml
index cedde81744..886cf8f884 100644
--- a/spring-boot-starters/wx-java-miniapp-multi-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-miniapp-multi-spring-boot-starter/pom.xml
@@ -5,7 +5,7 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.7.2.B
+ 4.7.3.B
4.0.0
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 fba6da9e0a..a2f3aa7423 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 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.7.2.B
+ 4.7.3.B
4.0.0
diff --git a/spring-boot-starters/wx-java-mp-multi-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-mp-multi-spring-boot-starter/pom.xml
index 867f570558..3f3ecc50d9 100644
--- a/spring-boot-starters/wx-java-mp-multi-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-mp-multi-spring-boot-starter/pom.xml
@@ -5,7 +5,7 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.7.2.B
+ 4.7.3.B
4.0.0
diff --git a/spring-boot-starters/wx-java-mp-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-mp-spring-boot-starter/pom.xml
index cddf39300b..ab6d89e6f2 100644
--- a/spring-boot-starters/wx-java-mp-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-mp-spring-boot-starter/pom.xml
@@ -5,7 +5,7 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.7.2.B
+ 4.7.3.B
4.0.0
diff --git a/spring-boot-starters/wx-java-open-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-open-spring-boot-starter/pom.xml
index 189ff94672..cdb43685f7 100644
--- a/spring-boot-starters/wx-java-open-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-open-spring-boot-starter/pom.xml
@@ -5,7 +5,7 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.7.2.B
+ 4.7.3.B
4.0.0
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 d4de4e77f8..1aa1dc6f6a 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 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.7.2.B
+ 4.7.3.B
4.0.0
diff --git a/spring-boot-starters/wx-java-qidian-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-qidian-spring-boot-starter/pom.xml
index e118aba652..c38a1d3501 100644
--- a/spring-boot-starters/wx-java-qidian-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-qidian-spring-boot-starter/pom.xml
@@ -3,7 +3,7 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.7.2.B
+ 4.7.3.B
4.0.0
diff --git a/weixin-graal/pom.xml b/weixin-graal/pom.xml
index 338a22a564..ab9ec8c916 100644
--- a/weixin-graal/pom.xml
+++ b/weixin-graal/pom.xml
@@ -6,7 +6,7 @@
com.github.binarywang
wx-java
- 4.7.2.B
+ 4.7.3.B
weixin-graal
diff --git a/weixin-java-channel/pom.xml b/weixin-java-channel/pom.xml
index 8d34754cb3..76be718a41 100644
--- a/weixin-java-channel/pom.xml
+++ b/weixin-java-channel/pom.xml
@@ -6,7 +6,7 @@
com.github.binarywang
wx-java
- 4.7.2.B
+ 4.7.3.B
weixin-java-channel
diff --git a/weixin-java-common/pom.xml b/weixin-java-common/pom.xml
index e89234d17a..88e1b2c3f2 100644
--- a/weixin-java-common/pom.xml
+++ b/weixin-java-common/pom.xml
@@ -6,7 +6,7 @@
com.github.binarywang
wx-java
- 4.7.2.B
+ 4.7.3.B
weixin-java-common
diff --git a/weixin-java-cp/pom.xml b/weixin-java-cp/pom.xml
index 467ba98858..95d0672448 100644
--- a/weixin-java-cp/pom.xml
+++ b/weixin-java-cp/pom.xml
@@ -7,7 +7,7 @@
com.github.binarywang
wx-java
- 4.7.2.B
+ 4.7.3.B
weixin-java-cp
diff --git a/weixin-java-miniapp/pom.xml b/weixin-java-miniapp/pom.xml
index cfe52b9686..500add0e40 100644
--- a/weixin-java-miniapp/pom.xml
+++ b/weixin-java-miniapp/pom.xml
@@ -7,7 +7,7 @@
com.github.binarywang
wx-java
- 4.7.2.B
+ 4.7.3.B
weixin-java-miniapp
diff --git a/weixin-java-mp/pom.xml b/weixin-java-mp/pom.xml
index 0aecd36da2..dde82cf5dc 100644
--- a/weixin-java-mp/pom.xml
+++ b/weixin-java-mp/pom.xml
@@ -7,7 +7,7 @@
com.github.binarywang
wx-java
- 4.7.2.B
+ 4.7.3.B
weixin-java-mp
diff --git a/weixin-java-open/pom.xml b/weixin-java-open/pom.xml
index f7fac62e64..e940591310 100644
--- a/weixin-java-open/pom.xml
+++ b/weixin-java-open/pom.xml
@@ -7,7 +7,7 @@
com.github.binarywang
wx-java
- 4.7.2.B
+ 4.7.3.B
weixin-java-open
diff --git a/weixin-java-pay/pom.xml b/weixin-java-pay/pom.xml
index 6eeb06624e..f66456aa43 100644
--- a/weixin-java-pay/pom.xml
+++ b/weixin-java-pay/pom.xml
@@ -5,7 +5,7 @@
com.github.binarywang
wx-java
- 4.7.2.B
+ 4.7.3.B
4.0.0
diff --git a/weixin-java-qidian/pom.xml b/weixin-java-qidian/pom.xml
index 737af413d2..4e96a904b9 100644
--- a/weixin-java-qidian/pom.xml
+++ b/weixin-java-qidian/pom.xml
@@ -7,7 +7,7 @@
com.github.binarywang
wx-java
- 4.7.2.B
+ 4.7.3.B
weixin-java-qidian
From 5604a16ae89dcbfb2cf4db45d2f908bdc6a72758 Mon Sep 17 00:00:00 2001
From: Binary Wang
Date: Sun, 23 Mar 2025 20:00:52 +0800
Subject: [PATCH 066/326] :art: fix doc
---
CONTRIBUTING.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index c703964824..0b16b4779e 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -28,7 +28,7 @@ $ git push
* 定期使用项目仓库内容更新自己仓库内容。
```bash
-$ git remote add upstream https://github.com/Wechat-Group/WxJava
+$ git remote add upstream https://github.com/binarywang/WxJava
$ git fetch upstream
$ git checkout develop
$ git rebase upstream/develop
From b225afbd68f69ebe44af3b6fad0bc3404d28d067 Mon Sep 17 00:00:00 2001
From: yangmengyu2021 <87807185+yangmengyu2021@users.noreply.github.com>
Date: Sun, 23 Mar 2025 20:07:01 +0800
Subject: [PATCH 067/326] =?UTF-8?q?:art:=20#3532=20=E3=80=90=E5=BE=AE?=
=?UTF-8?q?=E4=BF=A1=E6=94=AF=E4=BB=98=E3=80=91=E4=BF=AE=E5=A4=8D=E6=94=AF?=
=?UTF-8?q?=E4=BB=98=E9=80=9A=E7=9F=A5=E5=9B=9E=E8=B0=83=E8=A7=A3=E6=9E=90?=
=?UTF-8?q?=E6=96=B9=E6=B3=95=E6=8A=A5=E9=94=99=E7=9A=84=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../wxpay/service/impl/BaseWxPayServiceImpl.java | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java
index 077562f03c..05d1f8c22e 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java
@@ -323,14 +323,13 @@ public WxPayOrderNotifyResult parseOrderNotifyResult(String xmlData, String sign
log.debug("微信支付异步通知请求参数:{}", xmlData);
WxPayOrderNotifyResult result = WxPayOrderNotifyResult.fromXML(xmlData);
if (signType == null) {
- String configKey = this.getConfigKey(result.getMchId(), result.getAppid());
+ this.switchover(result.getMchId(), result.getAppid());
if (result.getSignType() != null) {
// 如果解析的通知对象中signType有值,则使用它进行验签
signType = result.getSignType();
- } else if (configMap.get(configKey).getSignType() != null) {
+ } else if (this.getConfig().getSignType() != null) {
// 如果配置中signType有值,则使用它进行验签
- signType = configMap.get(configKey).getSignType();
- this.switchover(result.getMchId(), result.getAppid());
+ signType = this.getConfig().getSignType();
}
}
From dd407141b03c102f1aaff878685a7ebd14271147 Mon Sep 17 00:00:00 2001
From: SynchPj <46849861+SynchPj@users.noreply.github.com>
Date: Mon, 7 Apr 2025 13:01:53 +0800
Subject: [PATCH 068/326] =?UTF-8?q?:art:=20#3530=20=E3=80=90=E5=BE=AE?=
=?UTF-8?q?=E4=BF=A1=E6=94=AF=E4=BB=98=E3=80=91=E4=BF=AE=E5=A4=8D=E6=9C=AA?=
=?UTF-8?q?=E8=AE=BE=E7=BD=AE=E5=B9=B3=E5=8F=B0=E8=AF=81=E4=B9=A6=E5=BC=95?=
=?UTF-8?q?=E8=B5=B7=E7=9A=84v3=E8=AF=B7=E6=B1=82=E6=9E=84=E9=80=A0?=
=?UTF-8?q?=E5=BC=82=E5=B8=B8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../github/binarywang/wxpay/config/WxPayConfig.java | 12 ++++++++----
.../wxpay/v3/auth/PublicCertificateVerifier.java | 2 +-
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java
index dedbc64137..7a14ea1523 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java
@@ -347,10 +347,14 @@ public CloseableHttpClient initApiV3HttpClient() throws WxPayException {
}
private Verifier getVerifier(PrivateKey merchantPrivateKey, WxPayHttpProxy wxPayHttpProxy, PublicKey publicKey) {
- Verifier certificatesVerifier = new AutoUpdateCertificatesVerifier(
- new WxPayCredentials(mchId, new PrivateKeySigner(certSerialNo, merchantPrivateKey)),
- this.getApiV3Key().getBytes(StandardCharsets.UTF_8), this.getCertAutoUpdateTime(),
- this.getPayBaseUrl(), wxPayHttpProxy);
+ Verifier certificatesVerifier = null;
+ // 如果配置了平台证书,则初始化验证器以备v2版本接口验签(公钥灰度实现)
+ if (this.getPrivateCertPath() != null && this.getPrivateKeyPath() != null) {
+ certificatesVerifier = new AutoUpdateCertificatesVerifier(
+ new WxPayCredentials(mchId, new PrivateKeySigner(certSerialNo, merchantPrivateKey)),
+ this.getApiV3Key().getBytes(StandardCharsets.UTF_8), this.getCertAutoUpdateTime(),
+ this.getPayBaseUrl(), wxPayHttpProxy);
+ }
if (publicKey != null) {
Verifier publicCertificatesVerifier = new PublicCertificateVerifier(publicKey, publicKeyId);
publicCertificatesVerifier.setOtherVerifier(certificatesVerifier);
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/v3/auth/PublicCertificateVerifier.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/v3/auth/PublicCertificateVerifier.java
index 45f76818cd..8c9c4f3569 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/v3/auth/PublicCertificateVerifier.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/v3/auth/PublicCertificateVerifier.java
@@ -24,7 +24,7 @@ public void setOtherVerifier(Verifier verifier) {
@Override
public boolean verify(String serialNumber, byte[] message, String signature) {
- if (!serialNumber.contains("PUB_KEY_ID")) {
+ if (!serialNumber.contains("PUB_KEY_ID") && this.certificateVerifier != null) {
return this.certificateVerifier.verify(serialNumber, message, signature);
}
try {
From 3f0b8d4e2bf4fe2d355e412e074078f71eef261b Mon Sep 17 00:00:00 2001
From: cloudX
Date: Mon, 7 Apr 2025 13:03:10 +0800
Subject: [PATCH 069/326] =?UTF-8?q?:art:=20#3538=20=E3=80=90=E5=BE=AE?=
=?UTF-8?q?=E4=BF=A1=E6=94=AF=E4=BB=98=E3=80=91V3=E6=8E=A5=E5=8F=A3?=
=?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=AE=9E=E5=90=8D=E6=94=AF=E4=BB=98=E5=8F=82?=
=?UTF-8?q?=E6=95=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../request/WxPayUnifiedOrderV3Request.java | 38 +++++++++++++++++++
1 file changed, 38 insertions(+)
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/request/WxPayUnifiedOrderV3Request.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/request/WxPayUnifiedOrderV3Request.java
index 98dae388ef..8ac588de81 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/request/WxPayUnifiedOrderV3Request.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/request/WxPayUnifiedOrderV3Request.java
@@ -250,6 +250,12 @@ public static class Payer implements Serializable {
*/
@SerializedName(value = "openid")
private String openid;
+
+ /**
+ * 实名支付用户身份标识
+ */
+ @SerializedName(value = "identity")
+ private Identity identity;
}
@Data
@@ -572,4 +578,36 @@ public static class SettleInfo implements Serializable {
@SerializedName(value = "profit_sharing")
private Boolean profitSharing;
}
+
+
+ @Data
+ @NoArgsConstructor
+ public static class Identity implements Serializable {
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 证件类型
+ * IDCARD:身份证
+ * HONGKONG_MACAO:港澳回乡证
+ * HONGKONG_MACAO_RESIDENT:港澳居住证
+ * TAIWAN_RESIDENT:台湾居住证
+ * FOREIGN_RESIDENT:外国人永居证
+ * OVERSEA_PASSPORT:护照
+ */
+ @SerializedName(value = "type")
+ private String type;
+ /**
+ * 证件号
+ * 证件号,如身份证号。
+ * 示例值:43102119910910512X
+ */
+ @SerializedName(value = "number")
+ private String number;
+ /**
+ * 证件姓名。
+ * 示例值:周星星
+ */
+ @SerializedName(value = "name")
+ private String name;
+ }
}
From 4828a314e9f5a721dfc8cadc04a25f1d0ff63649 Mon Sep 17 00:00:00 2001
From: yangmengyu2021 <87807185+yangmengyu2021@users.noreply.github.com>
Date: Mon, 7 Apr 2025 13:04:33 +0800
Subject: [PATCH 070/326] =?UTF-8?q?:art:=20#3534=20=E4=B8=BAconnectionRequ?=
=?UTF-8?q?estTimeout=E8=AE=BE=E7=BD=AE=E9=BB=98=E8=AE=A4=E5=80=BC?=
=?UTF-8?q?=EF=BC=8C=E9=81=BF=E5=85=8D=E5=BC=80=E5=8F=91=E8=80=85=E5=9C=A8?=
=?UTF-8?q?=E8=99=9A=E6=8B=9F=E7=BA=BF=E7=A8=8B=E4=B8=AD=E8=B0=83=E7=94=A8?=
=?UTF-8?q?=E6=A1=86=E6=9E=B6=E7=9A=84httpClient=E6=97=B6=E9=80=A0?=
=?UTF-8?q?=E6=88=90=E7=9A=84=E6=97=A0=E9=99=90=E7=AD=89=E5=BE=85?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../common/util/http/apache/DefaultApacheHttpClientBuilder.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/apache/DefaultApacheHttpClientBuilder.java b/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/apache/DefaultApacheHttpClientBuilder.java
index 4c06f5168e..12f04ba20c 100644
--- a/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/apache/DefaultApacheHttpClientBuilder.java
+++ b/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/apache/DefaultApacheHttpClientBuilder.java
@@ -59,7 +59,7 @@ public class DefaultApacheHttpClientBuilder implements ApacheHttpClientBuilder {
* 设置为负数是使用系统默认设置(非3000ms的默认值,而是httpClient的默认设置).
*
*/
- private int connectionRequestTimeout = -1;
+ private int connectionRequestTimeout = 3000;
/**
* 建立链接的超时时间,默认为5000ms.由于是在链接池获取链接,此设置应该并不起什么作用
From 0452a05dd4e093dc50d4b3fed859521b830036fc Mon Sep 17 00:00:00 2001
From: cxiaoxifeng <11973717+cxiaoxifeng@user.noreply.gitee.com>
Date: Wed, 19 Mar 2025 08:54:05 +0000
Subject: [PATCH 071/326] =?UTF-8?q?:art:=20=E3=80=90=E5=B0=8F=E7=A8=8B?=
=?UTF-8?q?=E5=BA=8F=E3=80=91=E4=BF=AE=E5=A4=8D=E7=89=A9=E6=B5=81=E6=9C=8D?=
=?UTF-8?q?=E5=8A=A1=E6=9F=A5=E8=AF=A2=E7=BB=84=E4=BB=B6=E6=9B=B4=E6=96=B0?=
=?UTF-8?q?=E7=89=A9=E5=93=81=E4=BF=A1=E6=81=AF=E6=8E=A5=E5=8F=A3=E7=9A=84?=
=?UTF-8?q?=E5=9C=B0=E5=9D=80?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../wx/miniapp/api/impl/WxMaImmediateDeliveryServiceImpl.java | 2 +-
.../cn/binarywang/wx/miniapp/constant/WxMaApiUrlConstants.java | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/WxMaImmediateDeliveryServiceImpl.java b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/WxMaImmediateDeliveryServiceImpl.java
index 05e8f2e0a7..342224effb 100644
--- a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/WxMaImmediateDeliveryServiceImpl.java
+++ b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/WxMaImmediateDeliveryServiceImpl.java
@@ -207,7 +207,7 @@ public GetDeliveryListResponse getDeliveryList() throws WxErrorException {
@Override
public WxMaBaseResponse updateWaybillGoods(UpdateWaybillGoodsRequest request) throws WxErrorException {
- String responseContent = this.wxMaService.post(InstantDelivery.GET_DELIVERY_LIST_URL,request);
+ String responseContent = this.wxMaService.post(InstantDelivery.UPDATE_WAYBILL_GOODS_URL,request);
WxMaBaseResponse response = WxMaGsonBuilder.create().fromJson(responseContent, WxMaBaseResponse.class);
if (response.getErrcode() == -1) {
throw new WxErrorException(WxError.fromJson(responseContent, WxType.MiniApp));
diff --git a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/constant/WxMaApiUrlConstants.java b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/constant/WxMaApiUrlConstants.java
index d61ade73c3..30d52b17cf 100644
--- a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/constant/WxMaApiUrlConstants.java
+++ b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/constant/WxMaApiUrlConstants.java
@@ -626,7 +626,7 @@ public interface InstantDelivery {
String GET_DELIVERY_LIST_URL =
"https://api.weixin.qq.com/cgi-bin/express/delivery/open_msg/get_delivery_list";
- /** 获取运力id列表get_delivery_list 商户使用此接口获取所有运力id的列表 */
+ /** 物流服务-查询组件-更新物品信息接口 update_waybill_goods 更新物品信息 */
String UPDATE_WAYBILL_GOODS_URL =
"https://api.weixin.qq.com/cgi-bin/express/delivery/open_msg/update_waybill_goods";
From b6c3d74cbae1946ccd2e996bbb3ce097ff1fa08f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=B0=88=E7=AC=91?= <2300064869@qq.com>
Date: Wed, 19 Mar 2025 08:57:40 +0000
Subject: [PATCH 072/326] =?UTF-8?q?:new:=20#3529=20=E3=80=90=E4=BC=81?=
=?UTF-8?q?=E4=B8=9A=E5=BE=AE=E4=BF=A1=E3=80=91=E5=A2=9E=E5=8A=A0=E6=89=B9?=
=?UTF-8?q?=E9=87=8F=E8=AE=BE=E7=BD=AE=E5=BA=94=E7=94=A8=E5=9C=A8=E7=94=A8?=
=?UTF-8?q?=E6=88=B7=E5=B7=A5=E4=BD=9C=E5=8F=B0=E5=B1=95=E7=A4=BA=E7=9A=84?=
=?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=9A=84=E6=8E=A5=E5=8F=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../cp/api/WxCpAgentWorkBenchService.java | 8 ++
.../impl/WxCpAgentWorkBenchServiceImpl.java | 6 ++
.../weixin/cp/bean/WxCpAgentWorkBench.java | 91 +++++++++++++++++++
.../weixin/cp/constant/WxCpApiPathConsts.java | 4 +
4 files changed, 109 insertions(+)
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpAgentWorkBenchService.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpAgentWorkBenchService.java
index c50aa2f5fc..67c57a8a88 100644
--- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpAgentWorkBenchService.java
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpAgentWorkBenchService.java
@@ -36,4 +36,12 @@ public interface WxCpAgentWorkBenchService {
* @throws WxErrorException the wx error exception
*/
void setWorkBenchData(WxCpAgentWorkBench wxCpAgentWorkBench) throws WxErrorException;
+
+ /**
+ * Batch sets work bench data.
+ *
+ * @param wxCpAgentWorkBench the wx cp agent work bench
+ * @throws WxErrorException the wx error exception
+ */
+ void batchSetWorkBenchData(WxCpAgentWorkBench wxCpAgentWorkBench) throws WxErrorException;
}
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpAgentWorkBenchServiceImpl.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpAgentWorkBenchServiceImpl.java
index bb5c191e96..b0bbb38642 100644
--- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpAgentWorkBenchServiceImpl.java
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpAgentWorkBenchServiceImpl.java
@@ -38,4 +38,10 @@ public void setWorkBenchData(WxCpAgentWorkBench wxCpAgentWorkBench) throws WxErr
final String url = String.format(this.mainService.getWxCpConfigStorage().getApiUrl(WORKBENCH_DATA_SET));
this.mainService.post(url, wxCpAgentWorkBench.toUserDataString());
}
+
+ @Override
+ public void batchSetWorkBenchData(WxCpAgentWorkBench wxCpAgentWorkBench) throws WxErrorException {
+ final String url = String.format(this.mainService.getWxCpConfigStorage().getApiUrl(WORKBENCH_BATCH_DATA_SET));
+ this.mainService.post(url, wxCpAgentWorkBench.toBatchUserDataString());
+ }
}
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpAgentWorkBench.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpAgentWorkBench.java
index e74173ee3f..6687e87612 100644
--- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpAgentWorkBench.java
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpAgentWorkBench.java
@@ -6,12 +6,14 @@
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
+import me.chanjar.weixin.common.util.json.WxGsonBuilder;
import me.chanjar.weixin.cp.bean.workbench.WorkBenchKeyData;
import me.chanjar.weixin.cp.bean.workbench.WorkBenchList;
import me.chanjar.weixin.cp.constant.WxCpConsts;
import java.io.Serializable;
import java.util.List;
+import java.util.Set;
/**
* The type Wx cp agent work bench.
@@ -33,6 +35,10 @@ public class WxCpAgentWorkBench implements Serializable {
* 用户的userid
*/
private String userId;
+ /**
+ * 用户的userIds
+ */
+ private Set userIds;
/**
* 应用id
*/
@@ -93,6 +99,20 @@ public String toUserDataString() {
return userDataObject.toString();
}
+ /**
+ * 生成批量用户数据Json字符串
+ *
+ * @return the string
+ */
+ public String toBatchUserDataString() {
+ JsonObject userDataObject = new JsonObject();
+ userDataObject.addProperty("agentid", this.agentId);
+ JsonArray useridList = WxGsonBuilder.create().toJsonTree(this.userIds).getAsJsonArray();
+ userDataObject.add("userid_list", useridList);
+ this.handleBatch(userDataObject);
+ return userDataObject.toString();
+ }
+
/**
* 处理不用类型的工作台数据
*/
@@ -152,4 +172,75 @@ private void handle(JsonObject templateObject) {
}
}
+ /**
+ * 处理不用类型的工作台数据
+ */
+ private void handleBatch(JsonObject templateObject) {
+ switch (this.getType()) {
+ case WxCpConsts.WorkBenchType.KEYDATA: {
+ JsonArray keyDataArray = new JsonArray();
+ JsonObject itemsObject = new JsonObject();
+ for (WorkBenchKeyData keyDataItem : this.keyDataList) {
+ JsonObject keyDataObject = new JsonObject();
+ keyDataObject.addProperty("key", keyDataItem.getKey());
+ keyDataObject.addProperty("data", keyDataItem.getData());
+ keyDataObject.addProperty("jump_url", keyDataItem.getJumpUrl());
+ keyDataObject.addProperty("pagepath", keyDataItem.getPagePath());
+ keyDataArray.add(keyDataObject);
+ }
+ itemsObject.add("items", keyDataArray);
+ JsonObject dataObject = new JsonObject();
+ dataObject.addProperty("type", WxCpConsts.WorkBenchType.KEYDATA);
+ dataObject.add("keydata", itemsObject);
+ templateObject.add("data", dataObject);
+ break;
+ }
+ case WxCpConsts.WorkBenchType.IMAGE: {
+ JsonObject image = new JsonObject();
+ image.addProperty("url", this.url);
+ image.addProperty("jump_url", this.jumpUrl);
+ image.addProperty("pagepath", this.pagePath);
+ JsonObject dataObject = new JsonObject();
+ dataObject.addProperty("type", WxCpConsts.WorkBenchType.IMAGE);
+ dataObject.add("image", image);
+ templateObject.add("data", dataObject);
+ break;
+ }
+ case WxCpConsts.WorkBenchType.LIST: {
+ JsonArray listArray = new JsonArray();
+ JsonObject itemsObject = new JsonObject();
+ for (WorkBenchList listItem : this.lists) {
+ JsonObject listObject = new JsonObject();
+ listObject.addProperty("title", listItem.getTitle());
+ listObject.addProperty("jump_url", listItem.getJumpUrl());
+ listObject.addProperty("pagepath", listItem.getPagePath());
+ listArray.add(listObject);
+ }
+ itemsObject.add("items", listArray);
+ JsonObject dataObject = new JsonObject();
+ dataObject.addProperty("type", WxCpConsts.WorkBenchType.LIST);
+ dataObject.add("list", itemsObject);
+ templateObject.add("data", dataObject);
+ break;
+ }
+ case WxCpConsts.WorkBenchType.WEBVIEW: {
+ JsonObject webview = new JsonObject();
+ webview.addProperty("url", this.url);
+ webview.addProperty("jump_url", this.jumpUrl);
+ webview.addProperty("pagepath", this.pagePath);
+ if (null != this.enableWebviewClick) {
+ webview.addProperty("enable_webview_click", this.enableWebviewClick);
+ }
+ JsonObject dataObject = new JsonObject();
+ dataObject.addProperty("type", WxCpConsts.WorkBenchType.WEBVIEW);
+ dataObject.add("webview", webview);
+ templateObject.add("data", dataObject);
+ break;
+ }
+ default: {
+ //do nothing
+ }
+ }
+ }
+
}
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/constant/WxCpApiPathConsts.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/constant/WxCpApiPathConsts.java
index 3aecf72120..d70f0ff4cc 100644
--- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/constant/WxCpApiPathConsts.java
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/constant/WxCpApiPathConsts.java
@@ -130,6 +130,10 @@ interface WorkBench {
* The constant WORKBENCH_DATA_SET.
*/
String WORKBENCH_DATA_SET = "/cgi-bin/agent/set_workbench_data";
+ /**
+ * The constant WORKBENCH_BATCH_DATA_SET.
+ */
+ String WORKBENCH_BATCH_DATA_SET = "/cgi-bin/agent/batch_set_workbench_data";
}
/**
From b44dd2e34758e66a0c8fbe0c740ba21f11a0d28d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=B0=88=E7=AC=91?= <2300064869@qq.com>
Date: Mon, 7 Apr 2025 07:01:35 +0000
Subject: [PATCH 073/326] =?UTF-8?q?:art:=20#3541=E3=80=90=E4=BC=81?=
=?UTF-8?q?=E4=B8=9A=E5=BE=AE=E4=BF=A1=E3=80=91=E5=A2=9E=E5=8A=A0=E8=AE=BE?=
=?UTF-8?q?=E7=BD=AEWebView=E5=9E=8B=E5=BA=94=E7=94=A8=E5=9C=A8=E7=94=A8?=
=?UTF-8?q?=E6=88=B7=E5=B7=A5=E4=BD=9C=E5=8F=B0=E5=B1=95=E7=A4=BA=E7=9A=84?=
=?UTF-8?q?=E5=8F=82=E6=95=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../weixin/cp/bean/WxCpAgentWorkBench.java | 26 ++++++++++++-------
1 file changed, 17 insertions(+), 9 deletions(-)
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpAgentWorkBench.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpAgentWorkBench.java
index 6687e87612..2a3e4448b6 100644
--- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpAgentWorkBench.java
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpAgentWorkBench.java
@@ -13,7 +13,6 @@
import java.io.Serializable;
import java.util.List;
-import java.util.Set;
/**
* The type Wx cp agent work bench.
@@ -38,7 +37,7 @@ public class WxCpAgentWorkBench implements Serializable {
/**
* 用户的userIds
*/
- private Set userIds;
+ private List useridList;
/**
* 应用id
*/
@@ -64,6 +63,15 @@ public class WxCpAgentWorkBench implements Serializable {
* 参考示例:今日要闻
*/
private Boolean enableWebviewClick;
+ /**
+ * 高度。可以有两种选择:single_row与double_row。当为single_row时,高度为106px(如果隐藏标题则为147px)。
+ * 当为double_row时,高度固定为171px(如果隐藏标题则为212px)。默认值为double_row
+ */
+ private String height;
+ /**
+ * 是否要隐藏展示了应用名称的标题部分,默认值为false。
+ */
+ private Boolean hideTitle;
private List keyDataList;
@@ -107,7 +115,7 @@ public String toUserDataString() {
public String toBatchUserDataString() {
JsonObject userDataObject = new JsonObject();
userDataObject.addProperty("agentid", this.agentId);
- JsonArray useridList = WxGsonBuilder.create().toJsonTree(this.userIds).getAsJsonArray();
+ JsonArray useridList = WxGsonBuilder.create().toJsonTree(this.useridList).getAsJsonArray();
userDataObject.add("userid_list", useridList);
this.handleBatch(userDataObject);
return userDataObject.toString();
@@ -160,9 +168,9 @@ private void handle(JsonObject templateObject) {
webview.addProperty("url", this.url);
webview.addProperty("jump_url", this.jumpUrl);
webview.addProperty("pagepath", this.pagePath);
- if (null != this.enableWebviewClick) {
- webview.addProperty("enable_webview_click", this.enableWebviewClick);
- }
+ webview.addProperty("enable_webview_click", this.enableWebviewClick);
+ webview.addProperty("height", this.height);
+ webview.addProperty("hide_title", this.hideTitle);
templateObject.add("webview", webview);
break;
}
@@ -228,9 +236,9 @@ private void handleBatch(JsonObject templateObject) {
webview.addProperty("url", this.url);
webview.addProperty("jump_url", this.jumpUrl);
webview.addProperty("pagepath", this.pagePath);
- if (null != this.enableWebviewClick) {
- webview.addProperty("enable_webview_click", this.enableWebviewClick);
- }
+ webview.addProperty("enable_webview_click", this.enableWebviewClick);
+ webview.addProperty("height", this.height);
+ webview.addProperty("hide_title", this.hideTitle);
JsonObject dataObject = new JsonObject();
dataObject.addProperty("type", WxCpConsts.WorkBenchType.WEBVIEW);
dataObject.add("webview", webview);
From 373c1e65cbc3e1efcc3691728bacadd7fc7d95a7 Mon Sep 17 00:00:00 2001
From: jimmyjimmy-sw <57387749+jimmyjimmy-sw@users.noreply.github.com>
Date: Mon, 7 Apr 2025 17:47:48 +0800
Subject: [PATCH 074/326] =?UTF-8?q?:bug:=20#3522=20=E3=80=90=E5=85=AC?=
=?UTF-8?q?=E4=BC=97=E5=8F=B7=E3=80=91=E4=BF=AE=E5=A4=8DWxMpMapConfigImpl?=
=?UTF-8?q?=E9=9D=99=E6=80=81=E5=B1=9E=E6=80=A7=E5=AD=98=E5=82=A8token?=
=?UTF-8?q?=E5=AF=BC=E8=87=B4=E5=A4=9A=E4=B8=AA=E5=AE=9E=E4=BE=8B=E6=97=B6?=
=?UTF-8?q?=E5=87=BA=E7=8E=B0token=E6=B2=A1=E6=9C=89=E9=9A=94=E7=A6=BB?=
=?UTF-8?q?=E7=9A=84=E6=83=85=E5=86=B5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../mp/config/impl/WxMpMapConfigImpl.java | 2 +-
.../mp/api/impl/WxMpMapConfigImplTest.java | 58 +++++++++++++++++++
2 files changed, 59 insertions(+), 1 deletion(-)
create mode 100644 weixin-java-mp/src/test/java/me/chanjar/weixin/mp/api/impl/WxMpMapConfigImplTest.java
diff --git a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/config/impl/WxMpMapConfigImpl.java b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/config/impl/WxMpMapConfigImpl.java
index cd701d1efc..72e6e615f7 100644
--- a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/config/impl/WxMpMapConfigImpl.java
+++ b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/config/impl/WxMpMapConfigImpl.java
@@ -15,7 +15,7 @@ public class WxMpMapConfigImpl extends WxMpDefaultConfigImpl {
private static final long serialVersionUID = 5311395137835650104L;
- private static final ConcurrentHashMap CONCURRENT_HASH_MAP = new ConcurrentHashMap<>(1);
+ private final ConcurrentHashMap CONCURRENT_HASH_MAP = new ConcurrentHashMap<>(1);
private static final String MAP_KEY = "access_token";
diff --git a/weixin-java-mp/src/test/java/me/chanjar/weixin/mp/api/impl/WxMpMapConfigImplTest.java b/weixin-java-mp/src/test/java/me/chanjar/weixin/mp/api/impl/WxMpMapConfigImplTest.java
new file mode 100644
index 0000000000..167c0e019c
--- /dev/null
+++ b/weixin-java-mp/src/test/java/me/chanjar/weixin/mp/api/impl/WxMpMapConfigImplTest.java
@@ -0,0 +1,58 @@
+package me.chanjar.weixin.mp.api.impl;
+
+import com.google.inject.Inject;
+import me.chanjar.weixin.common.error.WxErrorException;
+import me.chanjar.weixin.mp.api.WxMpService;
+import me.chanjar.weixin.mp.api.test.ApiTestModule;
+import me.chanjar.weixin.mp.config.impl.WxMpMapConfigImpl;
+import me.chanjar.weixin.mp.util.WxMpConfigStorageHolder;
+import org.testng.annotations.Guice;
+import org.testng.annotations.Test;
+import static org.testng.Assert.assertEquals;
+
+/**
+ * 测试 ConcurrentHashMap 保存配置信息
+ * @author jimmyjimmy-sw
+ */
+@Test
+@Guice(modules = ApiTestModule.class)
+public class WxMpMapConfigImplTest {
+
+ @Inject
+ private WxMpService wxService;
+
+ /**
+ * 测试多租户保存 WxMpMapConfigImpl 到 WxMpService,切换之后能获取到租户各自AppId对应的token
+ * @throws WxErrorException
+ */
+ @Test
+ public void testAppidSwitch() throws WxErrorException {
+ // 保存租户A的配置信息,并获取token
+ WxMpMapConfigImpl configAppA = new WxMpMapConfigImpl();
+ String appidA = "APPID_A";
+ configAppA.setAppId(appidA);
+ configAppA.setSecret("APP_SECRET_A");
+ configAppA.useStableAccessToken(true);
+ String tokenA = "TOKEN_A";
+ configAppA.updateAccessToken(tokenA,60 * 60 * 1);
+ wxService.addConfigStorage(appidA, configAppA);
+ WxMpConfigStorageHolder.set(appidA);
+ assertEquals(this.wxService.getAccessToken(),tokenA);
+
+ // 保存租户B的配置信息,并获取token
+ WxMpMapConfigImpl configAppB = new WxMpMapConfigImpl();
+ String appidB = "APPID_B";
+ configAppB.setAppId(appidB);
+ configAppB.setSecret("APP_SECRET_B");
+ configAppB.useStableAccessToken(true);
+ String tokenB = "TOKEN_B";
+ configAppB.updateAccessToken(tokenB,60 * 60 * 1);
+ wxService.addConfigStorage(appidB, configAppB);
+ WxMpConfigStorageHolder.set(appidB);
+ assertEquals(this.wxService.getAccessToken(),tokenB);
+
+ // 上下文切换到租户A 获取租户A的token
+ WxMpConfigStorageHolder.set(appidA);
+ assertEquals(this.wxService.getAccessToken(),tokenA);
+ }
+}
From 833ff706805770babca343f8f907608d3159fed8 Mon Sep 17 00:00:00 2001
From: zhangrongguang <123545250@qq.com>
Date: Thu, 27 Mar 2025 18:07:27 +0800
Subject: [PATCH 075/326] =?UTF-8?q?=E3=80=90=E4=BC=81=E4=B8=9A=E5=BE=AE?=
=?UTF-8?q?=E4=BF=A1=E3=80=91=E6=8E=A5=E5=BE=85=E4=BA=BA=E5=91=98=E7=AE=A1?=
=?UTF-8?q?=E7=90=86=20=E6=B7=BB=E5=8A=A0=E6=8E=A5=E5=BE=85=E4=BA=BA?=
=?UTF-8?q?=E5=91=98/=E5=88=A0=E9=99=A4=E6=8E=A5=E5=BE=85=E4=BA=BA?=
=?UTF-8?q?=E5=91=98=20=E5=A2=9E=E5=8A=A0=20department=5Fid=5Flist?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../chanjar/weixin/cp/api/WxCpKfService.java | 26 +++++++++
.../weixin/cp/api/impl/WxCpKfServiceImpl.java | 53 ++++++++++++++++---
2 files changed, 72 insertions(+), 7 deletions(-)
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpKfService.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpKfService.java
index 86b342f2fc..5a53829dc0 100644
--- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpKfService.java
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpKfService.java
@@ -75,6 +75,19 @@ public interface WxCpKfService {
*/
WxCpKfServicerOpResp addServicer(String openKfid, List userIdList) throws WxErrorException;
+ /**
+ * 接待人员管理
+ * 添加指定客服账号的接待人员,每个客服账号目前最多可添加2000个接待人员,20个部门。
+ * userid_list和department_id_list至少需要填其中一个
+ *
+ * @param openKfid 客服帐号ID
+ * @param userIdList 接待人员userid列表。第三方应用填密文userid,即open_userid 可填充个数:1 ~ 100。超过100个需分批调用。
+ * @param departmentIdList 接待人员部门id列表 可填充个数:0 ~ 20。
+ * @return 添加客服账号结果 wx cp kf servicer op resp
+ * @throws WxErrorException 异常
+ */
+ WxCpKfServicerOpResp addServicer(String openKfid, List userIdList,List departmentIdList) throws WxErrorException;
+
/**
* 接待人员管理
* 从客服帐号删除接待人员
@@ -86,6 +99,19 @@ public interface WxCpKfService {
*/
WxCpKfServicerOpResp delServicer(String openKfid, List userIdList) throws WxErrorException;
+ /**
+ * 接待人员管理
+ * 从客服帐号删除接待人员
+ * userid_list和department_id_list至少需要填其中一个
+ *
+ * @param openKfid 客服帐号ID
+ * @param userIdList 接待人员userid列表。第三方应用填密文userid,即open_userid 可填充个数:1 ~ 100。超过100个需分批调用。
+ * @param departmentIdList 接待人员部门id列表 可填充个数:0 ~ 100。超过100个需分批调用。
+ * @return 删除客服账号结果 wx cp kf servicer op resp
+ * @throws WxErrorException 异常
+ */
+ WxCpKfServicerOpResp delServicer(String openKfid, List userIdList, List departmentIdList) throws WxErrorException;
+
/**
* 接待人员管理
* 获取某个客服帐号的接待人员列表
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpKfServiceImpl.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpKfServiceImpl.java
index 29e84c516f..be4f2a5850 100644
--- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpKfServiceImpl.java
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpKfServiceImpl.java
@@ -70,23 +70,62 @@ public WxCpKfAccountLinkResp getAccountLink(WxCpKfAccountLink link) throws WxErr
@Override
public WxCpKfServicerOpResp addServicer(String openKfid, List userIdList) throws WxErrorException {
- return servicerOp(openKfid, userIdList, SERVICER_ADD);
+ return servicerOp(openKfid, userIdList, null, SERVICER_ADD);
+ }
+
+ @Override
+ public WxCpKfServicerOpResp addServicer(String openKfId, List userIdList, List departmentIdList) throws WxErrorException {
+ validateParameters(SERVICER_ADD, userIdList, departmentIdList);
+ return servicerOp(openKfId, userIdList, departmentIdList, SERVICER_ADD);
}
@Override
public WxCpKfServicerOpResp delServicer(String openKfid, List userIdList) throws WxErrorException {
- return servicerOp(openKfid, userIdList, SERVICER_DEL);
+ return servicerOp(openKfid, userIdList, null, SERVICER_DEL);
}
- private WxCpKfServicerOpResp servicerOp(String openKfid, List userIdList, String uri) throws WxErrorException {
+ @Override
+ public WxCpKfServicerOpResp delServicer(String openKfid, List userIdList, List departmentIdList) throws WxErrorException {
+ validateParameters(SERVICER_DEL, userIdList, departmentIdList);
+ return servicerOp(openKfid, userIdList, departmentIdList, SERVICER_DEL);
+ }
+
+ private void validateParameters(String uri, List userIdList, List departmentIdList) {
+ if ((userIdList == null || userIdList.isEmpty()) && (departmentIdList == null || departmentIdList.isEmpty())) {
+ throw new IllegalArgumentException("userid_list和department_id_list至少需要填其中一个");
+ }
+ if (SERVICER_DEL.equals(uri)) {
+ if (userIdList != null && userIdList.size() > 100) {
+ throw new IllegalArgumentException("可填充个数:0 ~ 100。超过100个需分批调用。");
+ }
+ if (departmentIdList != null && departmentIdList.size() > 100) {
+ throw new IllegalArgumentException("可填充个数:0 ~ 100。超过100个需分批调用。");
+ }
+ } else {
+ if (userIdList != null && userIdList.size() > 100) {
+ throw new IllegalArgumentException("可填充个数:0 ~ 100。超过100个需分批调用。");
+ }
+ if (departmentIdList != null && departmentIdList.size() > 20) {
+ throw new IllegalArgumentException("可填充个数:0 ~ 20。");
+ }
+ }
+ }
+
+ private WxCpKfServicerOpResp servicerOp(String openKfid, List userIdList, List departmentIdList, String uri) throws WxErrorException {
String url = cpService.getWxCpConfigStorage().getApiUrl(uri);
JsonObject json = new JsonObject();
json.addProperty("open_kfid", openKfid);
- JsonArray userIdArray = new JsonArray();
- userIdList.forEach(userIdArray::add);
- json.add("userid_list", userIdArray);
-
+ if (userIdList != null && !userIdList.isEmpty()) {
+ JsonArray userIdArray = new JsonArray();
+ userIdList.forEach(userIdArray::add);
+ json.add("userid_list", userIdArray);
+ }
+ if (departmentIdList != null && !departmentIdList.isEmpty()) {
+ JsonArray departmentIdArray = new JsonArray();
+ departmentIdList.forEach(departmentIdArray::add);
+ json.add("department_id_list", departmentIdArray);
+ }
String responseContent = cpService.post(url, json.toString());
return WxCpKfServicerOpResp.fromJson(responseContent);
}
From 0423e6849ddfef9bfcf90b39118145f054d7b0da Mon Sep 17 00:00:00 2001
From: Binary Wang
Date: Tue, 8 Apr 2025 08:39:24 +0800
Subject: [PATCH 076/326] =?UTF-8?q?:bookmark:=20=E5=8F=91=E5=B8=83=204.7.4?=
=?UTF-8?q?.B=20=E6=B5=8B=E8=AF=95=E7=89=88=E6=9C=AC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pom.xml | 2 +-
solon-plugins/pom.xml | 2 +-
solon-plugins/wx-java-channel-multi-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-channel-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-cp-multi-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-cp-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-miniapp-multi-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-miniapp-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-mp-multi-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-mp-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-open-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-pay-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-qidian-solon-plugin/pom.xml | 2 +-
spring-boot-starters/pom.xml | 2 +-
.../wx-java-channel-multi-spring-boot-starter/pom.xml | 2 +-
.../wx-java-channel-spring-boot-starter/pom.xml | 2 +-
.../wx-java-cp-multi-spring-boot-starter/pom.xml | 2 +-
spring-boot-starters/wx-java-cp-spring-boot-starter/pom.xml | 2 +-
.../wx-java-miniapp-multi-spring-boot-starter/pom.xml | 2 +-
.../wx-java-miniapp-spring-boot-starter/pom.xml | 2 +-
.../wx-java-mp-multi-spring-boot-starter/pom.xml | 2 +-
spring-boot-starters/wx-java-mp-spring-boot-starter/pom.xml | 2 +-
spring-boot-starters/wx-java-open-spring-boot-starter/pom.xml | 2 +-
spring-boot-starters/wx-java-pay-spring-boot-starter/pom.xml | 2 +-
spring-boot-starters/wx-java-qidian-spring-boot-starter/pom.xml | 2 +-
weixin-graal/pom.xml | 2 +-
weixin-java-channel/pom.xml | 2 +-
weixin-java-common/pom.xml | 2 +-
weixin-java-cp/pom.xml | 2 +-
weixin-java-miniapp/pom.xml | 2 +-
weixin-java-mp/pom.xml | 2 +-
weixin-java-open/pom.xml | 2 +-
weixin-java-pay/pom.xml | 2 +-
weixin-java-qidian/pom.xml | 2 +-
34 files changed, 34 insertions(+), 34 deletions(-)
diff --git a/pom.xml b/pom.xml
index 2151c117a7..5c00e66a7b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -3,7 +3,7 @@
4.0.0
com.github.binarywang
wx-java
- 4.7.3.B
+ 4.7.4.B
pom
WxJava - Weixin/Wechat Java SDK
微信开发Java SDK
diff --git a/solon-plugins/pom.xml b/solon-plugins/pom.xml
index 8dbc6b43d1..3bec9cb542 100644
--- a/solon-plugins/pom.xml
+++ b/solon-plugins/pom.xml
@@ -6,7 +6,7 @@
com.github.binarywang
wx-java
- 4.7.3.B
+ 4.7.4.B
pom
wx-java-solon-plugins
diff --git a/solon-plugins/wx-java-channel-multi-solon-plugin/pom.xml b/solon-plugins/wx-java-channel-multi-solon-plugin/pom.xml
index fc2796117c..84c14a101b 100644
--- a/solon-plugins/wx-java-channel-multi-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-channel-multi-solon-plugin/pom.xml
@@ -5,7 +5,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.7.3.B
+ 4.7.4.B
4.0.0
diff --git a/solon-plugins/wx-java-channel-solon-plugin/pom.xml b/solon-plugins/wx-java-channel-solon-plugin/pom.xml
index 83a00deace..6238a55e4b 100644
--- a/solon-plugins/wx-java-channel-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-channel-solon-plugin/pom.xml
@@ -3,7 +3,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.7.3.B
+ 4.7.4.B
4.0.0
diff --git a/solon-plugins/wx-java-cp-multi-solon-plugin/pom.xml b/solon-plugins/wx-java-cp-multi-solon-plugin/pom.xml
index 512cb41d40..742b862399 100644
--- a/solon-plugins/wx-java-cp-multi-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-cp-multi-solon-plugin/pom.xml
@@ -4,7 +4,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.7.3.B
+ 4.7.4.B
4.0.0
diff --git a/solon-plugins/wx-java-cp-solon-plugin/pom.xml b/solon-plugins/wx-java-cp-solon-plugin/pom.xml
index f147e36eee..b758ff8a5f 100644
--- a/solon-plugins/wx-java-cp-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-cp-solon-plugin/pom.xml
@@ -4,7 +4,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.7.3.B
+ 4.7.4.B
4.0.0
diff --git a/solon-plugins/wx-java-miniapp-multi-solon-plugin/pom.xml b/solon-plugins/wx-java-miniapp-multi-solon-plugin/pom.xml
index b8387c3c00..52db2699ba 100644
--- a/solon-plugins/wx-java-miniapp-multi-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-miniapp-multi-solon-plugin/pom.xml
@@ -5,7 +5,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.7.3.B
+ 4.7.4.B
4.0.0
diff --git a/solon-plugins/wx-java-miniapp-solon-plugin/pom.xml b/solon-plugins/wx-java-miniapp-solon-plugin/pom.xml
index 712e1abfb2..fd86436992 100644
--- a/solon-plugins/wx-java-miniapp-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-miniapp-solon-plugin/pom.xml
@@ -4,7 +4,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.7.3.B
+ 4.7.4.B
4.0.0
diff --git a/solon-plugins/wx-java-mp-multi-solon-plugin/pom.xml b/solon-plugins/wx-java-mp-multi-solon-plugin/pom.xml
index 39df8cfef7..4ba79c8a51 100644
--- a/solon-plugins/wx-java-mp-multi-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-mp-multi-solon-plugin/pom.xml
@@ -5,7 +5,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.7.3.B
+ 4.7.4.B
4.0.0
diff --git a/solon-plugins/wx-java-mp-solon-plugin/pom.xml b/solon-plugins/wx-java-mp-solon-plugin/pom.xml
index cd2bca716c..bea895694a 100644
--- a/solon-plugins/wx-java-mp-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-mp-solon-plugin/pom.xml
@@ -5,7 +5,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.7.3.B
+ 4.7.4.B
4.0.0
diff --git a/solon-plugins/wx-java-open-solon-plugin/pom.xml b/solon-plugins/wx-java-open-solon-plugin/pom.xml
index bbd6b39ab0..80a5df100a 100644
--- a/solon-plugins/wx-java-open-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-open-solon-plugin/pom.xml
@@ -5,7 +5,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.7.3.B
+ 4.7.4.B
4.0.0
diff --git a/solon-plugins/wx-java-pay-solon-plugin/pom.xml b/solon-plugins/wx-java-pay-solon-plugin/pom.xml
index 31698e010c..4dabbe46bc 100644
--- a/solon-plugins/wx-java-pay-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-pay-solon-plugin/pom.xml
@@ -5,7 +5,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.7.3.B
+ 4.7.4.B
4.0.0
diff --git a/solon-plugins/wx-java-qidian-solon-plugin/pom.xml b/solon-plugins/wx-java-qidian-solon-plugin/pom.xml
index 8a45c7284d..23ad77ea17 100644
--- a/solon-plugins/wx-java-qidian-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-qidian-solon-plugin/pom.xml
@@ -3,7 +3,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.7.3.B
+ 4.7.4.B
4.0.0
diff --git a/spring-boot-starters/pom.xml b/spring-boot-starters/pom.xml
index fbb85e6861..7f185f9fe0 100644
--- a/spring-boot-starters/pom.xml
+++ b/spring-boot-starters/pom.xml
@@ -6,7 +6,7 @@
com.github.binarywang
wx-java
- 4.7.3.B
+ 4.7.4.B
pom
wx-java-spring-boot-starters
diff --git a/spring-boot-starters/wx-java-channel-multi-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-channel-multi-spring-boot-starter/pom.xml
index 4018347e6c..e7faca1566 100644
--- a/spring-boot-starters/wx-java-channel-multi-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-channel-multi-spring-boot-starter/pom.xml
@@ -5,7 +5,7 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.7.3.B
+ 4.7.4.B
4.0.0
diff --git a/spring-boot-starters/wx-java-channel-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-channel-spring-boot-starter/pom.xml
index 7b9ae6ee29..360c71d1a9 100644
--- a/spring-boot-starters/wx-java-channel-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-channel-spring-boot-starter/pom.xml
@@ -3,7 +3,7 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.7.3.B
+ 4.7.4.B
4.0.0
diff --git a/spring-boot-starters/wx-java-cp-multi-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-cp-multi-spring-boot-starter/pom.xml
index 03cb191fee..a323061106 100644
--- a/spring-boot-starters/wx-java-cp-multi-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-cp-multi-spring-boot-starter/pom.xml
@@ -4,7 +4,7 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.7.3.B
+ 4.7.4.B
4.0.0
diff --git a/spring-boot-starters/wx-java-cp-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-cp-spring-boot-starter/pom.xml
index 8de92d3eed..37b185228e 100644
--- a/spring-boot-starters/wx-java-cp-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-cp-spring-boot-starter/pom.xml
@@ -4,7 +4,7 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.7.3.B
+ 4.7.4.B
4.0.0
diff --git a/spring-boot-starters/wx-java-miniapp-multi-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-miniapp-multi-spring-boot-starter/pom.xml
index 886cf8f884..5736c9dec6 100644
--- a/spring-boot-starters/wx-java-miniapp-multi-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-miniapp-multi-spring-boot-starter/pom.xml
@@ -5,7 +5,7 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.7.3.B
+ 4.7.4.B
4.0.0
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 a2f3aa7423..41f449da30 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 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.7.3.B
+ 4.7.4.B
4.0.0
diff --git a/spring-boot-starters/wx-java-mp-multi-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-mp-multi-spring-boot-starter/pom.xml
index 3f3ecc50d9..11680de01c 100644
--- a/spring-boot-starters/wx-java-mp-multi-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-mp-multi-spring-boot-starter/pom.xml
@@ -5,7 +5,7 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.7.3.B
+ 4.7.4.B
4.0.0
diff --git a/spring-boot-starters/wx-java-mp-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-mp-spring-boot-starter/pom.xml
index ab6d89e6f2..20a527eba3 100644
--- a/spring-boot-starters/wx-java-mp-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-mp-spring-boot-starter/pom.xml
@@ -5,7 +5,7 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.7.3.B
+ 4.7.4.B
4.0.0
diff --git a/spring-boot-starters/wx-java-open-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-open-spring-boot-starter/pom.xml
index cdb43685f7..95d3a99418 100644
--- a/spring-boot-starters/wx-java-open-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-open-spring-boot-starter/pom.xml
@@ -5,7 +5,7 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.7.3.B
+ 4.7.4.B
4.0.0
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 1aa1dc6f6a..9a415ef121 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 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.7.3.B
+ 4.7.4.B
4.0.0
diff --git a/spring-boot-starters/wx-java-qidian-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-qidian-spring-boot-starter/pom.xml
index c38a1d3501..795cfcbe7f 100644
--- a/spring-boot-starters/wx-java-qidian-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-qidian-spring-boot-starter/pom.xml
@@ -3,7 +3,7 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.7.3.B
+ 4.7.4.B
4.0.0
diff --git a/weixin-graal/pom.xml b/weixin-graal/pom.xml
index ab9ec8c916..323df0d869 100644
--- a/weixin-graal/pom.xml
+++ b/weixin-graal/pom.xml
@@ -6,7 +6,7 @@
com.github.binarywang
wx-java
- 4.7.3.B
+ 4.7.4.B
weixin-graal
diff --git a/weixin-java-channel/pom.xml b/weixin-java-channel/pom.xml
index 76be718a41..3264a2fe9f 100644
--- a/weixin-java-channel/pom.xml
+++ b/weixin-java-channel/pom.xml
@@ -6,7 +6,7 @@
com.github.binarywang
wx-java
- 4.7.3.B
+ 4.7.4.B
weixin-java-channel
diff --git a/weixin-java-common/pom.xml b/weixin-java-common/pom.xml
index 88e1b2c3f2..d45cc46d47 100644
--- a/weixin-java-common/pom.xml
+++ b/weixin-java-common/pom.xml
@@ -6,7 +6,7 @@
com.github.binarywang
wx-java
- 4.7.3.B
+ 4.7.4.B
weixin-java-common
diff --git a/weixin-java-cp/pom.xml b/weixin-java-cp/pom.xml
index 95d0672448..23cdd4d22a 100644
--- a/weixin-java-cp/pom.xml
+++ b/weixin-java-cp/pom.xml
@@ -7,7 +7,7 @@
com.github.binarywang
wx-java
- 4.7.3.B
+ 4.7.4.B
weixin-java-cp
diff --git a/weixin-java-miniapp/pom.xml b/weixin-java-miniapp/pom.xml
index 500add0e40..3c5c3fd957 100644
--- a/weixin-java-miniapp/pom.xml
+++ b/weixin-java-miniapp/pom.xml
@@ -7,7 +7,7 @@
com.github.binarywang
wx-java
- 4.7.3.B
+ 4.7.4.B
weixin-java-miniapp
diff --git a/weixin-java-mp/pom.xml b/weixin-java-mp/pom.xml
index dde82cf5dc..0b8adf0382 100644
--- a/weixin-java-mp/pom.xml
+++ b/weixin-java-mp/pom.xml
@@ -7,7 +7,7 @@
com.github.binarywang
wx-java
- 4.7.3.B
+ 4.7.4.B
weixin-java-mp
diff --git a/weixin-java-open/pom.xml b/weixin-java-open/pom.xml
index e940591310..d097467195 100644
--- a/weixin-java-open/pom.xml
+++ b/weixin-java-open/pom.xml
@@ -7,7 +7,7 @@
com.github.binarywang
wx-java
- 4.7.3.B
+ 4.7.4.B
weixin-java-open
diff --git a/weixin-java-pay/pom.xml b/weixin-java-pay/pom.xml
index f66456aa43..4525620d76 100644
--- a/weixin-java-pay/pom.xml
+++ b/weixin-java-pay/pom.xml
@@ -5,7 +5,7 @@
com.github.binarywang
wx-java
- 4.7.3.B
+ 4.7.4.B
4.0.0
diff --git a/weixin-java-qidian/pom.xml b/weixin-java-qidian/pom.xml
index 4e96a904b9..f7f0d9ac62 100644
--- a/weixin-java-qidian/pom.xml
+++ b/weixin-java-qidian/pom.xml
@@ -7,7 +7,7 @@
com.github.binarywang
wx-java
- 4.7.3.B
+ 4.7.4.B
weixin-java-qidian
From 89280abd004b3691a53003bca9c73675c9c1c956 Mon Sep 17 00:00:00 2001
From: Holy <34299400+holylcd@users.noreply.github.com>
Date: Mon, 14 Apr 2025 11:32:34 +0800
Subject: [PATCH 077/326] =?UTF-8?q?:art:=20=20#3547=E3=80=90=E5=BE=AE?=
=?UTF-8?q?=E4=BF=A1=E6=94=AF=E4=BB=98=E3=80=91=E4=BF=AE=E5=A4=8D=E9=AA=8C?=
=?UTF-8?q?=E8=AF=81=E5=99=A8=E6=9C=AA=E6=AD=A3=E7=A1=AE=E5=88=9D=E5=A7=8B?=
=?UTF-8?q?=E5=8C=96=E5=AF=BC=E8=87=B4=E7=9A=84v3=E8=AF=B7=E6=B1=82?=
=?UTF-8?q?=E6=9E=84=E9=80=A0=E5=BC=82=E5=B8=B8=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../wxpay/config/VerifierBuilder.java | 131 ++++++++++++++++++
.../binarywang/wxpay/config/WxPayConfig.java | 28 ++--
2 files changed, 139 insertions(+), 20 deletions(-)
create mode 100644 weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/VerifierBuilder.java
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/VerifierBuilder.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/VerifierBuilder.java
new file mode 100644
index 0000000000..c7bc14f526
--- /dev/null
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/VerifierBuilder.java
@@ -0,0 +1,131 @@
+package com.github.binarywang.wxpay.config;
+
+import com.github.binarywang.wxpay.exception.WxPayException;
+import com.github.binarywang.wxpay.v3.auth.*;
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.commons.lang3.StringUtils;
+
+import java.nio.charset.StandardCharsets;
+import java.security.PrivateKey;
+import java.security.PublicKey;
+
+/**
+ * 验证器构建.
+ *
+ * @author holy
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+class VerifierBuilder {
+ /**
+ * 构建验证器.
+ *
+ * 场景
+ *
+ * 1. 老商户号,只有平台证书,未开通公钥 (已验证)
+ * 2. 新商户号,被强制开通公钥,没有平台证书 (已验证)
+ * 3. 老商户号,有平台证书,主动开通公钥 (未验证,具备条件的朋友,可以帮忙验证下)
+ * ...
+ *
+ *
+ * @param certSerialNo c
+ * @param mchId m
+ * @param apiV3Key a
+ * @param merchantPrivateKey m
+ * @param wxPayHttpProxy w
+ * @param certAutoUpdateTime c
+ * @param payBaseUrl p
+ * @param publicKeyId p
+ * @param publicKey p
+ * @return v
+ * @throws WxPayException e
+ */
+ @SuppressWarnings("java:S107")
+ static Verifier build(
+ // 平台证书 - 依赖参数
+ String certSerialNo,
+ String mchId,
+ String apiV3Key,
+ PrivateKey merchantPrivateKey,
+ WxPayHttpProxy wxPayHttpProxy,
+ int certAutoUpdateTime,
+ String payBaseUrl,
+ // 公钥 - 依赖参数
+ String publicKeyId,
+ PublicKey publicKey
+ ) throws WxPayException {
+ Verifier certificatesVerifier = null;
+ Exception ex = null;
+
+ // 构建平台证书验证器
+ // (沿用旧逻辑)优先构建平台证书验证器,因为公钥验证器需要平台证书验证器 (见以下 .setOtherVerifier )
+ // 新商户号默认无平台证书,已确认无法构建平台证书验证器,会抛出异常;老商户号,有平台证书主动开通公钥的情况,待具备条件的朋友验证
+ // 建议公钥模式稳定后,优先构建公钥验证器,以免每次都尝试构建平台证书验证器,且失败 {@link com.github.binarywang.wxpay.v3.auth.PublicCertificateVerifier.verify}
+ if (merchantPrivateKey != null && StringUtils.isNoneBlank(certSerialNo, apiV3Key)) {
+ try {
+ certificatesVerifier = getCertificatesVerifier(
+ certSerialNo, mchId, apiV3Key, merchantPrivateKey, wxPayHttpProxy, certAutoUpdateTime, payBaseUrl
+ );
+ } catch (Exception e) {
+ ex = e;
+ }
+ }
+
+ // 构建公钥验证器
+ if (publicKey != null && StringUtils.isNotBlank(publicKeyId)) {
+ try {
+ certificatesVerifier = getPublicCertVerifier(publicKeyId, publicKey, certificatesVerifier);
+ } catch (Exception e) {
+ ex = e;
+ }
+ }
+ if (certificatesVerifier != null) {
+ return certificatesVerifier;
+ }
+
+ // 有异常时抛出
+ if (ex != null) {
+ throw new WxPayException(ex.getMessage(), ex);
+ }
+
+ // 没有证书验证器时。不确定是否抛出异常,沿用之前逻辑,返回 null
+ return null;
+ }
+
+ /**
+ * 获取证书验证器.
+ *
+ * @param certSerialNo certSerialNo
+ * @param mchId mchId
+ * @param apiV3Key apiV3Key
+ * @param merchantPrivateKey merchantPrivateKey
+ * @param wxPayHttpProxy wxPayHttpProxy
+ * @param certAutoUpdateTime certAutoUpdateTime
+ * @param payBaseUrl payBaseUrl
+ * @return verifier
+ */
+ private static AutoUpdateCertificatesVerifier getCertificatesVerifier(
+ String certSerialNo, String mchId, String apiV3Key, PrivateKey merchantPrivateKey,
+ WxPayHttpProxy wxPayHttpProxy, int certAutoUpdateTime, String payBaseUrl
+ ) {
+ return new AutoUpdateCertificatesVerifier(
+ new WxPayCredentials(mchId, new PrivateKeySigner(certSerialNo, merchantPrivateKey)),
+ apiV3Key.getBytes(StandardCharsets.UTF_8), certAutoUpdateTime,
+ payBaseUrl, wxPayHttpProxy);
+ }
+
+ /**
+ * 获取公钥验证器.
+ *
+ * @param publicKeyId id
+ * @param publicKey key
+ * @param certificatesVerifier verifier
+ * @return verifier
+ */
+ private static Verifier getPublicCertVerifier(String publicKeyId, PublicKey publicKey, Verifier certificatesVerifier) {
+ Verifier publicCertificatesVerifier = new PublicCertificateVerifier(publicKey, publicKeyId);
+ publicCertificatesVerifier.setOtherVerifier(certificatesVerifier);
+ certificatesVerifier = publicCertificatesVerifier;
+ return certificatesVerifier;
+ }
+}
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java
index 7a14ea1523..43f41e9639 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java
@@ -4,7 +4,8 @@
import com.github.binarywang.wxpay.util.HttpProxyUtils;
import com.github.binarywang.wxpay.util.ResourcesUtils;
import com.github.binarywang.wxpay.v3.WxPayV3HttpClientBuilder;
-import com.github.binarywang.wxpay.v3.auth.*;
+import com.github.binarywang.wxpay.v3.auth.Verifier;
+import com.github.binarywang.wxpay.v3.auth.WxPayValidator;
import com.github.binarywang.wxpay.v3.util.PemUtils;
import lombok.Data;
import lombok.EqualsAndHashCode;
@@ -19,7 +20,6 @@
import javax.net.ssl.SSLContext;
import java.io.*;
import java.net.URL;
-import java.nio.charset.StandardCharsets;
import java.security.KeyStore;
import java.security.PrivateKey;
import java.security.PublicKey;
@@ -320,7 +320,12 @@ public CloseableHttpClient initApiV3HttpClient() throws WxPayException {
//构造Http Proxy正向代理
WxPayHttpProxy wxPayHttpProxy = getWxPayHttpProxy();
- Verifier certificatesVerifier = getVerifier(merchantPrivateKey, wxPayHttpProxy, publicKey);
+ // 构造证书验签器
+ Verifier certificatesVerifier = VerifierBuilder.build(
+ this.getCertSerialNo(), this.getMchId(), this.getApiV3Key(), merchantPrivateKey, wxPayHttpProxy,
+ this.getCertAutoUpdateTime(), this.getPayBaseUrl(),
+ this.getPublicKeyId(), publicKey
+ );
WxPayV3HttpClientBuilder wxPayV3HttpClientBuilder = WxPayV3HttpClientBuilder.create()
.withMerchant(mchId, certSerialNo, merchantPrivateKey)
@@ -346,23 +351,6 @@ public CloseableHttpClient initApiV3HttpClient() throws WxPayException {
}
}
- private Verifier getVerifier(PrivateKey merchantPrivateKey, WxPayHttpProxy wxPayHttpProxy, PublicKey publicKey) {
- Verifier certificatesVerifier = null;
- // 如果配置了平台证书,则初始化验证器以备v2版本接口验签(公钥灰度实现)
- if (this.getPrivateCertPath() != null && this.getPrivateKeyPath() != null) {
- certificatesVerifier = new AutoUpdateCertificatesVerifier(
- new WxPayCredentials(mchId, new PrivateKeySigner(certSerialNo, merchantPrivateKey)),
- this.getApiV3Key().getBytes(StandardCharsets.UTF_8), this.getCertAutoUpdateTime(),
- this.getPayBaseUrl(), wxPayHttpProxy);
- }
- if (publicKey != null) {
- Verifier publicCertificatesVerifier = new PublicCertificateVerifier(publicKey, publicKeyId);
- publicCertificatesVerifier.setOtherVerifier(certificatesVerifier);
- certificatesVerifier = publicCertificatesVerifier;
- }
- return certificatesVerifier;
- }
-
/**
* 初始化一个WxPayHttpProxy对象
*
From e16e0e93735884472300c7e77df63e4d586ec11d Mon Sep 17 00:00:00 2001
From: HerveyHall
Date: Tue, 15 Apr 2025 15:14:12 +0800
Subject: [PATCH 078/326] =?UTF-8?q?:art:=20#3548=E3=80=90=E5=BE=AE?=
=?UTF-8?q?=E4=BF=A1=E6=94=AF=E4=BB=98=E3=80=91=E4=BF=AE=E5=A4=8D=E5=85=AC?=
=?UTF-8?q?=E9=92=A5=E6=A8=A1=E5=BC=8F=E4=B8=8BV3=E6=8E=A5=E5=8F=A3?=
=?UTF-8?q?=E6=9C=AA=E8=AE=BE=E7=BD=AEWechatpay-Serial=E8=AF=B7=E6=B1=82?=
=?UTF-8?q?=E5=A4=B4=E5=AF=BC=E8=87=B4=E7=9A=84=E9=AA=8C=E7=AD=BE=E5=A4=B1?=
=?UTF-8?q?=E8=B4=A5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../binarywang/wxpay/config/WxPayConfig.java | 5 +++
.../service/impl/BaseWxPayServiceImpl.java | 34 +++++++++----------
.../impl/WxPayServiceApacheHttpImpl.java | 3 ++
3 files changed, 25 insertions(+), 17 deletions(-)
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java
index 43f41e9639..2cfec2bc1d 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java
@@ -227,6 +227,11 @@ public class WxPayConfig {
*/
private Verifier verifier;
+ /**
+ * 是否将全部v3接口的请求都添加Wechatpay-Serial请求头,默认不添加
+ */
+ private boolean strictlyNeedWechatPaySerial = false;
+
/**
* 返回所设置的微信支付接口请求地址域名.
*
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java
index 05d1f8c22e..530609a7dd 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java
@@ -251,7 +251,7 @@ public WxPayRefundResult refundV2(WxPayRefundRequest request) throws WxPayExcept
@Override
public WxPayRefundV3Result refundV3(WxPayRefundV3Request request) throws WxPayException {
String url = String.format("%s/v3/refund/domestic/refunds", this.getPayBaseUrl());
- String response = this.postV3(url, GSON.toJson(request));
+ String response = this.postV3WithWechatpaySerial(url, GSON.toJson(request));
return GSON.fromJson(response, WxPayRefundV3Result.class);
}
@@ -294,21 +294,21 @@ public WxPayRefundQueryResult refundQueryV2(WxPayRefundQueryRequest request) thr
@Override
public WxPayRefundQueryV3Result refundQueryV3(String outRefundNo) throws WxPayException {
String url = String.format("%s/v3/refund/domestic/refunds/%s", this.getPayBaseUrl(), outRefundNo);
- String response = this.getV3(url);
+ String response = this.getV3WithWechatPaySerial(url);
return GSON.fromJson(response, WxPayRefundQueryV3Result.class);
}
@Override
public WxPayRefundQueryV3Result refundQueryV3(WxPayRefundQueryV3Request request) throws WxPayException {
String url = String.format("%s/v3/refund/domestic/refunds/%s", this.getPayBaseUrl(), request.getOutRefundNo());
- String response = this.getV3(url);
+ String response = this.getV3WithWechatPaySerial(url);
return GSON.fromJson(response, WxPayRefundQueryV3Result.class);
}
@Override
public WxPayRefundQueryV3Result refundPartnerQueryV3(WxPayRefundQueryV3Request request) throws WxPayException {
String url = String.format("%s/v3/refund/domestic/refunds/%s?sub_mchid=%s", this.getPayBaseUrl(), request.getOutRefundNo(), request.getSubMchid());
- String response = this.getV3(url);
+ String response = this.getV3WithWechatPaySerial(url);
return GSON.fromJson(response, WxPayRefundQueryV3Result.class);
}
@@ -523,7 +523,7 @@ public WxPayOrderQueryV3Result queryOrderV3(WxPayOrderQueryV3Request request) th
url = String.format("%s/v3/pay/transactions/id/%s", this.getPayBaseUrl(), request.getTransactionId());
}
String query = String.format("?mchid=%s", request.getMchid());
- String response = this.getV3(url + query);
+ String response = this.getV3WithWechatPaySerial(url + query);
return GSON.fromJson(response, WxPayOrderQueryV3Result.class);
}
@@ -548,14 +548,14 @@ public WxPayPartnerOrderQueryV3Result queryPartnerOrderV3(WxPayPartnerOrderQuery
url = String.format("%s/v3/pay/partner/transactions/id/%s", this.getPayBaseUrl(), request.getTransactionId());
}
String query = String.format("?sp_mchid=%s&sub_mchid=%s", request.getSpMchId(), request.getSubMchId());
- String response = this.getV3(url + query);
+ String response = this.getV3WithWechatPaySerial(url + query);
return GSON.fromJson(response, WxPayPartnerOrderQueryV3Result.class);
}
@Override
public CombineQueryResult queryCombine(String combineOutTradeNo) throws WxPayException {
String url = String.format("%s/v3/combine-transactions/out-trade-no/%s", this.getPayBaseUrl(), combineOutTradeNo);
- String response = this.getV3(url);
+ String response = this.getV3WithWechatPaySerial(url);
return GSON.fromJson(response, CombineQueryResult.class);
}
@@ -609,7 +609,7 @@ public void closeOrderV3(WxPayOrderCloseV3Request request) throws WxPayException
request.setMchid(this.getConfig().getMchId());
}
String url = String.format("%s/v3/pay/transactions/out-trade-no/%s/close", this.getPayBaseUrl(), request.getOutTradeNo());
- this.postV3(url, GSON.toJson(request));
+ this.postV3WithWechatpaySerial(url, GSON.toJson(request));
}
@Override
@@ -621,13 +621,13 @@ public void closePartnerOrderV3(WxPayPartnerOrderCloseV3Request request) throws
request.setSubMchId(this.getConfig().getSubMchId());
}
String url = String.format("%s/v3/pay/partner/transactions/out-trade-no/%s/close", this.getPayBaseUrl(), request.getOutTradeNo());
- this.postV3(url, GSON.toJson(request));
+ this.postV3WithWechatpaySerial(url, GSON.toJson(request));
}
@Override
public void closeCombine(CombineCloseRequest request) throws WxPayException {
String url = String.format("%s/v3/combine-transactions/out-trade-no/%s/close", this.getPayBaseUrl(), request.getCombineOutTradeNo());
- this.postV3(url, GSON.toJson(request));
+ this.postV3WithWechatpaySerial(url, GSON.toJson(request));
}
@Override
@@ -771,7 +771,7 @@ public WxPayUnifiedOrderV3Result unifiedPartnerOrderV3(TradeTypeEnum tradeType,
}
String url = this.getPayBaseUrl() + tradeType.getBasePartnerUrl();
- String response = this.postV3(url, GSON.toJson(request));
+ String response = this.postV3WithWechatpaySerial(url, GSON.toJson(request));
return GSON.fromJson(response, WxPayUnifiedOrderV3Result.class);
}
@@ -788,7 +788,7 @@ public WxPayUnifiedOrderV3Result unifiedOrderV3(TradeTypeEnum tradeType, WxPayUn
}
String url = this.getPayBaseUrl() + tradeType.getPartnerUrl();
- String response = this.postV3(url, GSON.toJson(request));
+ String response = this.postV3WithWechatpaySerial(url, GSON.toJson(request));
return GSON.fromJson(response, WxPayUnifiedOrderV3Result.class);
}
@@ -801,7 +801,7 @@ public CombineTransactionsResult combine(TradeTypeEnum tradeType, CombineTransac
request.setCombineMchid(this.getConfig().getMchId());
}
String url = this.getPayBaseUrl() + tradeType.getCombineUrl();
- String response = this.postV3(url, GSON.toJson(request));
+ String response = this.postV3WithWechatpaySerial(url, GSON.toJson(request));
return GSON.fromJson(response, CombineTransactionsResult.class);
}
@@ -1114,7 +1114,7 @@ public WxPayApplyBillV3Result applyTradeBill(WxPayApplyTradeBillV3Request reques
} else {
url = String.format("%s/v3/bill/tradebill?bill_date=%s&bill_type=%s&tar_type=%s", this.getPayBaseUrl(), request.getBillDate(), request.getBillType(), request.getTarType());
}
- String response = this.getV3(url);
+ String response = this.getV3WithWechatPaySerial(url);
return GSON.fromJson(response, WxPayApplyBillV3Result.class);
}
@@ -1126,7 +1126,7 @@ public WxPayApplyBillV3Result applyFundFlowBill(WxPayApplyFundFlowBillV3Request
} else {
url = String.format("%s/v3/bill/fundflowbill?bill_date=%s&account_type=%s&tar_type=%s", this.getPayBaseUrl(), request.getBillDate(), request.getAccountType(), request.getTarType());
}
- String response = this.getV3(url);
+ String response = this.getV3WithWechatPaySerial(url);
return GSON.fromJson(response, WxPayApplyBillV3Result.class);
}
@@ -1155,7 +1155,7 @@ public WxPayCodepayResult codepay(WxPayCodepayRequest request) throws WxPayExcep
request.setMchid(this.getConfig().getMchId());
}
String url = String.format("%s/v3/pay/transactions/codepay", this.getPayBaseUrl());
- String body = this.postV3(url, GSON.toJson(request));
+ String body = this.postV3WithWechatpaySerial(url, GSON.toJson(request));
return GSON.fromJson(body, WxPayCodepayResult.class);
}
@@ -1181,7 +1181,7 @@ public WxPayOrderReverseV3Result reverseOrderV3(WxPayOrderReverseV3Request reque
}
// 拼接参数请求路径并发送
String url = String.format("%s/v3/pay/transactions/out-trade-no/%s/reverse", this.getPayBaseUrl(), request.getOutTradeNo());
- String response = this.postV3(url, GSON.toJson(request));
+ String response = this.postV3WithWechatpaySerial(url, GSON.toJson(request));
return GSON.fromJson(response, WxPayOrderReverseV3Result.class);
}
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceApacheHttpImpl.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceApacheHttpImpl.java
index d8ba95971e..f57ff13d44 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceApacheHttpImpl.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceApacheHttpImpl.java
@@ -243,6 +243,9 @@ public String requestV3(String url, HttpRequestBase httpRequest) throws WxPayExc
@Override
public String getV3(String url) throws WxPayException {
+ if (this.getConfig().isStrictlyNeedWechatPaySerial()) {
+ return getV3WithWechatPaySerial(url);
+ }
HttpGet httpGet = new HttpGet(url);
httpGet.addHeader(ACCEPT, APPLICATION_JSON);
httpGet.addHeader(CONTENT_TYPE, APPLICATION_JSON);
From bb76db052d8e9dd7a8a2a4efc88a61b445691544 Mon Sep 17 00:00:00 2001
From: Henry Heng
Date: Tue, 15 Apr 2025 19:32:54 +0800
Subject: [PATCH 079/326] =?UTF-8?q?:art:=20#3554=E3=80=90=E4=BC=81?=
=?UTF-8?q?=E4=B8=9A=E5=BE=AE=E4=BF=A1=E3=80=91=E4=BF=AE=E5=A4=8D=E5=AE=A1?=
=?UTF-8?q?=E6=89=B9=E9=80=9A=E7=9F=A5=E8=8A=82=E7=82=B9=E8=8E=B7=E5=8F=96?=
=?UTF-8?q?=E4=B8=8D=E5=88=B0=E7=94=A8=E6=88=B7ID=E7=9A=84=E9=97=AE?=
=?UTF-8?q?=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../me/chanjar/weixin/cp/bean/message/WxCpXmlApprovalInfo.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/message/WxCpXmlApprovalInfo.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/message/WxCpXmlApprovalInfo.java
index 7193c7cf6f..997a463f9c 100644
--- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/message/WxCpXmlApprovalInfo.java
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/message/WxCpXmlApprovalInfo.java
@@ -190,7 +190,7 @@ public static class Item implements Serializable {
/**
* 分支审批人userid
*/
- @XStreamAlias("ItemUserid")
+ @XStreamAlias("ItemUserId")
@XStreamConverter(value = XStreamCDataConverter.class)
private String itemUserId;
From 3718b499a0f7f69ea432d78bc0065d4f627d598f Mon Sep 17 00:00:00 2001
From: Henry Heng
Date: Wed, 16 Apr 2025 10:43:55 +0800
Subject: [PATCH 080/326] =?UTF-8?q?:art:=20#3554=E3=80=90=E4=BC=81?=
=?UTF-8?q?=E4=B8=9A=E5=BE=AE=E4=BF=A1=E3=80=91=E4=BF=AE=E5=A4=8D=E5=AE=A1?=
=?UTF-8?q?=E6=89=B9=E9=80=9A=E7=9F=A5=E8=8A=82=E7=82=B9=E8=8E=B7=E5=8F=96?=
=?UTF-8?q?=E4=B8=8D=E5=88=B0=E7=94=A8=E6=88=B7ID=E7=9A=84=E9=97=AE?=
=?UTF-8?q?=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../me/chanjar/weixin/cp/bean/message/WxCpXmlApprovalInfo.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/message/WxCpXmlApprovalInfo.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/message/WxCpXmlApprovalInfo.java
index 997a463f9c..798a5c8b00 100644
--- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/message/WxCpXmlApprovalInfo.java
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/message/WxCpXmlApprovalInfo.java
@@ -118,7 +118,7 @@ public static class NotifyNode implements Serializable {
/**
* 抄送人userid
*/
- @XStreamAlias("ItemUserid")
+ @XStreamAlias("ItemUserId")
@XStreamConverter(value = XStreamCDataConverter.class)
private String itemUserId;
From 59f5a99fda363cb426f90f50d714a5c3d3cbe3d7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=A5=BF=E4=B8=9C?=
Date: Mon, 21 Apr 2025 09:55:13 +0800
Subject: [PATCH 081/326] =?UTF-8?q?:new:=20=E6=B7=BB=E5=8A=A0wx-java-chann?=
=?UTF-8?q?el-solon-plugin=20README.md?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
solon-plugins/pom.xml | 2 +-
.../wx-java-channel-solon-plugin/README.md | 92 +++++++++++++++++++
2 files changed, 93 insertions(+), 1 deletion(-)
create mode 100644 solon-plugins/wx-java-channel-solon-plugin/README.md
diff --git a/solon-plugins/pom.xml b/solon-plugins/pom.xml
index 3bec9cb542..8d14b4461a 100644
--- a/solon-plugins/pom.xml
+++ b/solon-plugins/pom.xml
@@ -14,7 +14,7 @@
WxJava 各个模块的 Solon Plugin
- 3.0.1
+ 3.2.0
diff --git a/solon-plugins/wx-java-channel-solon-plugin/README.md b/solon-plugins/wx-java-channel-solon-plugin/README.md
new file mode 100644
index 0000000000..a7168a8edc
--- /dev/null
+++ b/solon-plugins/wx-java-channel-solon-plugin/README.md
@@ -0,0 +1,92 @@
+# wx-java-channel-solon-plugin
+
+## 快速开始
+1. 引入依赖
+ ```xml
+
+
+ com.github.binarywang
+ wx-java-channel-solon-plugin
+ ${version}
+
+
+
+
+ redis.clients
+ jedis
+ ${jedis.version}
+
+
+
+
+ org.redisson
+ redisson
+ ${redisson.version}
+
+
+ ```
+2. 添加配置(app.properties)
+ ```properties
+ # 视频号配置(必填)
+ ## 视频号小店的appId和secret
+ wx.channel.app-id=@appId
+ wx.channel.secret=@secret
+ # 视频号配置 选填
+ ## 设置视频号小店消息服务器配置的token
+ wx.channel.token=@token
+ ## 设置视频号小店消息服务器配置的EncodingAESKey
+ wx.channel.aes-key=
+ ## 支持JSON或者XML格式,默认JSON
+ wx.channel.msg-data-format=JSON
+ ## 是否使用稳定版 Access Token
+ wx.channel.use-stable-access-token=false
+
+
+ # ConfigStorage 配置(选填)
+ ## 配置类型: memory(默认), jedis, redisson, redis_template
+ wx.channel.config-storage.type=memory
+ ## 相关redis前缀配置: wx:channel(默认)
+ wx.channel.config-storage.key-prefix=wx:channel
+ wx.channel.config-storage.redis.host=127.0.0.1
+ wx.channel.config-storage.redis.port=6379
+ wx.channel.config-storage.redis.password=123456
+
+
+ # http 客户端配置(选填)
+ ## # http客户端类型: http_client(默认)
+ wx.channel.config-storage.http-client-type=http_client
+ wx.channel.config-storage.http-proxy-host=
+ wx.channel.config-storage.http-proxy-port=
+ wx.channel.config-storage.http-proxy-username=
+ wx.channel.config-storage.http-proxy-password=
+ ## 最大重试次数,默认:5 次,如果小于 0,则为 0
+ wx.channel.config-storage.max-retry-times=5
+ ## 重试时间间隔步进,默认:1000 毫秒,如果小于 0,则为 1000
+ wx.channel.config-storage.retry-sleep-millis=1000
+ ```
+3. 自动注入的类型
+- `WxChannelService`
+- `WxChannelConfig`
+4. 使用样例
+
+```java
+import me.chanjar.weixin.channel.api.WxChannelService;
+import me.chanjar.weixin.channel.bean.shop.ShopInfoResponse;
+import me.chanjar.weixin.channel.util.JsonUtils;
+import me.chanjar.weixin.common.error.WxErrorException;
+import org.noear.solon.annotation.Inject;
+
+@Component
+public class DemoService {
+ @Inject
+ private WxChannelService wxChannelService;
+
+ public String getShopInfo() throws WxErrorException {
+ // 获取店铺基本信息
+ ShopInfoResponse response = wxChannelService.getBasicService().getShopInfo();
+ // 此处为演示,如果要返回response的结果,建议自己封装一个VO,避免直接返回response
+ return JsonUtils.encode(response);
+ }
+}
+```
+
From 6a4ed91ae2bedee4c65edf749f2de6cfd4b2a847 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=8F=8B=E4=BA=BAA?= <2330172120@qq.com>
Date: Mon, 21 Apr 2025 09:58:51 +0800
Subject: [PATCH 082/326] =?UTF-8?q?:art:=20#3558=20=E3=80=90=E4=BC=81?=
=?UTF-8?q?=E4=B8=9A=E5=BE=AE=E4=BF=A1=E3=80=91=E4=BF=AE=E5=A4=8D=E4=BC=9A?=
=?UTF-8?q?=E8=AF=9D=E5=86=85=E5=AE=B9=E5=AD=98=E6=A1=A3=E6=8E=A5=E5=8F=A3?=
=?UTF-8?q?=E8=8E=B7=E5=8F=96=E8=A7=A3=E5=AF=86=E7=9A=84=E8=81=8A=E5=A4=A9?=
=?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=97=B6=E6=96=87=E4=BB=B6=E4=BF=A1=E6=81=AF?=
=?UTF-8?q?=E8=BD=AC=E6=8D=A2=E5=87=BA=E9=94=99=E7=9A=84=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../java/me/chanjar/weixin/cp/bean/msgaudit/WxCpChatModel.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/msgaudit/WxCpChatModel.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/msgaudit/WxCpChatModel.java
index 8a9d2130d6..c88cb7b9be 100644
--- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/msgaudit/WxCpChatModel.java
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/msgaudit/WxCpChatModel.java
@@ -603,7 +603,7 @@ public static class File implements Serializable {
private String sdkFileId;
@SerializedName("filesize")
- private Integer fileSize;
+ private Long fileSize;
/**
* From json file.
From ddfbee25e139e7f2f50a6205803b777b1ee53ea5 Mon Sep 17 00:00:00 2001
From: giveup
Date: Mon, 21 Apr 2025 10:00:39 +0800
Subject: [PATCH 083/326] =?UTF-8?q?:bug:=20#3557=20=E3=80=90=E4=BC=81?=
=?UTF-8?q?=E4=B8=9A=E5=BE=AE=E4=BF=A1=E3=80=91=E4=BF=AE=E5=A4=8DagentId?=
=?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=B1=BB=E5=9E=8B=E4=B8=8D=E4=B8=80=E8=87=B4?=
=?UTF-8?q?=E5=AF=BC=E8=87=B4=E7=9A=84WxCpTpMessageRouterRule.test()?=
=?UTF-8?q?=E6=96=B9=E6=B3=95=E5=8C=B9=E9=85=8D=E5=A4=B1=E8=B4=A5=E7=9A=84?=
=?UTF-8?q?=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../me/chanjar/weixin/cp/bean/message/WxCpTpXmlMessage.java | 2 +-
.../me/chanjar/weixin/cp/bean/message/WxCpTpXmlMessageTest.java | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/message/WxCpTpXmlMessage.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/message/WxCpTpXmlMessage.java
index 8b6b0689a7..e26b152daf 100644
--- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/message/WxCpTpXmlMessage.java
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/message/WxCpTpXmlMessage.java
@@ -403,7 +403,7 @@ public class WxCpTpXmlMessage implements Serializable {
* The Agent id.
*/
@XStreamAlias("AgentID")
- protected String agentID;
+ protected Integer agentID;
/**
* The Pic url.
diff --git a/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/bean/message/WxCpTpXmlMessageTest.java b/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/bean/message/WxCpTpXmlMessageTest.java
index d6cd827630..28246cf00b 100644
--- a/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/bean/message/WxCpTpXmlMessageTest.java
+++ b/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/bean/message/WxCpTpXmlMessageTest.java
@@ -152,7 +152,7 @@ public void enterAppTest() {
assertEquals(wxXmlMessage.getCreateTime(), Long.valueOf(1408091189));
assertEquals(wxXmlMessage.getEvent(), "enter_agent");
assertEquals(wxXmlMessage.getEventKey(), "");
- assertEquals(wxXmlMessage.getAgentID(), Integer.valueOf(1));
+ assertEquals(wxXmlMessage.getAgentID(), 1);
}
/**
From cbb3b24577b5d2754f96d563dfa8901fca66bc23 Mon Sep 17 00:00:00 2001
From: SynchPj <46849861+SynchPj@users.noreply.github.com>
Date: Tue, 22 Apr 2025 11:08:50 +0800
Subject: [PATCH 084/326] =?UTF-8?q?:art:=20#3553=E3=80=90=E5=BE=AE?=
=?UTF-8?q?=E4=BF=A1=E6=94=AF=E4=BB=98=E3=80=91v3=E8=AF=B7=E6=B1=82?=
=?UTF-8?q?=E7=BB=9F=E4=B8=80=E5=8A=A0=E4=B8=8AWechatpay-Serial=E8=AF=B7?=
=?UTF-8?q?=E6=B1=82=E5=A4=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../binarywang/wxpay/config/WxPayConfig.java | 4 ++--
.../impl/WxPayServiceApacheHttpImpl.java | 17 +++++++++++++++--
2 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java
index 2cfec2bc1d..75db10a070 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java
@@ -300,13 +300,13 @@ public CloseableHttpClient initApiV3HttpClient() throws WxPayException {
this.certSerialNo = certificate.getSerialNumber().toString(16).toUpperCase();
}
try {
- if (merchantPrivateKey == null) {
+ if (merchantPrivateKey == null && StringUtils.isNotBlank(this.getPrivateKeyPath())) {
try (InputStream keyInputStream = this.loadConfigInputStream(this.getPrivateKeyString(), this.getPrivateKeyPath(),
this.privateKeyContent, "privateKeyPath")) {
merchantPrivateKey = PemUtils.loadPrivateKey(keyInputStream);
}
}
- if (certificate == null && StringUtils.isBlank(this.getCertSerialNo())) {
+ if (certificate == null && StringUtils.isBlank(this.getCertSerialNo()) && StringUtils.isNotBlank(this.getPrivateCertPath())) {
try (InputStream certInputStream = this.loadConfigInputStream(this.getPrivateCertString(), this.getPrivateCertPath(),
this.privateCertContent, "privateCertPath")) {
certificate = PemUtils.loadCertificate(certInputStream);
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceApacheHttpImpl.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceApacheHttpImpl.java
index f57ff13d44..f273fe1f97 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceApacheHttpImpl.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceApacheHttpImpl.java
@@ -44,6 +44,7 @@ public class WxPayServiceApacheHttpImpl extends BaseWxPayServiceImpl {
private static final String ACCEPT = "Accept";
private static final String CONTENT_TYPE = "Content-Type";
private static final String APPLICATION_JSON = "application/json";
+ private static final String WECHATPAY_SERIAL = "Wechatpay-Serial";
@Override
public byte[] postForBytes(String url, String requestStr, boolean useKey) throws WxPayException {
@@ -101,7 +102,7 @@ public String postV3(String url, String requestStr) throws WxPayException {
httpPost.addHeader(ACCEPT, APPLICATION_JSON);
httpPost.addHeader(CONTENT_TYPE, APPLICATION_JSON);
String serialNumber = getWechatpaySerial(getConfig());
- httpPost.addHeader("Wechatpay-Serial", serialNumber);
+ httpPost.addHeader(WECHATPAY_SERIAL, serialNumber);
try (CloseableHttpResponse response = httpClient.execute(httpPost)) {
//v3已经改为通过状态码判断200 204 成功
int statusCode = response.getStatusLine().getStatusCode();
@@ -133,6 +134,8 @@ public String postV3(String url, String requestStr) throws WxPayException {
public String patchV3(String url, String requestStr) throws WxPayException {
CloseableHttpClient httpClient = this.createApiV3HttpClient();
HttpPatch httpPatch = new HttpPatch(url);
+ String serialNumber = getWechatpaySerial(getConfig());
+ httpPatch.addHeader(WECHATPAY_SERIAL, serialNumber);
httpPatch.setEntity(this.createEntry(requestStr));
httpPatch.setConfig(RequestConfig.custom()
@@ -204,6 +207,8 @@ public String postV3WithWechatpaySerial(String url, String requestStr) throws Wx
@Override
public String postV3(String url, HttpPost httpPost) throws WxPayException {
+ String serialNumber = getWechatpaySerial(getConfig());
+ httpPost.addHeader(WECHATPAY_SERIAL, serialNumber);
return this.requestV3(url, httpPost);
}
@@ -249,6 +254,8 @@ public String getV3(String url) throws WxPayException {
HttpGet httpGet = new HttpGet(url);
httpGet.addHeader(ACCEPT, APPLICATION_JSON);
httpGet.addHeader(CONTENT_TYPE, APPLICATION_JSON);
+ String serialNumber = getWechatpaySerial(getConfig());
+ httpGet.addHeader(WECHATPAY_SERIAL, serialNumber);
return this.requestV3(url, httpGet);
}
@@ -258,7 +265,7 @@ public String getV3WithWechatPaySerial(String url) throws WxPayException {
httpGet.addHeader(ACCEPT, APPLICATION_JSON);
httpGet.addHeader(CONTENT_TYPE, APPLICATION_JSON);
String serialNumber = getWechatpaySerial(getConfig());
- httpGet.addHeader("Wechatpay-Serial", serialNumber);
+ httpGet.addHeader(WECHATPAY_SERIAL, serialNumber);
return this.requestV3(url, httpGet);
}
@@ -267,6 +274,8 @@ public InputStream downloadV3(String url) throws WxPayException {
CloseableHttpClient httpClient = this.createApiV3HttpClient();
HttpGet httpGet = new WxPayV3DownloadHttpGet(url);
httpGet.addHeader(ACCEPT, ContentType.WILDCARD.getMimeType());
+ String serialNumber = getWechatpaySerial(getConfig());
+ httpGet.addHeader(WECHATPAY_SERIAL, serialNumber);
try (CloseableHttpResponse response = httpClient.execute(httpGet)) {
//v3已经改为通过状态码判断200 204 成功
int statusCode = response.getStatusLine().getStatusCode();
@@ -298,6 +307,8 @@ public String putV3(String url, String requestStr) throws WxPayException {
httpPut.setEntity(entity);
httpPut.addHeader(ACCEPT, APPLICATION_JSON);
httpPut.addHeader(CONTENT_TYPE, APPLICATION_JSON);
+ String serialNumber = getWechatpaySerial(getConfig());
+ httpPut.addHeader(WECHATPAY_SERIAL, serialNumber);
return requestV3(url, httpPut);
}
@@ -306,6 +317,8 @@ public String deleteV3(String url) throws WxPayException {
HttpDelete httpDelete = new HttpDelete(url);
httpDelete.addHeader(ACCEPT, APPLICATION_JSON);
httpDelete.addHeader(CONTENT_TYPE, APPLICATION_JSON);
+ String serialNumber = getWechatpaySerial(getConfig());
+ httpDelete.addHeader(WECHATPAY_SERIAL, serialNumber);
return requestV3(url, httpDelete);
}
From 2279105fef5f1d9a722debd75f82e8c1923eb590 Mon Sep 17 00:00:00 2001
From: Binary Wang
Date: Sat, 26 Apr 2025 11:18:56 +0800
Subject: [PATCH 085/326] =?UTF-8?q?:art=EF=BC=9A=20=E4=BC=98=E5=8C=96?=
=?UTF-8?q?=E5=BE=AE=E4=BF=A1=E6=94=AF=E4=BB=98=E8=AF=B7=E6=B1=82=E4=BB=A3?=
=?UTF-8?q?=E7=A0=81=EF=BC=8C=E6=8A=BD=E5=8F=96=E5=90=88=E5=B9=B6=E9=87=8D?=
=?UTF-8?q?=E5=A4=8D=E4=BB=A3=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../service/impl/BaseWxPayServiceImpl.java | 2 -
.../impl/WxPayServiceApacheHttpImpl.java | 152 +++++++-----------
.../impl/WxPayServiceJoddHttpImpl.java | 14 +-
3 files changed, 65 insertions(+), 103 deletions(-)
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java
index 530609a7dd..c5bab01263 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java
@@ -64,8 +64,6 @@ public abstract class BaseWxPayServiceImpl implements WxPayService {
private static final Gson GSON = new GsonBuilder().create();
- final Logger log = LoggerFactory.getLogger(this.getClass());
-
static ThreadLocal wxApiData = new ThreadLocal<>();
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceApacheHttpImpl.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceApacheHttpImpl.java
index f273fe1f97..e40c92a193 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceApacheHttpImpl.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceApacheHttpImpl.java
@@ -6,6 +6,7 @@
import com.github.binarywang.wxpay.v3.WxPayV3DownloadHttpGet;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
+import lombok.extern.slf4j.Slf4j;
import me.chanjar.weixin.common.util.json.GsonParser;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.*;
@@ -39,12 +40,13 @@
*
* @author Binary Wang
*/
+@Slf4j
public class WxPayServiceApacheHttpImpl extends BaseWxPayServiceImpl {
private static final String ACCEPT = "Accept";
private static final String CONTENT_TYPE = "Content-Type";
private static final String APPLICATION_JSON = "application/json";
- private static final String WECHATPAY_SERIAL = "Wechatpay-Serial";
+ private static final String WECHAT_PAY_SERIAL = "Wechatpay-Serial";
@Override
public byte[] postForBytes(String url, String requestStr, boolean useKey) throws WxPayException {
@@ -55,7 +57,7 @@ public byte[] postForBytes(String url, String requestStr, boolean useKey) throws
try (CloseableHttpResponse response = httpClient.execute(httpPost)) {
final byte[] bytes = EntityUtils.toByteArray(response.getEntity());
final String responseData = Base64.getEncoder().encodeToString(bytes);
- this.log.info("\n【请求地址】:{}\n【请求数据】:{}\n【响应数据(Base64编码后)】:{}", url, requestStr, responseData);
+ this.logRequestAndResponse(url, requestStr, responseData);
wxApiData.set(new WxPayApiData(url, requestStr, responseData, null));
return bytes;
}
@@ -63,7 +65,7 @@ public byte[] postForBytes(String url, String requestStr, boolean useKey) throws
httpPost.releaseConnection();
}
} catch (Exception e) {
- this.log.error("\n【请求地址】:{}\n【请求数据】:{}\n【异常信息】:{}", url, requestStr, e.getMessage());
+ this.logError( url, requestStr, e);
wxApiData.set(new WxPayApiData(url, requestStr, null, e.getMessage()));
throw new WxPayException(e.getMessage(), e);
}
@@ -77,7 +79,7 @@ public String post(String url, String requestStr, boolean useKey) throws WxPayEx
try (CloseableHttpClient httpClient = httpClientBuilder.build()) {
try (CloseableHttpResponse response = httpClient.execute(httpPost)) {
String responseString = EntityUtils.toString(response.getEntity(), StandardCharsets.UTF_8);
- this.log.info("\n【请求地址】:{}\n【请求数据】:{}\n【响应数据】:{}", url, requestStr, responseString);
+ this.logRequestAndResponse(url, requestStr, responseString);
if (this.getConfig().isIfSaveApiData()) {
wxApiData.set(new WxPayApiData(url, requestStr, responseString, null));
}
@@ -87,7 +89,7 @@ public String post(String url, String requestStr, boolean useKey) throws WxPayEx
httpPost.releaseConnection();
}
} catch (Exception e) {
- this.log.error("\n【请求地址】:{}\n【请求数据】:{}\n【异常信息】:{}", url, requestStr, e.getMessage());
+ this.logError(url, requestStr, e);
if (this.getConfig().isIfSaveApiData()) {
wxApiData.set(new WxPayApiData(url, requestStr, null, e.getMessage()));
}
@@ -97,13 +99,14 @@ public String post(String url, String requestStr, boolean useKey) throws WxPayEx
@Override
public String postV3(String url, String requestStr) throws WxPayException {
- CloseableHttpClient httpClient = this.createApiV3HttpClient();
HttpPost httpPost = this.createHttpPost(url, requestStr);
- httpPost.addHeader(ACCEPT, APPLICATION_JSON);
- httpPost.addHeader(CONTENT_TYPE, APPLICATION_JSON);
- String serialNumber = getWechatpaySerial(getConfig());
- httpPost.addHeader(WECHATPAY_SERIAL, serialNumber);
- try (CloseableHttpResponse response = httpClient.execute(httpPost)) {
+ this.configureRequest(httpPost);
+ return this.requestV3(url, requestStr, httpPost);
+ }
+
+ private String requestV3(String url, String requestStr, HttpRequestBase httpRequestBase) throws WxPayException {
+ try (CloseableHttpClient httpClient = this.createApiV3HttpClient();
+ CloseableHttpResponse response = httpClient.execute(httpRequestBase)) {
//v3已经改为通过状态码判断200 204 成功
int statusCode = response.getStatusLine().getStatusCode();
//post方法有可能会没有返回值的情况
@@ -113,7 +116,7 @@ public String postV3(String url, String requestStr) throws WxPayException {
}
if (HttpStatus.SC_OK == statusCode || HttpStatus.SC_NO_CONTENT == statusCode) {
- this.log.info("\n【请求地址】:{}\n【请求数据】:{}\n【响应数据】:{}", url, requestStr, responseString);
+ this.logRequestAndResponse(url, requestStr, responseString);
return responseString;
}
@@ -121,65 +124,26 @@ public String postV3(String url, String requestStr) throws WxPayException {
JsonObject jsonObject = GsonParser.parse(responseString);
throw convertException(jsonObject);
} catch (Exception e) {
- this.log.error("\n【请求地址】:{}\n【请求数据】:{}\n【异常信息】:{}", url, requestStr, e.getMessage());
+ this.logError(url, requestStr, e);
throw (e instanceof WxPayException) ? (WxPayException) e : new WxPayException(e.getMessage(), e);
} finally {
- httpPost.releaseConnection();
+ httpRequestBase.releaseConnection();
}
-
-
}
@Override
public String patchV3(String url, String requestStr) throws WxPayException {
- CloseableHttpClient httpClient = this.createApiV3HttpClient();
HttpPatch httpPatch = new HttpPatch(url);
- String serialNumber = getWechatpaySerial(getConfig());
- httpPatch.addHeader(WECHATPAY_SERIAL, serialNumber);
httpPatch.setEntity(this.createEntry(requestStr));
-
- httpPatch.setConfig(RequestConfig.custom()
- .setConnectionRequestTimeout(this.getConfig().getHttpConnectionTimeout())
- .setConnectTimeout(this.getConfig().getHttpConnectionTimeout())
- .setSocketTimeout(this.getConfig().getHttpTimeout())
- .build());
-
- httpPatch.addHeader(ACCEPT, APPLICATION_JSON);
- httpPatch.addHeader(CONTENT_TYPE, APPLICATION_JSON);
- try (CloseableHttpResponse response = httpClient.execute(httpPatch)) {
- //v3已经改为通过状态码判断200 204 成功
- int statusCode = response.getStatusLine().getStatusCode();
- //post方法有可能会没有返回值的情况
- String responseString = null;
- if (response.getEntity() != null) {
- responseString = EntityUtils.toString(response.getEntity(), StandardCharsets.UTF_8);
- }
-
- if (HttpStatus.SC_OK == statusCode || HttpStatus.SC_NO_CONTENT == statusCode) {
- this.log.info("\n【请求地址】:{}\n【请求数据】:{}\n【响应数据】:{}", url, requestStr, responseString);
- return responseString;
- }
-
- //有错误提示信息返回
- JsonObject jsonObject = GsonParser.parse(responseString);
- throw convertException(jsonObject);
- } catch (Exception e) {
- this.log.error("\n【请求地址】:{}\n【请求数据】:{}\n【异常信息】:{}", url, requestStr, e.getMessage());
- throw (e instanceof WxPayException) ? (WxPayException) e : new WxPayException(e.getMessage(), e);
- } finally {
- httpPatch.releaseConnection();
- }
+ return this.requestV3(url, requestStr, httpPatch);
}
@Override
public String postV3WithWechatpaySerial(String url, String requestStr) throws WxPayException {
- CloseableHttpClient httpClient = this.createApiV3HttpClient();
HttpPost httpPost = this.createHttpPost(url, requestStr);
- httpPost.addHeader(ACCEPT, APPLICATION_JSON);
- httpPost.addHeader(CONTENT_TYPE, APPLICATION_JSON);
- String serialNumber = getWechatpaySerial(getConfig());
- httpPost.addHeader("Wechatpay-Serial", serialNumber);
- try (CloseableHttpResponse response = httpClient.execute(httpPost)) {
+ this.configureRequest(httpPost);
+ try (CloseableHttpClient httpClient = this.createApiV3HttpClient();
+ CloseableHttpResponse response = httpClient.execute(httpPost)) {
//v3已经改为通过状态码判断200 204 成功
int statusCode = response.getStatusLine().getStatusCode();
String responseString = "{}";
@@ -189,7 +153,7 @@ public String postV3WithWechatpaySerial(String url, String requestStr) throws Wx
}
if (HttpStatus.SC_OK == statusCode || HttpStatus.SC_NO_CONTENT == statusCode) {
- this.log.info("\n【请求地址】:{}\n【请求数据】:{}\n【响应数据】:{}", url, requestStr, responseString);
+ this.logRequestAndResponse(url, requestStr, responseString);
return responseString;
}
@@ -197,8 +161,7 @@ public String postV3WithWechatpaySerial(String url, String requestStr) throws Wx
JsonObject jsonObject = GsonParser.parse(responseString);
throw convertException(jsonObject);
} catch (Exception e) {
- this.log.error("\n【请求地址】:{}\n【请求数据】:{}\n【异常信息】:{}", url, requestStr, e.getMessage());
- e.printStackTrace();
+ this.logError(url, requestStr, e);
throw (e instanceof WxPayException) ? (WxPayException) e : new WxPayException(e.getMessage(), e);
} finally {
httpPost.releaseConnection();
@@ -207,21 +170,17 @@ public String postV3WithWechatpaySerial(String url, String requestStr) throws Wx
@Override
public String postV3(String url, HttpPost httpPost) throws WxPayException {
- String serialNumber = getWechatpaySerial(getConfig());
- httpPost.addHeader(WECHATPAY_SERIAL, serialNumber);
+ String serialNumber = getWechatPaySerial(getConfig());
+ httpPost.addHeader(WECHAT_PAY_SERIAL, serialNumber);
return this.requestV3(url, httpPost);
}
@Override
public String requestV3(String url, HttpRequestBase httpRequest) throws WxPayException {
- httpRequest.setConfig(RequestConfig.custom()
- .setConnectionRequestTimeout(this.getConfig().getHttpConnectionTimeout())
- .setConnectTimeout(this.getConfig().getHttpConnectionTimeout())
- .setSocketTimeout(this.getConfig().getHttpTimeout())
- .build());
+ this.configureRequest(httpRequest);
- CloseableHttpClient httpClient = this.createApiV3HttpClient();
- try (CloseableHttpResponse response = httpClient.execute(httpRequest)) {
+ try (CloseableHttpClient httpClient = this.createApiV3HttpClient();
+ CloseableHttpResponse response = httpClient.execute(httpRequest)) {
//v3已经改为通过状态码判断200 204 成功
int statusCode = response.getStatusLine().getStatusCode();
//post方法有可能会没有返回值的情况
@@ -252,38 +211,30 @@ public String getV3(String url) throws WxPayException {
return getV3WithWechatPaySerial(url);
}
HttpGet httpGet = new HttpGet(url);
- httpGet.addHeader(ACCEPT, APPLICATION_JSON);
- httpGet.addHeader(CONTENT_TYPE, APPLICATION_JSON);
- String serialNumber = getWechatpaySerial(getConfig());
- httpGet.addHeader(WECHATPAY_SERIAL, serialNumber);
return this.requestV3(url, httpGet);
}
@Override
public String getV3WithWechatPaySerial(String url) throws WxPayException {
HttpGet httpGet = new HttpGet(url);
- httpGet.addHeader(ACCEPT, APPLICATION_JSON);
- httpGet.addHeader(CONTENT_TYPE, APPLICATION_JSON);
- String serialNumber = getWechatpaySerial(getConfig());
- httpGet.addHeader(WECHATPAY_SERIAL, serialNumber);
return this.requestV3(url, httpGet);
}
@Override
public InputStream downloadV3(String url) throws WxPayException {
- CloseableHttpClient httpClient = this.createApiV3HttpClient();
HttpGet httpGet = new WxPayV3DownloadHttpGet(url);
httpGet.addHeader(ACCEPT, ContentType.WILDCARD.getMimeType());
- String serialNumber = getWechatpaySerial(getConfig());
- httpGet.addHeader(WECHATPAY_SERIAL, serialNumber);
- try (CloseableHttpResponse response = httpClient.execute(httpGet)) {
+ String serialNumber = getWechatPaySerial(getConfig());
+ httpGet.addHeader(WECHAT_PAY_SERIAL, serialNumber);
+ try (CloseableHttpClient httpClient = this.createApiV3HttpClient();
+ CloseableHttpResponse response = httpClient.execute(httpGet)) {
//v3已经改为通过状态码判断200 204 成功
int statusCode = response.getStatusLine().getStatusCode();
Header contentType = response.getFirstHeader(HttpHeaders.CONTENT_TYPE);
boolean isJsonContentType = Objects.nonNull(contentType) && ContentType.APPLICATION_JSON.getMimeType()
.equals(ContentType.parse(String.valueOf(contentType.getValue())).getMimeType());
if ((HttpStatus.SC_OK == statusCode || HttpStatus.SC_NO_CONTENT == statusCode) && !isJsonContentType) {
- this.log.info("\n【请求地址】:{}\n", url);
+ log.info("\n【请求地址】:{}\n", url);
return response.getEntity().getContent();
}
@@ -293,7 +244,7 @@ public InputStream downloadV3(String url) throws WxPayException {
JsonObject jsonObject = GsonParser.parse(responseString);
throw convertException(jsonObject);
} catch (Exception e) {
- this.log.error("\n【请求地址】:{}\n【异常信息】:{}", url, e.getMessage());
+ log.error("\n【请求地址】:{}\n【异常信息】:{}", url, e.getMessage());
throw (e instanceof WxPayException) ? (WxPayException) e : new WxPayException(e.getMessage(), e);
} finally {
httpGet.releaseConnection();
@@ -305,23 +256,28 @@ public String putV3(String url, String requestStr) throws WxPayException {
HttpPut httpPut = new HttpPut(url);
StringEntity entity = this.createEntry(requestStr);
httpPut.setEntity(entity);
- httpPut.addHeader(ACCEPT, APPLICATION_JSON);
- httpPut.addHeader(CONTENT_TYPE, APPLICATION_JSON);
- String serialNumber = getWechatpaySerial(getConfig());
- httpPut.addHeader(WECHATPAY_SERIAL, serialNumber);
return requestV3(url, httpPut);
}
@Override
public String deleteV3(String url) throws WxPayException {
HttpDelete httpDelete = new HttpDelete(url);
- httpDelete.addHeader(ACCEPT, APPLICATION_JSON);
- httpDelete.addHeader(CONTENT_TYPE, APPLICATION_JSON);
- String serialNumber = getWechatpaySerial(getConfig());
- httpDelete.addHeader(WECHATPAY_SERIAL, serialNumber);
return requestV3(url, httpDelete);
}
+ private void configureRequest(HttpRequestBase request) {
+ String serialNumber = getWechatPaySerial(getConfig());
+ request.addHeader(ACCEPT, APPLICATION_JSON);
+ request.addHeader(CONTENT_TYPE, APPLICATION_JSON);
+ request.addHeader(WECHAT_PAY_SERIAL, serialNumber);
+
+ request.setConfig(RequestConfig.custom()
+ .setConnectionRequestTimeout(this.getConfig().getHttpConnectionTimeout())
+ .setConnectTimeout(this.getConfig().getHttpConnectionTimeout())
+ .setSocketTimeout(this.getConfig().getHttpTimeout())
+ .build());
+ }
+
private CloseableHttpClient createApiV3HttpClient() throws WxPayException {
CloseableHttpClient apiV3HttpClient = this.getConfig().getApiV3HttpClient();
if (null == apiV3HttpClient) {
@@ -387,7 +343,6 @@ private void initSSLContext(HttpClientBuilder httpClientBuilder) throws WxPayExc
new DefaultHostnameVerifier()));
}
-
private WxPayException convertException(JsonObject jsonObject) {
//todo 这里考虑使用新的适用于V3的异常
JsonElement codeElement = jsonObject.get("code");
@@ -401,13 +356,20 @@ private WxPayException convertException(JsonObject jsonObject) {
/**
* 兼容微信支付公钥模式
- * @param wxPayConfig
- * @return
*/
- private String getWechatpaySerial(WxPayConfig wxPayConfig) {
+ private String getWechatPaySerial(WxPayConfig wxPayConfig) {
if (StringUtils.isNotBlank(wxPayConfig.getPublicKeyId())) {
return wxPayConfig.getPublicKeyId();
}
+
return wxPayConfig.getVerifier().getValidCertificate().getSerialNumber().toString(16).toUpperCase();
}
+
+ private void logRequestAndResponse(String url, String requestStr, String responseStr) {
+ log.info("\n【请求地址】:{}\n【请求数据】:{}\n【响应数据】:{}", url, requestStr, responseStr);
+ }
+
+ private void logError(String url, String requestStr, Exception e) {
+ log.error("\n【请求地址】:{}\n【请求数据】:{}\n【异常信息】:{}", url, requestStr, e.getMessage());
+ }
}
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceJoddHttpImpl.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceJoddHttpImpl.java
index 5e6d23eac9..7c2f1e82c0 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceJoddHttpImpl.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceJoddHttpImpl.java
@@ -9,6 +9,7 @@
import jodd.http.ProxyInfo.ProxyType;
import jodd.http.net.SSLSocketHttpConnectionProvider;
import jodd.http.net.SocketHttpConnectionProvider;
+import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.methods.HttpRequestBase;
@@ -24,6 +25,7 @@
*
* @author Binary Wang
*/
+@Slf4j
public class WxPayServiceJoddHttpImpl extends BaseWxPayServiceImpl {
@Override
public byte[] postForBytes(String url, String requestStr, boolean useKey) throws WxPayException {
@@ -31,13 +33,13 @@ public byte[] postForBytes(String url, String requestStr, boolean useKey) throws
HttpRequest request = this.buildHttpRequest(url, requestStr, useKey);
byte[] responseBytes = request.send().bodyBytes();
final String responseString = Base64.getEncoder().encodeToString(responseBytes);
- this.log.info("\n【请求地址】:{}\n【请求数据】:{}\n【响应数据(Base64编码后)】:{}", url, requestStr, responseString);
+ log.info("\n【请求地址】:{}\n【请求数据】:{}\n【响应数据(Base64编码后)】:{}", url, requestStr, responseString);
if (this.getConfig().isIfSaveApiData()) {
wxApiData.set(new WxPayApiData(url, requestStr, responseString, null));
}
return responseBytes;
} catch (Exception e) {
- this.log.error("\n【请求地址】:{}\n【请求数据】:{}\n【异常信息】:{}", url, requestStr, e.getMessage());
+ log.error("\n【请求地址】:{}\n【请求数据】:{}\n【异常信息】:{}", url, requestStr, e.getMessage());
wxApiData.set(new WxPayApiData(url, requestStr, null, e.getMessage()));
throw new WxPayException(e.getMessage(), e);
}
@@ -49,13 +51,13 @@ public String post(String url, String requestStr, boolean useKey) throws WxPayEx
HttpRequest request = this.buildHttpRequest(url, requestStr, useKey);
String responseString = this.getResponseString(request.send());
- this.log.info("\n【请求地址】:{}\n【请求数据】:{}\n【响应数据】:{}", url, requestStr, responseString);
+ log.info("\n【请求地址】:{}\n【请求数据】:{}\n【响应数据】:{}", url, requestStr, responseString);
if (this.getConfig().isIfSaveApiData()) {
wxApiData.set(new WxPayApiData(url, requestStr, responseString, null));
}
return responseString;
} catch (Exception e) {
- this.log.error("\n【请求地址】:{}\n【请求数据】:{}\n【异常信息】:{}", url, requestStr, e.getMessage());
+ log.error("\n【请求地址】:{}\n【请求数据】:{}\n【异常信息】:{}", url, requestStr, e.getMessage());
wxApiData.set(new WxPayApiData(url, requestStr, null, e.getMessage()));
throw new WxPayException(e.getMessage(), e);
}
@@ -146,9 +148,9 @@ private HttpRequest buildHttpRequest(String url, String requestStr, boolean useK
private String getResponseString(HttpResponse response) throws WxPayException {
try {
- this.log.debug("【微信服务器响应头信息】:\n{}", response.toString(false));
+ log.debug("【微信服务器响应头信息】:\n{}", response.toString(false));
} catch (NullPointerException e) {
- this.log.warn("HttpResponse.toString() 居然抛出空指针异常了", e);
+ log.warn("HttpResponse.toString() 居然抛出空指针异常了", e);
}
String responseString = response.bodyText();
From 2d8d1df00e52b84bab4e4adbc6e4ed947bd4c440 Mon Sep 17 00:00:00 2001
From: imyzt
Date: Tue, 29 Apr 2025 11:29:09 +0800
Subject: [PATCH 086/326] =?UTF-8?q?:new:=20#3320=E3=80=90=E4=BC=81?=
=?UTF-8?q?=E4=B8=9A=E5=BE=AE=E4=BF=A1=E3=80=91=E5=A2=9E=E5=8A=A0=E5=BC=82?=
=?UTF-8?q?=E6=AD=A5=E4=B8=8A=E4=BC=A0=E4=B8=B4=E6=97=B6=E7=B4=A0=E6=9D=90?=
=?UTF-8?q?=E7=9B=B8=E5=85=B3=E6=8E=A5=E5=8F=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../weixin/cp/api/WxCpMediaService.java | 19 +++++
.../cp/api/impl/WxCpMediaServiceImpl.java | 28 ++++++-
.../cp/bean/media/MediaUploadByUrlReq.java | 58 +++++++++++++
.../cp/bean/media/MediaUploadByUrlResult.java | 82 +++++++++++++++++++
.../cp/bean/message/WxCpXmlMessage.java | 7 ++
.../weixin/cp/constant/WxCpApiPathConsts.java | 6 ++
.../weixin/cp/constant/WxCpConsts.java | 5 ++
.../cp/api/impl/WxCpMediaServiceImplTest.java | 36 ++++++++
.../cp/bean/message/WxCpXmlMessageTest.java | 21 +++++
9 files changed, 261 insertions(+), 1 deletion(-)
create mode 100644 weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/media/MediaUploadByUrlReq.java
create mode 100644 weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/media/MediaUploadByUrlResult.java
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpMediaService.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpMediaService.java
index 82f6db9178..e874b26f42 100644
--- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpMediaService.java
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpMediaService.java
@@ -2,6 +2,8 @@
import me.chanjar.weixin.common.bean.result.WxMediaUploadResult;
import me.chanjar.weixin.common.error.WxErrorException;
+import me.chanjar.weixin.cp.bean.media.MediaUploadByUrlReq;
+import me.chanjar.weixin.cp.bean.media.MediaUploadByUrlResult;
import java.io.File;
import java.io.IOException;
@@ -133,4 +135,21 @@ WxMediaUploadResult upload(String mediaType, String filename, String url)
* @throws WxErrorException the wx error exception
*/
String uploadImg(File file) throws WxErrorException;
+
+ /**
+ * 生成异步上传任务
+ * 跟上传临时素材拿到的media_id使用场景是不通用的,目前适配的接口如下:https://developer.work.weixin.qq.com/document/path/96488#%E4%BD%BF%E7%94%A8%E5%9C%BA%E6%99%AF%E8%AF%B4%E6%98%8E
+ * @param req 请求参数
+ * @return 返回异步任务id
+ * @throws WxErrorException the wx error exception
+ */
+ String uploadByUrl(MediaUploadByUrlReq req) throws WxErrorException;
+
+ /**
+ * 查询异步任务结果
+ * @param jobId 任务id。最长为128字节,60分钟内有效
+ * @return 返回异步任务结果
+ * @throws WxErrorException the wx error exception
+ */
+ MediaUploadByUrlResult uploadByUrl(String jobId) throws WxErrorException;
}
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpMediaServiceImpl.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpMediaServiceImpl.java
index 863dd7c1d4..427ce9d898 100644
--- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpMediaServiceImpl.java
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpMediaServiceImpl.java
@@ -1,5 +1,6 @@
package me.chanjar.weixin.cp.api.impl;
+import com.google.gson.JsonObject;
import lombok.RequiredArgsConstructor;
import me.chanjar.weixin.common.bean.result.WxMediaUploadResult;
import me.chanjar.weixin.common.error.WxErrorException;
@@ -9,8 +10,12 @@
import me.chanjar.weixin.common.util.http.InputStreamData;
import me.chanjar.weixin.common.util.http.MediaInputStreamUploadRequestExecutor;
import me.chanjar.weixin.common.util.http.MediaUploadRequestExecutor;
+import me.chanjar.weixin.common.util.json.GsonHelper;
+import me.chanjar.weixin.common.util.json.GsonParser;
import me.chanjar.weixin.cp.api.WxCpMediaService;
import me.chanjar.weixin.cp.api.WxCpService;
+import me.chanjar.weixin.cp.bean.media.MediaUploadByUrlReq;
+import me.chanjar.weixin.cp.bean.media.MediaUploadByUrlResult;
import java.io.File;
import java.io.IOException;
@@ -20,7 +25,12 @@
import java.nio.file.Files;
import java.util.UUID;
-import static me.chanjar.weixin.cp.constant.WxCpApiPathConsts.Media.*;
+import static me.chanjar.weixin.cp.constant.WxCpApiPathConsts.Media.GET_UPLOAD_BY_URL_RESULT;
+import static me.chanjar.weixin.cp.constant.WxCpApiPathConsts.Media.IMG_UPLOAD;
+import static me.chanjar.weixin.cp.constant.WxCpApiPathConsts.Media.JSSDK_MEDIA_GET;
+import static me.chanjar.weixin.cp.constant.WxCpApiPathConsts.Media.MEDIA_GET;
+import static me.chanjar.weixin.cp.constant.WxCpApiPathConsts.Media.MEDIA_UPLOAD;
+import static me.chanjar.weixin.cp.constant.WxCpApiPathConsts.Media.UPLOAD_BY_URL;
/**
*
@@ -119,4 +129,20 @@ public String uploadImg(File file) throws WxErrorException {
return this.mainService.execute(MediaUploadRequestExecutor.create(this.mainService.getRequestHttp()), url, file)
.getUrl();
}
+
+ @Override
+ public String uploadByUrl(MediaUploadByUrlReq req) throws WxErrorException {
+ final String url = this.mainService.getWxCpConfigStorage().getApiUrl(UPLOAD_BY_URL);
+ String responseContent = this.mainService.post(url, req.toJson());
+ return GsonHelper.getString(GsonParser.parse(responseContent), "jobid");
+ }
+
+ @Override
+ public MediaUploadByUrlResult uploadByUrl(String jobId) throws WxErrorException {
+ final String url = this.mainService.getWxCpConfigStorage().getApiUrl(GET_UPLOAD_BY_URL_RESULT);
+ JsonObject jsonObject = new JsonObject();
+ jsonObject.addProperty("jobid", jobId);
+ String post = this.mainService.post(url, jsonObject.toString());
+ return MediaUploadByUrlResult.fromJson(post);
+ }
}
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/media/MediaUploadByUrlReq.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/media/MediaUploadByUrlReq.java
new file mode 100644
index 0000000000..c5cb21bde5
--- /dev/null
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/media/MediaUploadByUrlReq.java
@@ -0,0 +1,58 @@
+package me.chanjar.weixin.cp.bean.media;
+
+import lombok.Data;
+import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
+
+/**
+ * 生成异步上传任务
+ * @author imyzt
+ * @date 2025/04/27
+ */
+@Data
+public class MediaUploadByUrlReq {
+
+ /**
+ * 场景值。1-客户联系入群欢迎语素材(目前仅支持1)。 注意:每个场景值有对应的使用范围,详见上面的「使用场景说明」
+ */
+ private Integer scene;
+
+ /**
+ * 媒体文件类型。目前仅支持video-视频,file-普通文件 不超过32字节。
+ */
+ private String type;
+
+ /**
+ * 文件名,标识文件展示的名称。比如,使用该media_id发消息时,展示的文件名由该字段控制。 不超过128字节。
+ */
+ private String filename;
+
+ /**
+ * 文件cdn url。url要求支持Range分块下载 不超过1024字节。 如果为腾讯云cos链接,则需要设置为「公有读」权限。
+ */
+ private String url;
+
+ /**
+ * 文件md5。对比从url下载下来的文件md5是否一致。 不超过32字节。
+ */
+ private String md5;
+
+ /**
+ * From json wx cp base resp.
+ *
+ * @param json the json
+ * @return the wx cp base resp
+ */
+ public static MediaUploadByUrlReq fromJson(String json) {
+ return WxCpGsonBuilder.create().fromJson(json, MediaUploadByUrlReq.class);
+ }
+
+ /**
+ * To json string.
+ *
+ * @return the string
+ */
+ public String toJson() {
+ return WxCpGsonBuilder.create().toJson(this);
+ }
+
+}
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/media/MediaUploadByUrlResult.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/media/MediaUploadByUrlResult.java
new file mode 100644
index 0000000000..cc931eed39
--- /dev/null
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/media/MediaUploadByUrlResult.java
@@ -0,0 +1,82 @@
+package me.chanjar.weixin.cp.bean.media;
+
+import com.google.gson.annotations.SerializedName;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import me.chanjar.weixin.cp.bean.WxCpBaseResp;
+import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
+
+import java.io.Serializable;
+
+/**
+ * 异步上传企微素材
+ * @author imyzt
+ * @date 2025/4/27
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+public class MediaUploadByUrlResult extends WxCpBaseResp implements Serializable {
+
+ private static final long serialVersionUID = 330834334738622341L;
+
+ /**
+ * 任务状态。1-处理中,2-完成,3-异常失败
+ */
+ @SerializedName("status")
+ private Integer status;
+
+ @SerializedName("detail")
+ private Detail detail;
+
+ @Data
+ public static class Detail {
+
+ /**
+ * 任务失败返回码。当status为3时返回非0,其他返回0
+ * 830001 url非法 确认url是否支持Range分块下载
+ * 830003 url下载数据失败 确认url本身是否能正常访问
+ * 45001 文件大小超过限制 确认文件在5字节~200M范围内
+ * 301019 文件MD5不匹配 确认url对应的文件内容md5,跟所填的md5参数是否一致
+ * 注意: status=2时,此处微信并未返回任何值
+ */
+ @SerializedName("errcode")
+ private Integer errCode;
+
+ /**
+ * 注意: status=2时,此处微信并未返回任何值
+ */
+ @SerializedName("errmsg")
+ private String errMsg;
+
+ /**
+ * 媒体文件上传后获取的唯一标识,3天内有效。当status为2时返回。
+ */
+ @SerializedName("media_id")
+ private String mediaId;
+
+ /**
+ * 媒体文件创建的时间戳。当status为2时返回。
+ */
+ @SerializedName("created_at")
+ private String createdAt;
+ }
+
+ /**
+ * From json wx cp media upload by url result.
+ *
+ * @param json the json
+ * @return the wx cp media upload by url result
+ */
+ public static MediaUploadByUrlResult fromJson(String json) {
+ return WxCpGsonBuilder.create().fromJson(json, MediaUploadByUrlResult.class);
+ }
+
+ /**
+ * To json string.
+ *
+ * @return the string
+ */
+ public String toJson() {
+ return WxCpGsonBuilder.create().toJson(this);
+ }
+}
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/message/WxCpXmlMessage.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/message/WxCpXmlMessage.java
index fb4213f504..81d09a11c6 100644
--- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/message/WxCpXmlMessage.java
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/message/WxCpXmlMessage.java
@@ -198,6 +198,13 @@ public class WxCpXmlMessage implements Serializable {
@XStreamAlias("SelectedItems")
private List selectedItems;
+ /**
+ * 异步任务id
+ */
+ @XStreamAlias("JobId")
+ @XStreamConverter(value = XStreamCDataConverter.class)
+ private String jobId;
+
/**
* 微信客服
* 调用拉取消息接口时,需要传此token,用于校验请求的合法性
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/constant/WxCpApiPathConsts.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/constant/WxCpApiPathConsts.java
index d70f0ff4cc..093d386e6a 100644
--- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/constant/WxCpApiPathConsts.java
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/constant/WxCpApiPathConsts.java
@@ -238,6 +238,12 @@ interface Media {
* The constant JSSDK_MEDIA_GET.
*/
String JSSDK_MEDIA_GET = "/cgi-bin/media/get/jssdk";
+
+ /** The constant GET_UPLOAD_BY_URL_RESULT. */
+ String GET_UPLOAD_BY_URL_RESULT = "/cgi-bin/media/get_upload_by_url_result";
+
+ /** The constant UPLOAD_BY_URL. */
+ String UPLOAD_BY_URL = "/cgi-bin/media/upload_by_url";
}
/**
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/constant/WxCpConsts.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/constant/WxCpConsts.java
index 606dcea6d2..3d51c9e2c9 100644
--- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/constant/WxCpConsts.java
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/constant/WxCpConsts.java
@@ -219,6 +219,11 @@ public static class EventType {
*/
public static final String CUSTOMER_ACQUISITION = "customer_acquisition";
+ /**
+ * 异步上传临时素材结果回调通知
+ */
+ public static final String UPLOAD_MEDIA_JOB_FINISH = "upload_media_job_finish";
+
}
/**
diff --git a/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/impl/WxCpMediaServiceImplTest.java b/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/impl/WxCpMediaServiceImplTest.java
index b964aad513..381a4c1454 100644
--- a/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/impl/WxCpMediaServiceImplTest.java
+++ b/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/impl/WxCpMediaServiceImplTest.java
@@ -7,6 +7,8 @@
import me.chanjar.weixin.cp.api.ApiTestModule;
import me.chanjar.weixin.cp.api.TestConstants;
import me.chanjar.weixin.cp.api.WxCpService;
+import me.chanjar.weixin.cp.bean.media.MediaUploadByUrlReq;
+import me.chanjar.weixin.cp.bean.media.MediaUploadByUrlResult;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Guice;
import org.testng.annotations.Test;
@@ -127,4 +129,38 @@ public void testGetJssdkFile() throws WxErrorException {
assertThat(file).isNotNull();
System.out.println(file);
}
+
+ /**
+ * Test upload media by url.
+ *
+ * @throws WxErrorException the wx error exception
+ */
+ @Test
+ public void testUploadMediaByUrl() throws WxErrorException {
+ MediaUploadByUrlReq req = new MediaUploadByUrlReq();
+ req.setScene(1);
+ req.setType("video");
+ req.setFilename("mov_bbb");
+ req.setUrl("https://www.w3school.com.cn/example/html5/mov_bbb.mp4");
+ req.setMd5("198918f40ecc7cab0fc4231adaf67c96");
+ String jobId = this.wxService.getMediaService().uploadByUrl(req);
+ System.out.println(jobId);
+ }
+
+ /**
+ * Test upload media by url.
+ *
+ * @throws WxErrorException the wx error exception
+ */
+ @Test
+ public void testUploadMediaByUrlResult() throws WxErrorException, InterruptedException {
+ String jobId = "job1745801375_5GIKWuFF3M7hcIkeSNMqs_W26xy5VeSWjLaLFTEdSfQ";
+ MediaUploadByUrlResult result = this.wxService.getMediaService().uploadByUrl(jobId);
+ System.out.println(result);
+ }
+
+ @Test
+ public void testUploadMediaJobFinishEvent() throws WxErrorException {
+ File file = this.wxService.getMediaService().getJssdkFile("....");
+ }
}
diff --git a/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/bean/message/WxCpXmlMessageTest.java b/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/bean/message/WxCpXmlMessageTest.java
index a760a17ff6..5bcfe9698a 100644
--- a/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/bean/message/WxCpXmlMessageTest.java
+++ b/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/bean/message/WxCpXmlMessageTest.java
@@ -6,6 +6,7 @@
import org.testng.annotations.Test;
import static me.chanjar.weixin.cp.constant.WxCpConsts.EventType.TASKCARD_CLICK;
+import static me.chanjar.weixin.cp.constant.WxCpConsts.EventType.UPLOAD_MEDIA_JOB_FINISH;
import static org.assertj.core.api.Assertions.assertThat;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNotNull;
@@ -421,4 +422,24 @@ public void testOpenApprovalChange() {
assertThat(wxCpXmlMessage.getApprovalInfo().getApprovalNodes().get(0).getItems().get(0).getItemName()).isNotEmpty();
assertThat(wxCpXmlMessage.getApprovalInfo().getNotifyNodes().get(0).getItemName()).isNotEmpty();
}
+
+ /**
+ * Test open approval change.
+ */
+ public void testUploadMediaJobFinishEvent() {
+ String xml = "\n" +
+ "\t \n" +
+ "\t \n" +
+ "\t1425284517 \n" +
+ "\t \n" +
+ "\t \n" +
+ "\t \n" +
+ " ";
+
+ WxCpXmlMessage wxCpXmlMessage = WxCpXmlMessage.fromXml(xml);
+ assertThat(wxCpXmlMessage).isNotNull();
+ assertThat(wxCpXmlMessage.getJobId()).isNotEmpty();
+ assertThat(wxCpXmlMessage.getJobId()).isEqualTo("jobid_S0MrnndvRG5fadSlLwiBqiDDbM143UqTmKP3152FZk4");
+ assertThat(wxCpXmlMessage.getEvent()).isEqualTo(UPLOAD_MEDIA_JOB_FINISH);
+ }
}
From 854b50bd5164f9cb6c77cd04e763b846ed1bf78f Mon Sep 17 00:00:00 2001
From: Binary Wang
Date: Tue, 29 Apr 2025 11:33:46 +0800
Subject: [PATCH 087/326] =?UTF-8?q?:art:=20=E4=BF=AE=E5=A4=8D=E6=97=A5?=
=?UTF-8?q?=E5=BF=97=E4=BB=A3=E7=A0=81=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java | 2 ++
.../wxpay/service/impl/WxPayServiceApacheHttpImpl.java | 4 ++--
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java
index c5bab01263..3a63f0d7fd 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java
@@ -30,6 +30,7 @@
import com.google.gson.GsonBuilder;
import lombok.Getter;
import lombok.Setter;
+import lombok.extern.slf4j.Slf4j;
import me.chanjar.weixin.common.error.WxRuntimeException;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.reflect.ConstructorUtils;
@@ -59,6 +60,7 @@
*
* @author Binary Wang
*/
+@Slf4j
public abstract class BaseWxPayServiceImpl implements WxPayService {
private static final String TOTAL_FUND_COUNT = "资金流水总笔数";
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceApacheHttpImpl.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceApacheHttpImpl.java
index e40c92a193..dcd70b5239 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceApacheHttpImpl.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceApacheHttpImpl.java
@@ -198,7 +198,7 @@ public String requestV3(String url, HttpRequestBase httpRequest) throws WxPayExc
JsonObject jsonObject = GsonParser.parse(responseString);
throw convertException(jsonObject);
} catch (Exception e) {
- this.log.error("\n【请求地址】:{}\n【异常信息】:{}", url, e.getMessage());
+ log.error("\n【请求地址】:{}\n【异常信息】:{}", url, e.getMessage());
throw (e instanceof WxPayException) ? (WxPayException) e : new WxPayException(e.getMessage(), e);
} finally {
httpRequest.releaseConnection();
@@ -344,7 +344,7 @@ private void initSSLContext(HttpClientBuilder httpClientBuilder) throws WxPayExc
}
private WxPayException convertException(JsonObject jsonObject) {
- //todo 这里考虑使用新的适用于V3的异常
+ //TODO 这里考虑使用新的适用于V3的异常
JsonElement codeElement = jsonObject.get("code");
String code = codeElement == null ? null : codeElement.getAsString();
String message = jsonObject.get("message").getAsString();
From dc674ce024bd61685d6395e25bc5387c44de9c39 Mon Sep 17 00:00:00 2001
From: Binary Wang
Date: Tue, 29 Apr 2025 12:12:34 +0800
Subject: [PATCH 088/326] =?UTF-8?q?:art:=20=E4=BC=98=E5=8C=96=E9=83=A8?=
=?UTF-8?q?=E5=88=86javadoc?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../me/chanjar/weixin/cp/api/WxCpOaService.java | 14 +++++++-------
.../weixin/cp/api/impl/WxCpOaServiceImplTest.java | 2 --
2 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpOaService.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpOaService.java
index 4647e0ed3f..ee57107b5c 100644
--- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpOaService.java
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpOaService.java
@@ -22,7 +22,7 @@ public interface WxCpOaService {
*
* 请求方式:POST(HTTPS)
* 请求地址: https://qyapi.weixin.qq.com/cgi-bin/oa/applyevent?access_token=ACCESS_TOKEN
- * 文档地址:https://work.weixin.qq.com/api/doc/90000/90135/91853
+ * 文档地址
*
*
* @param request 请求
@@ -34,7 +34,7 @@ public interface WxCpOaService {
/**
*
* 获取打卡数据
- * API doc : https://work.weixin.qq.com/api/doc#90000/90135/90262
+ * 文档地址
*
*
* @param openCheckinDataType 打卡类型。1:上下班打卡;2:外出打卡;3:全部打卡
@@ -50,7 +50,7 @@ List getCheckinData(Integer openCheckinDataType, Date startTime
/**
*
* 获取打卡规则
- * API doc : https://work.weixin.qq.com/api/doc#90000/90135/90263
+ * 文档地址
*
*
* @param datetime 需要获取规则的当天日期
@@ -64,7 +64,7 @@ List getCheckinData(Integer openCheckinDataType, Date startTime
/**
*
* 获取企业所有打卡规则
- * API doc : https://work.weixin.qq.com/api/doc/90000/90135/93384
+ * 文档地址
*
*
* @return 打卡规则列表 crop checkin option
@@ -82,7 +82,7 @@ List getCheckinData(Integer openCheckinDataType, Date startTime
*
* 一次拉取调用最多拉取100个审批记录,可以通过多次拉取的方式来满足需求,但调用频率不可超过600次/分。
*
- * API doc : https://work.weixin.qq.com/api/doc/90000/90135/91816
+ * 文档地址
*
*
* @param startTime 开始时间
@@ -121,7 +121,7 @@ WxCpApprovalInfo getApprovalInfo(@NonNull Date startTime, @NonNull Date endTime,
*
* 一次拉取调用最多拉取100个审批记录,可以通过多次拉取的方式来满足需求,但调用频率不可超过600次/分。
*
- * API doc : https://work.weixin.qq.com/api/doc/90000/90135/91816
+ * 文档地址
*
* 1 接口频率限制 600次/分钟
* 2 请求的参数endtime需要大于startime, 起始时间跨度不能超过31天;
@@ -146,7 +146,7 @@ WxCpApprovalInfo getApprovalInfo(@NonNull Date startTime, @NonNull Date endTime,
*
* 企业可通过审批应用或自建应用Secret调用本接口,根据审批单号查询企业微信“审批应用”的审批申请详情。
*
- * API Doc : https://work.weixin.qq.com/api/doc/90000/90135/91983
+ * 文档地址
*
*
* @param spNo 审批单编号。
diff --git a/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/impl/WxCpOaServiceImplTest.java b/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/impl/WxCpOaServiceImplTest.java
index a37a42ee68..0cb1e8e5e6 100644
--- a/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/impl/WxCpOaServiceImplTest.java
+++ b/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/impl/WxCpOaServiceImplTest.java
@@ -162,8 +162,6 @@ public void testGetCheckinOption() throws WxErrorException {
*/
@Test
public void testGetCropCheckinOption() throws WxErrorException {
-
- Date now = new Date();
List results = wxService.getOaService().getCropCheckinOption();
assertThat(results).isNotNull();
System.out.println("results ");
From 88a5bc4f43fcd11af64928a13652984787f5f5a4 Mon Sep 17 00:00:00 2001
From: jimson
Date: Thu, 8 May 2025 22:15:06 +0800
Subject: [PATCH 089/326] =?UTF-8?q?:art:=20=E4=BC=81=E5=BE=AE=E5=AE=A2?=
=?UTF-8?q?=E6=88=B7=E7=BE=A4=E5=9B=9E=E8=B0=83=E4=BA=8B=E4=BB=B6=E6=B7=BB?=
=?UTF-8?q?=E5=8A=A0MemChangeList=E5=AD=97=E6=AE=B5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../me/chanjar/weixin/cp/bean/message/WxCpXmlMessage.java | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/message/WxCpXmlMessage.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/message/WxCpXmlMessage.java
index 81d09a11c6..2313bcb516 100644
--- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/message/WxCpXmlMessage.java
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/message/WxCpXmlMessage.java
@@ -155,6 +155,10 @@ public class WxCpXmlMessage implements Serializable {
@XStreamConverter(value = XStreamCDataConverter.class)
private String memChangeCnt;
+ @XStreamAlias("MemChangeList")
+ @XStreamConverter(value = XStreamCDataConverter.class)
+ private String MemChangeList;
+
@XStreamAlias("Source")
@XStreamConverter(value = XStreamCDataConverter.class)
private String source;
From fb57af7409628e7e66b971671b41876bf919f64c Mon Sep 17 00:00:00 2001
From: Binary Wang
Date: Thu, 8 May 2025 23:04:32 +0800
Subject: [PATCH 090/326] =?UTF-8?q?:bookmark:=20=E5=8F=91=E5=B8=83=204.7.5?=
=?UTF-8?q?.B=20=E6=B5=8B=E8=AF=95=E7=89=88=E6=9C=AC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pom.xml | 2 +-
solon-plugins/pom.xml | 2 +-
solon-plugins/wx-java-channel-multi-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-channel-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-cp-multi-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-cp-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-miniapp-multi-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-miniapp-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-mp-multi-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-mp-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-open-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-pay-solon-plugin/pom.xml | 2 +-
solon-plugins/wx-java-qidian-solon-plugin/pom.xml | 2 +-
spring-boot-starters/pom.xml | 2 +-
.../wx-java-channel-multi-spring-boot-starter/pom.xml | 2 +-
.../wx-java-channel-spring-boot-starter/pom.xml | 2 +-
.../wx-java-cp-multi-spring-boot-starter/pom.xml | 2 +-
spring-boot-starters/wx-java-cp-spring-boot-starter/pom.xml | 2 +-
.../wx-java-miniapp-multi-spring-boot-starter/pom.xml | 2 +-
.../wx-java-miniapp-spring-boot-starter/pom.xml | 2 +-
.../wx-java-mp-multi-spring-boot-starter/pom.xml | 2 +-
spring-boot-starters/wx-java-mp-spring-boot-starter/pom.xml | 2 +-
spring-boot-starters/wx-java-open-spring-boot-starter/pom.xml | 2 +-
spring-boot-starters/wx-java-pay-spring-boot-starter/pom.xml | 2 +-
spring-boot-starters/wx-java-qidian-spring-boot-starter/pom.xml | 2 +-
weixin-graal/pom.xml | 2 +-
weixin-java-channel/pom.xml | 2 +-
weixin-java-common/pom.xml | 2 +-
weixin-java-cp/pom.xml | 2 +-
weixin-java-miniapp/pom.xml | 2 +-
weixin-java-mp/pom.xml | 2 +-
weixin-java-open/pom.xml | 2 +-
weixin-java-pay/pom.xml | 2 +-
weixin-java-qidian/pom.xml | 2 +-
34 files changed, 34 insertions(+), 34 deletions(-)
diff --git a/pom.xml b/pom.xml
index 5c00e66a7b..3c660ac656 100644
--- a/pom.xml
+++ b/pom.xml
@@ -3,7 +3,7 @@
4.0.0
com.github.binarywang
wx-java
- 4.7.4.B
+ 4.7.5.B
pom
WxJava - Weixin/Wechat Java SDK
微信开发Java SDK
diff --git a/solon-plugins/pom.xml b/solon-plugins/pom.xml
index 8d14b4461a..4270e7aaee 100644
--- a/solon-plugins/pom.xml
+++ b/solon-plugins/pom.xml
@@ -6,7 +6,7 @@
com.github.binarywang
wx-java
- 4.7.4.B
+ 4.7.5.B
pom
wx-java-solon-plugins
diff --git a/solon-plugins/wx-java-channel-multi-solon-plugin/pom.xml b/solon-plugins/wx-java-channel-multi-solon-plugin/pom.xml
index 84c14a101b..072019106e 100644
--- a/solon-plugins/wx-java-channel-multi-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-channel-multi-solon-plugin/pom.xml
@@ -5,7 +5,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.7.4.B
+ 4.7.5.B
4.0.0
diff --git a/solon-plugins/wx-java-channel-solon-plugin/pom.xml b/solon-plugins/wx-java-channel-solon-plugin/pom.xml
index 6238a55e4b..256dd4a177 100644
--- a/solon-plugins/wx-java-channel-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-channel-solon-plugin/pom.xml
@@ -3,7 +3,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.7.4.B
+ 4.7.5.B
4.0.0
diff --git a/solon-plugins/wx-java-cp-multi-solon-plugin/pom.xml b/solon-plugins/wx-java-cp-multi-solon-plugin/pom.xml
index 742b862399..eeea99b448 100644
--- a/solon-plugins/wx-java-cp-multi-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-cp-multi-solon-plugin/pom.xml
@@ -4,7 +4,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.7.4.B
+ 4.7.5.B
4.0.0
diff --git a/solon-plugins/wx-java-cp-solon-plugin/pom.xml b/solon-plugins/wx-java-cp-solon-plugin/pom.xml
index b758ff8a5f..1d12f05ac4 100644
--- a/solon-plugins/wx-java-cp-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-cp-solon-plugin/pom.xml
@@ -4,7 +4,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.7.4.B
+ 4.7.5.B
4.0.0
diff --git a/solon-plugins/wx-java-miniapp-multi-solon-plugin/pom.xml b/solon-plugins/wx-java-miniapp-multi-solon-plugin/pom.xml
index 52db2699ba..9d7b0b7282 100644
--- a/solon-plugins/wx-java-miniapp-multi-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-miniapp-multi-solon-plugin/pom.xml
@@ -5,7 +5,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.7.4.B
+ 4.7.5.B
4.0.0
diff --git a/solon-plugins/wx-java-miniapp-solon-plugin/pom.xml b/solon-plugins/wx-java-miniapp-solon-plugin/pom.xml
index fd86436992..416f842596 100644
--- a/solon-plugins/wx-java-miniapp-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-miniapp-solon-plugin/pom.xml
@@ -4,7 +4,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.7.4.B
+ 4.7.5.B
4.0.0
diff --git a/solon-plugins/wx-java-mp-multi-solon-plugin/pom.xml b/solon-plugins/wx-java-mp-multi-solon-plugin/pom.xml
index 4ba79c8a51..f01f206089 100644
--- a/solon-plugins/wx-java-mp-multi-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-mp-multi-solon-plugin/pom.xml
@@ -5,7 +5,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.7.4.B
+ 4.7.5.B
4.0.0
diff --git a/solon-plugins/wx-java-mp-solon-plugin/pom.xml b/solon-plugins/wx-java-mp-solon-plugin/pom.xml
index bea895694a..54b49d2668 100644
--- a/solon-plugins/wx-java-mp-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-mp-solon-plugin/pom.xml
@@ -5,7 +5,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.7.4.B
+ 4.7.5.B
4.0.0
diff --git a/solon-plugins/wx-java-open-solon-plugin/pom.xml b/solon-plugins/wx-java-open-solon-plugin/pom.xml
index 80a5df100a..88c035eba5 100644
--- a/solon-plugins/wx-java-open-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-open-solon-plugin/pom.xml
@@ -5,7 +5,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.7.4.B
+ 4.7.5.B
4.0.0
diff --git a/solon-plugins/wx-java-pay-solon-plugin/pom.xml b/solon-plugins/wx-java-pay-solon-plugin/pom.xml
index 4dabbe46bc..032e69a53e 100644
--- a/solon-plugins/wx-java-pay-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-pay-solon-plugin/pom.xml
@@ -5,7 +5,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.7.4.B
+ 4.7.5.B
4.0.0
diff --git a/solon-plugins/wx-java-qidian-solon-plugin/pom.xml b/solon-plugins/wx-java-qidian-solon-plugin/pom.xml
index 23ad77ea17..c3c0d322e0 100644
--- a/solon-plugins/wx-java-qidian-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-qidian-solon-plugin/pom.xml
@@ -3,7 +3,7 @@
wx-java-solon-plugins
com.github.binarywang
- 4.7.4.B
+ 4.7.5.B
4.0.0
diff --git a/spring-boot-starters/pom.xml b/spring-boot-starters/pom.xml
index 7f185f9fe0..a849cc8e40 100644
--- a/spring-boot-starters/pom.xml
+++ b/spring-boot-starters/pom.xml
@@ -6,7 +6,7 @@
com.github.binarywang
wx-java
- 4.7.4.B
+ 4.7.5.B
pom
wx-java-spring-boot-starters
diff --git a/spring-boot-starters/wx-java-channel-multi-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-channel-multi-spring-boot-starter/pom.xml
index e7faca1566..f9ffa4cacc 100644
--- a/spring-boot-starters/wx-java-channel-multi-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-channel-multi-spring-boot-starter/pom.xml
@@ -5,7 +5,7 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.7.4.B
+ 4.7.5.B
4.0.0
diff --git a/spring-boot-starters/wx-java-channel-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-channel-spring-boot-starter/pom.xml
index 360c71d1a9..8c1018d4f0 100644
--- a/spring-boot-starters/wx-java-channel-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-channel-spring-boot-starter/pom.xml
@@ -3,7 +3,7 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.7.4.B
+ 4.7.5.B
4.0.0
diff --git a/spring-boot-starters/wx-java-cp-multi-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-cp-multi-spring-boot-starter/pom.xml
index a323061106..205a39ce09 100644
--- a/spring-boot-starters/wx-java-cp-multi-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-cp-multi-spring-boot-starter/pom.xml
@@ -4,7 +4,7 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.7.4.B
+ 4.7.5.B
4.0.0
diff --git a/spring-boot-starters/wx-java-cp-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-cp-spring-boot-starter/pom.xml
index 37b185228e..f9ef3aaede 100644
--- a/spring-boot-starters/wx-java-cp-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-cp-spring-boot-starter/pom.xml
@@ -4,7 +4,7 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.7.4.B
+ 4.7.5.B
4.0.0
diff --git a/spring-boot-starters/wx-java-miniapp-multi-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-miniapp-multi-spring-boot-starter/pom.xml
index 5736c9dec6..e0e781cc65 100644
--- a/spring-boot-starters/wx-java-miniapp-multi-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-miniapp-multi-spring-boot-starter/pom.xml
@@ -5,7 +5,7 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.7.4.B
+ 4.7.5.B
4.0.0
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 41f449da30..c38db4802a 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 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.7.4.B
+ 4.7.5.B
4.0.0
diff --git a/spring-boot-starters/wx-java-mp-multi-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-mp-multi-spring-boot-starter/pom.xml
index 11680de01c..40487f9bd1 100644
--- a/spring-boot-starters/wx-java-mp-multi-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-mp-multi-spring-boot-starter/pom.xml
@@ -5,7 +5,7 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.7.4.B
+ 4.7.5.B
4.0.0
diff --git a/spring-boot-starters/wx-java-mp-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-mp-spring-boot-starter/pom.xml
index 20a527eba3..d87b662007 100644
--- a/spring-boot-starters/wx-java-mp-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-mp-spring-boot-starter/pom.xml
@@ -5,7 +5,7 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.7.4.B
+ 4.7.5.B
4.0.0
diff --git a/spring-boot-starters/wx-java-open-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-open-spring-boot-starter/pom.xml
index 95d3a99418..31c9e158b7 100644
--- a/spring-boot-starters/wx-java-open-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-open-spring-boot-starter/pom.xml
@@ -5,7 +5,7 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.7.4.B
+ 4.7.5.B
4.0.0
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 9a415ef121..91a92769c8 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 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.7.4.B
+ 4.7.5.B
4.0.0
diff --git a/spring-boot-starters/wx-java-qidian-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-qidian-spring-boot-starter/pom.xml
index 795cfcbe7f..e44dc428be 100644
--- a/spring-boot-starters/wx-java-qidian-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-qidian-spring-boot-starter/pom.xml
@@ -3,7 +3,7 @@
wx-java-spring-boot-starters
com.github.binarywang
- 4.7.4.B
+ 4.7.5.B
4.0.0
diff --git a/weixin-graal/pom.xml b/weixin-graal/pom.xml
index 323df0d869..edf9c81d56 100644
--- a/weixin-graal/pom.xml
+++ b/weixin-graal/pom.xml
@@ -6,7 +6,7 @@
com.github.binarywang
wx-java
- 4.7.4.B
+ 4.7.5.B
weixin-graal
diff --git a/weixin-java-channel/pom.xml b/weixin-java-channel/pom.xml
index 3264a2fe9f..ac1d8f4c83 100644
--- a/weixin-java-channel/pom.xml
+++ b/weixin-java-channel/pom.xml
@@ -6,7 +6,7 @@
com.github.binarywang
wx-java
- 4.7.4.B
+ 4.7.5.B
weixin-java-channel
diff --git a/weixin-java-common/pom.xml b/weixin-java-common/pom.xml
index d45cc46d47..4afef6adee 100644
--- a/weixin-java-common/pom.xml
+++ b/weixin-java-common/pom.xml
@@ -6,7 +6,7 @@
com.github.binarywang
wx-java
- 4.7.4.B
+ 4.7.5.B
weixin-java-common
diff --git a/weixin-java-cp/pom.xml b/weixin-java-cp/pom.xml
index 23cdd4d22a..4ba0471db1 100644
--- a/weixin-java-cp/pom.xml
+++ b/weixin-java-cp/pom.xml
@@ -7,7 +7,7 @@
com.github.binarywang
wx-java
- 4.7.4.B
+ 4.7.5.B
weixin-java-cp
diff --git a/weixin-java-miniapp/pom.xml b/weixin-java-miniapp/pom.xml
index 3c5c3fd957..3c3898f3f3 100644
--- a/weixin-java-miniapp/pom.xml
+++ b/weixin-java-miniapp/pom.xml
@@ -7,7 +7,7 @@
com.github.binarywang
wx-java
- 4.7.4.B
+ 4.7.5.B
weixin-java-miniapp
diff --git a/weixin-java-mp/pom.xml b/weixin-java-mp/pom.xml
index 0b8adf0382..22ec60f381 100644
--- a/weixin-java-mp/pom.xml
+++ b/weixin-java-mp/pom.xml
@@ -7,7 +7,7 @@
com.github.binarywang
wx-java
- 4.7.4.B
+ 4.7.5.B
weixin-java-mp
diff --git a/weixin-java-open/pom.xml b/weixin-java-open/pom.xml
index d097467195..1588287bc5 100644
--- a/weixin-java-open/pom.xml
+++ b/weixin-java-open/pom.xml
@@ -7,7 +7,7 @@
com.github.binarywang
wx-java
- 4.7.4.B
+ 4.7.5.B
weixin-java-open
diff --git a/weixin-java-pay/pom.xml b/weixin-java-pay/pom.xml
index 4525620d76..c396980a50 100644
--- a/weixin-java-pay/pom.xml
+++ b/weixin-java-pay/pom.xml
@@ -5,7 +5,7 @@
com.github.binarywang
wx-java
- 4.7.4.B
+ 4.7.5.B
4.0.0
diff --git a/weixin-java-qidian/pom.xml b/weixin-java-qidian/pom.xml
index f7f0d9ac62..08bdfa0af6 100644
--- a/weixin-java-qidian/pom.xml
+++ b/weixin-java-qidian/pom.xml
@@ -7,7 +7,7 @@
com.github.binarywang
wx-java
- 4.7.4.B
+ 4.7.5.B
weixin-java-qidian
From 245cf7210466d2e905d016383a948b50533ea4b8 Mon Sep 17 00:00:00 2001
From: Binary Wang
Date: Sun, 11 May 2025 20:14:43 +0800
Subject: [PATCH 091/326] =?UTF-8?q?:art:=20=E5=A2=9E=E5=8A=A0github=20acti?=
=?UTF-8?q?on=E6=9D=A5=E8=87=AA=E5=8A=A8=E5=8F=91=E5=B8=83=E7=89=88?=
=?UTF-8?q?=E6=9C=AC=E5=88=B0maven=E4=B8=AD=E5=A4=AE=E4=BB=93=E5=BA=93?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.github/workflows | 4 --
.github/workflows/maven-publish.yml | 57 +++++++++++++++++++++++++++++
pom.xml | 5 +--
3 files changed, 59 insertions(+), 7 deletions(-)
delete mode 100644 .github/workflows
create mode 100644 .github/workflows/maven-publish.yml
diff --git a/.github/workflows b/.github/workflows
deleted file mode 100644
index e420c7d44d..0000000000
--- a/.github/workflows
+++ /dev/null
@@ -1,4 +0,0 @@
-- name: Upload coverage reports to Codecov
- uses: codecov/codecov-action@v3
- env:
- CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
diff --git a/.github/workflows/maven-publish.yml b/.github/workflows/maven-publish.yml
new file mode 100644
index 0000000000..9bcd3c7471
--- /dev/null
+++ b/.github/workflows/maven-publish.yml
@@ -0,0 +1,57 @@
+name: Publish to Maven Central
+on:
+ push:
+ branches:
+ - develop
+
+jobs:
+ build-and-publish:
+ runs-on: ubuntu-latest
+
+ steps:
+ # 检出代码
+ - name: Checkout Code
+ uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+
+ # 设置所需的Java版本
+ - name: Set up Java
+ uses: actions/setup-java@v4
+ with:
+ java-version: '8'
+ distribution: 'temurin'
+ server-id: ossrh
+ server-username: MAVEN_USERNAME
+ server-password: MAVEN_PASSWORD
+ gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
+ gpg-passphrase: MAVEN_GPG_PASSPHRASE
+ cache: maven
+
+ - name: Verify GPG keys
+ run: |
+ echo "Available GPG Keys:"
+ gpg --list-secret-keys --keyid-format LONG
+
+ - name: Generate version && Set version
+ id: set_version
+ run: |
+ git describe --tags 2>/dev/null || echo "no tag"
+ TIMESTAMP=$(date +'%Y%m%d.%H%M%S')
+ GIT_DESCRIBE=$(git describe --tags --abbrev=0 2>/dev/null | sed 's/^v//' || echo "0.0.1")
+ VERSION="${GIT_DESCRIBE}-${TIMESTAMP}"
+ echo "Generated version: $VERSION"
+ mvn versions:set -DnewVersion=$VERSION --no-transfer-progress
+ env:
+ TZ: Asia/Shanghai
+
+ - name: Publish to Maven Central
+ run: |
+ mvn clean deploy -P release \
+ -Dmaven.test.skip=true \
+ -Dgpg.args="--batch --yes --pinentry-mode loopback" \
+ --no-transfer-progress
+ env:
+ MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
+ MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
+ MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
diff --git a/pom.xml b/pom.xml
index 3c660ac656..861bbbf1e3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -136,10 +136,8 @@
UTF-8
4.5.13
- 9.4.56.v20240826
-
+ 9.4.56.v20240826
-
@@ -339,6 +337,7 @@
ossrh
+ OSSRH Repository
https://oss.sonatype.org/service/local/staging/deploy/maven2/
From a051587d3efdd4b368249437a371bd7bab6ee335 Mon Sep 17 00:00:00 2001
From: Binary Wang
Date: Tue, 13 May 2025 12:43:51 +0800
Subject: [PATCH 092/326] =?UTF-8?q?:construction=5Fworker:=20=E8=87=AA?=
=?UTF-8?q?=E5=8A=A8=E6=9E=84=E5=BB=BA=E8=BF=81=E7=A7=BB=E5=88=B0maven=20c?=
=?UTF-8?q?entral=20portal?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.github/workflows/maven-publish.yml | 2 +-
pom.xml | 24 ++++++------------------
2 files changed, 7 insertions(+), 19 deletions(-)
diff --git a/.github/workflows/maven-publish.yml b/.github/workflows/maven-publish.yml
index 9bcd3c7471..c8725979c7 100644
--- a/.github/workflows/maven-publish.yml
+++ b/.github/workflows/maven-publish.yml
@@ -21,7 +21,7 @@ jobs:
with:
java-version: '8'
distribution: 'temurin'
- server-id: ossrh
+ server-id: central
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
diff --git a/pom.xml b/pom.xml
index 861bbbf1e3..48b2795f09 100644
--- a/pom.xml
+++ b/pom.xml
@@ -330,18 +330,6 @@
-
-
- ossrh
- https://oss.sonatype.org/content/repositories/snapshots
-
-
- ossrh
- OSSRH Repository
- https://oss.sonatype.org/service/local/staging/deploy/maven2/
-
-
-
doclint-java8-disable
@@ -431,14 +419,14 @@
- org.sonatype.plugins
- nexus-staging-maven-plugin
- 1.6.3
+ org.sonatype.central
+ central-publishing-maven-plugin
+ 0.7.0
true
- ossrh
- https://oss.sonatype.org/
- true
+ Release WxJava:${project.version}
+ central
+ true
From c91a5a8e22e1d66863217c3492f41e255c3d15a5 Mon Sep 17 00:00:00 2001
From: SynchPj <46849861+SynchPj@users.noreply.github.com>
Date: Tue, 13 May 2025 12:49:46 +0800
Subject: [PATCH 093/326] =?UTF-8?q?:art:=20=E3=80=90=E5=BE=AE=E4=BF=A1?=
=?UTF-8?q?=E6=94=AF=E4=BB=98=E3=80=91=E4=BF=AE=E5=A4=8D=E8=BF=9E=E6=8E=A5?=
=?UTF-8?q?=E6=B1=A0=E5=85=B3=E9=97=AD=E5=BC=82=E5=B8=B8=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../impl/WxPayServiceApacheHttpImpl.java | 21 ++++++++-----------
1 file changed, 9 insertions(+), 12 deletions(-)
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceApacheHttpImpl.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceApacheHttpImpl.java
index dcd70b5239..0e06c6c3e1 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceApacheHttpImpl.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceApacheHttpImpl.java
@@ -105,8 +105,8 @@ public String postV3(String url, String requestStr) throws WxPayException {
}
private String requestV3(String url, String requestStr, HttpRequestBase httpRequestBase) throws WxPayException {
- try (CloseableHttpClient httpClient = this.createApiV3HttpClient();
- CloseableHttpResponse response = httpClient.execute(httpRequestBase)) {
+ CloseableHttpClient httpClient = this.createApiV3HttpClient();
+ try (CloseableHttpResponse response = httpClient.execute(httpRequestBase)) {
//v3已经改为通过状态码判断200 204 成功
int statusCode = response.getStatusLine().getStatusCode();
//post方法有可能会没有返回值的情况
@@ -142,8 +142,8 @@ public String patchV3(String url, String requestStr) throws WxPayException {
public String postV3WithWechatpaySerial(String url, String requestStr) throws WxPayException {
HttpPost httpPost = this.createHttpPost(url, requestStr);
this.configureRequest(httpPost);
- try (CloseableHttpClient httpClient = this.createApiV3HttpClient();
- CloseableHttpResponse response = httpClient.execute(httpPost)) {
+ CloseableHttpClient httpClient = this.createApiV3HttpClient();
+ try (CloseableHttpResponse response = httpClient.execute(httpPost)) {
//v3已经改为通过状态码判断200 204 成功
int statusCode = response.getStatusLine().getStatusCode();
String responseString = "{}";
@@ -178,9 +178,8 @@ public String postV3(String url, HttpPost httpPost) throws WxPayException {
@Override
public String requestV3(String url, HttpRequestBase httpRequest) throws WxPayException {
this.configureRequest(httpRequest);
-
- try (CloseableHttpClient httpClient = this.createApiV3HttpClient();
- CloseableHttpResponse response = httpClient.execute(httpRequest)) {
+ CloseableHttpClient httpClient = this.createApiV3HttpClient();
+ try (CloseableHttpResponse response = httpClient.execute(httpRequest)) {
//v3已经改为通过状态码判断200 204 成功
int statusCode = response.getStatusLine().getStatusCode();
//post方法有可能会没有返回值的情况
@@ -223,11 +222,9 @@ public String getV3WithWechatPaySerial(String url) throws WxPayException {
@Override
public InputStream downloadV3(String url) throws WxPayException {
HttpGet httpGet = new WxPayV3DownloadHttpGet(url);
- httpGet.addHeader(ACCEPT, ContentType.WILDCARD.getMimeType());
- String serialNumber = getWechatPaySerial(getConfig());
- httpGet.addHeader(WECHAT_PAY_SERIAL, serialNumber);
- try (CloseableHttpClient httpClient = this.createApiV3HttpClient();
- CloseableHttpResponse response = httpClient.execute(httpGet)) {
+ this.configureRequest(httpGet);
+ CloseableHttpClient httpClient = this.createApiV3HttpClient();
+ try (CloseableHttpResponse response = httpClient.execute(httpGet)) {
//v3已经改为通过状态码判断200 204 成功
int statusCode = response.getStatusLine().getStatusCode();
Header contentType = response.getFirstHeader(HttpHeaders.CONTENT_TYPE);
From a7b007f85387bc498fbe854ee659e3c3ae14cbd3 Mon Sep 17 00:00:00 2001
From: Binary Wang
Date: Tue, 13 May 2025 13:08:24 +0800
Subject: [PATCH 094/326] =?UTF-8?q?:memo:=20=E4=BF=AE=E6=AD=A3=E7=89=88?=
=?UTF-8?q?=E6=9C=AC=E8=AF=B4=E6=98=8E=E6=96=87=E6=A1=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
README.md | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/README.md b/README.md
index e02e046b33..a7a6ac8b3a 100644
--- a/README.md
+++ b/README.md
@@ -113,10 +113,13 @@
点此展开查看
-1. 本项目定为大约每两个月发布一次正式版(同时 `develop` 分支代码合并进入 `release` 分支),版本号格式为 `X.X.0`(如`2.1.0`,`2.2.0`等),遇到重大问题需修复会及时提交新版本,欢迎大家随时提交Pull Request;
-2. BUG修复和新特性一般会先发布成小版本作为临时测试版本(如`3.6.8.B`,即尾号不为0,并添加B,以区别于正式版),代码仅存在于 `develop` 分支中;
-3. 目前最新版本号为 [](http://mvnrepository.com/artifact/com.github.binarywang/wx-java) ,也可以通过访问链接 [【微信支付】](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.github.binarywang%22%20AND%20a%3A%22weixin-java-pay%22) 、[【微信小程序】](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.github.binarywang%22%20AND%20a%3A%22weixin-java-miniapp%22) 、[【公众号】](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.github.binarywang%22%20AND%20a%3A%22weixin-java-mp%22) 、[【企业微信】](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.github.binarywang%22%20AND%20a%3A%22weixin-java-cp%22)、[【开放平台】](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.github.binarywang%22%20AND%20a%3A%22weixin-java-open%22)
-分别查看所有最新的版本。
+1. 本项目定为大约每半年左右发布一次正式版,遇到重大问题需修复会及时提交新版本,欢迎大家随时提交 `Pull Request`;
+2. 每次代码更新都会自动构建出新版本方便及时尝鲜,版本号格式为 `x.x.x-时间戳`;
+3. 发布正式版时,`develop` 分支代码合并进入 `release` 分支),版本号格式为 `X.X.0`(如`2.1.0`,`2.2.0`等);
+4. 每隔一段时间后,会发布测试版本(如`3.6.8.B`,即尾号不为0,并添加B,以区别于正式版),代码仅存在于 `develop` 分支中;
+5. 目前最新版本号为 [](http://mvnrepository.com/artifact/com.github.binarywang/wx-java) ,也可以通过访问以下链接分别查看各个模块最新的版本:
+[【微信支付】](https://central.sonatype.com/artifact/com.github.binarywang/weixin-java-pay/versions) 、[【小程序】](https://central.sonatype.com/artifact/com.github.binarywang/weixin-java-miniapp/versions) 、[【公众号】](https://central.sonatype.com/artifact/com.github.binarywang/weixin-java-mp/versions) 、[【企业微信】](https://central.sonatype.com/artifact/com.github.binarywang/weixin-java-cp/versions)、[【开放平台】](https://central.sonatype.com/artifact/com.github.binarywang/weixin-java-open/versions)、[【视频号】](https://central.sonatype.com/artifact/com.github.binarywang/weixin-java-channel/versions)
+
From 063fbb7f194e4f0fcac7fceea9f6e85065f6333e Mon Sep 17 00:00:00 2001
From: altusea <114981887+altusea@users.noreply.github.com>
Date: Tue, 13 May 2025 15:56:14 +0800
Subject: [PATCH 095/326] =?UTF-8?q?:art:=20=E5=8D=87=E7=BA=A7=E9=83=A8?=
=?UTF-8?q?=E5=88=86=E4=BE=9D=E8=B5=96=E7=89=88=E6=9C=AC=EF=BC=8C=E4=BC=98?=
=?UTF-8?q?=E5=8C=96=E4=BB=A3=E7=A0=81=EF=BC=8C=E9=83=A8=E5=88=86=E4=BB=A3?=
=?UTF-8?q?=E7=A0=81=E5=A2=9E=E5=8A=A0=E6=B3=9B=E5=9E=8B=E5=8F=82=E6=95=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pom.xml | 12 +++---
.../WxQidianStorageAutoConfiguration.java | 8 ++--
.../WxQidianStorageAutoConfiguration.java | 5 ++-
.../channel/api/BaseWxChannelService.java | 2 +-
.../api/impl/BaseWxChannelServiceImpl.java | 6 +--
.../api/impl/WxAssistantServiceImpl.java | 2 +-
.../api/impl/WxChannelAddressServiceImpl.java | 4 +-
.../impl/WxChannelAfterSaleServiceImpl.java | 4 +-
.../api/impl/WxChannelBasicServiceImpl.java | 4 +-
.../api/impl/WxChannelBrandServiceImpl.java | 4 +-
.../impl/WxChannelCategoryServiceImpl.java | 8 ++--
.../WxChannelCompassFinderServiceImpl.java | 4 +-
.../impl/WxChannelCompassShopServiceImpl.java | 4 +-
.../api/impl/WxChannelCouponServiceImpl.java | 4 +-
.../WxChannelFreightTemplateServiceImpl.java | 4 +-
.../api/impl/WxChannelFundServiceImpl.java | 4 +-
.../WxChannelLiveDashboardServiceImpl.java | 4 +-
.../api/impl/WxChannelOrderServiceImpl.java | 4 +-
.../api/impl/WxChannelProductServiceImpl.java | 4 +-
.../api/impl/WxChannelSharerServiceImpl.java | 4 +-
.../api/impl/WxChannelVipServiceImpl.java | 4 +-
.../impl/WxChannelWarehouseServiceImpl.java | 4 +-
.../api/impl/WxFinderLiveServiceImpl.java | 2 +-
.../api/impl/WxLeadComponentServiceImpl.java | 2 +-
.../api/impl/WxLeagueProductServiceImpl.java | 4 +-
.../api/impl/WxLeaguePromoterServiceImpl.java | 4 +-
.../api/impl/WxLeagueSupplierServiceImpl.java | 4 +-
.../api/impl/WxLeagueWindowServiceImpl.java | 4 +-
.../impl/WxStoreCooperationServiceImpl.java | 4 +-
.../api/impl/WxStoreHomePageServiceImpl.java | 4 +-
.../ChannelFileUploadRequestExecutor.java | 10 ++++-
.../ChannelMediaDownloadRequestExecutor.java | 11 ++++--
.../message/WxChannelMessageRouter.java | 4 +-
.../OcrDiscernApacheHttpRequestExecutor.java | 2 +-
.../ocr/OcrDiscernRequestExecutor.java | 9 +++--
.../chanjar/weixin/common/util/BeanUtils.java | 1 -
.../chanjar/weixin/common/util/XmlUtils.java | 2 +-
.../common/util/crypto/WxCryptUtil.java | 1 -
.../BaseMediaDownloadRequestExecutor.java | 15 ++++++--
...MediaInputStreamUploadRequestExecutor.java | 16 +++++---
.../util/http/MediaUploadRequestExecutor.java | 16 +++++---
...inishopUploadRequestCustomizeExecutor.java | 17 ++++++---
.../http/MinishopUploadRequestExecutor.java | 17 ++++++---
.../util/http/SimpleGetRequestExecutor.java | 13 +++++--
.../util/http/SimplePostRequestExecutor.java | 16 +++++---
.../ApacheMediaDownloadRequestExecutor.java | 2 +-
...MediaInputStreamUploadRequestExecutor.java | 2 +-
.../ApacheMediaUploadRequestExecutor.java | 2 +-
...opMediaUploadRequestCustomizeExecutor.java | 4 +-
...cheMinishopMediaUploadRequestExecutor.java | 5 +--
.../ApacheSimpleGetRequestExecutor.java | 2 +-
.../ApacheSimplePostRequestExecutor.java | 2 +-
.../DefaultApacheHttpClientBuilder.java | 4 --
.../JoddHttpMediaDownloadRequestExecutor.java | 3 +-
...MediaInputStreamUploadRequestExecutor.java | 2 +-
.../JoddHttpMediaUploadRequestExecutor.java | 3 +-
...opMediaUploadRequestCustomizeExecutor.java | 4 +-
...ttpMinishopMediaUploadRequestExecutor.java | 6 +--
.../JoddHttpSimpleGetRequestExecutor.java | 3 +-
.../JoddHttpSimplePostRequestExecutor.java | 2 +-
.../OkHttpMediaDownloadRequestExecutor.java | 2 +-
...MediaInputStreamUploadRequestExecutor.java | 2 +-
.../OkHttpMediaUploadRequestExecutor.java | 2 +-
...opMediaUploadRequestCustomizeExecutor.java | 4 +-
...ttpMinishopMediaUploadRequestExecutor.java | 6 +--
.../OkHttpSimpleGetRequestExecutor.java | 2 +-
.../OkHttpSimplePostRequestExecutor.java | 2 +-
.../common/util/json/WxMenuGsonAdapter.java | 2 +-
.../json/WxNetCheckResultGsonAdapter.java | 4 +-
.../RedisTemplateSimpleDistributedLock.java | 8 ++--
.../util/xml/IntegerArrayConverter.java | 2 +-
weixin-java-cp/pom.xml | 1 -
.../weixin/cp/api/WxCpMeetingService.java | 2 -
.../cp/api/impl/BaseWxCpServiceImpl.java | 2 +-
.../cp/api/impl/WxCpCorpGroupServiceImpl.java | 1 -
.../cp/api/impl/WxCpMediaServiceImpl.java | 8 +---
.../cp/api/impl/WxCpMeetingServiceImpl.java | 1 -
.../cp/api/impl/WxCpMsgAuditServiceImpl.java | 6 +--
.../api/impl/WxCpSchoolUserServiceImpl.java | 2 +-
...WxCpCorpGroupCorpListAppShareInfoResp.java | 1 -
.../interceptrule/WxCpInterceptRuleInfo.java | 1 -
.../interceptrule/WxCpInterceptRuleList.java | 3 --
.../bean/message/WxCpGroupRobotMessage.java | 1 -
.../cp/bean/messagebuilder/BaseBuilder.java | 4 +-
.../weixin/cp/bean/oa/WxCpCheckinDayData.java | 12 +++---
.../cp/bean/oa/WxCpCheckinSchedule.java | 2 +-
.../oa/meeting/WxCpMeetingUpdateResult.java | 4 --
.../cp/bean/templatecard/MultipleSelect.java | 2 +-
.../TemplateCardButtonSelection.java | 2 +-
.../service/impl/BaseWxCpCgServiceImpl.java | 1 -
.../weixin/cp/message/WxCpMessageRouter.java | 8 ++--
.../cp/tp/message/WxCpTpMessageRouter.java | 8 ++--
.../cp/tp/service/WxCpTpIdConvertService.java | 2 -
.../service/impl/BaseWxCpTpServiceImpl.java | 2 +-
.../impl/WxCpTpIdConvertServiceImpl.java | 2 -
.../cp/util/xml/XStreamTransformer.java | 8 ++--
.../wx/miniapp/api/WxMaCloudService.java | 2 +-
.../api/WxMaOrderManagementService.java | 1 -
.../wx/miniapp/api/WxMaProductService.java | 4 +-
.../wx/miniapp/api/WxMaService.java | 4 +-
.../miniapp/api/impl/BaseWxMaServiceImpl.java | 8 ++--
.../api/impl/WxMaCloudServiceImpl.java | 2 +-
.../impl/WxMaDeviceSubscribeServiceImpl.java | 1 -
.../WxMaImmediateDeliveryServiceImpl.java | 1 -
.../api/impl/WxMaInternetServiceImpl.java | 5 ++-
.../api/impl/WxMaLiveGoodsServiceImpl.java | 3 +-
.../miniapp/api/impl/WxMaMsgServiceImpl.java | 1 -
.../impl/WxMaOrderManagementServiceImpl.java | 1 -
.../impl/WxMaOrderShippingServiceImpl.java | 1 -
.../api/impl/WxMaProductServiceImpl.java | 25 ++++--------
.../api/impl/WxMaServiceHttpClientImpl.java | 15 ++------
.../api/impl/WxMaSubscribeServiceImpl.java | 1 -
...WxMaOrderManagementGetOrderDetailPath.java | 2 -
...xMaOrderShippingIsTradeManagedRequest.java | 1 -
.../request/WxMaShopAfterSaleAddRequest.java | 1 -
.../request/WxMaShopAfterSaleListRequest.java | 2 +-
.../WxMaShopAfterSaleUpdateRequest.java | 1 -
...rderCombinedShippingInfoUploadRequest.java | 1 -
.../shop/response/WxMaShopBaseResponse.java | 1 -
...ApacheApiSignaturePostRequestExecutor.java | 2 +-
...acheUploadAuthMaterialRequestExecutor.java | 2 +-
.../ApacheVodSingleUploadRequestExecutor.java | 2 +-
.../ApacheVodUploadPartRequestExecutor.java | 2 +-
.../ApiSignaturePostRequestExecutor.java | 18 ++++++---
.../JoddApiSignaturePostRequestExecutor.java | 2 +-
.../JoddHttpQrcodeFileRequestExecutor.java | 2 -
...HttpUploadAuthMaterialRequestExecutor.java | 2 +-
...oddHttpVodSingleUploadRequestExecutor.java | 2 +-
.../JoddHttpVodUploadPartRequestExecutor.java | 2 +-
...OkHttpApiSignaturePostRequestExecutor.java | 2 +-
...HttpUploadAuthMaterialRequestExecutor.java | 2 +-
.../OkHttpVodSingleUploadRequestExecutor.java | 2 +-
.../OkHttpVodUploadPartRequestExecutor.java | 2 +-
.../executor/QrcodeBytesRequestExecutor.java | 13 +++++--
.../executor/QrcodeRequestExecutor.java | 19 ++++++----
.../UploadAuthMaterialRequestExecutor.java | 17 ++++++---
.../VodSingleUploadRequestExecutor.java | 16 +++++---
.../VodUploadPartRequestExecutor.java | 16 +++++---
...xMaCodeVersionDistributionGsonAdapter.java | 2 +-
.../adaptor/WxMaRetainInfoGsonAdapter.java | 2 +-
.../WxMaSubscribeMsgEventJsonAdapter.java | 2 +-
.../adaptor/WxMaUserPortraitGsonAdapter.java | 2 +-
.../wx/miniapp/message/WxMaMessageRouter.java | 5 +--
.../wx/miniapp/util/WxMaConfigHolder.java | 7 +---
.../wx/miniapp/util/crypt/WxMaCryptUtils.java | 2 -
.../weixin/mp/api/WxMpMemberCardService.java | 3 --
.../me/chanjar/weixin/mp/api/WxMpService.java | 2 +-
.../weixin/mp/api/WxMpStoreService.java | 4 +-
.../mp/api/impl/BaseWxMpServiceImpl.java | 4 +-
.../mp/api/impl/WxMpCardServiceImpl.java | 6 +--
.../mp/api/impl/WxMpGuideServiceImpl.java | 2 +-
.../mp/api/impl/WxMpGuideTagServiceImpl.java | 2 +-
.../mp/api/impl/WxMpKefuServiceImpl.java | 2 +-
.../api/impl/WxMpMemberCardServiceImpl.java | 5 ---
.../impl/WxMpMerchantInvoiceServiceImpl.java | 1 -
.../mp/api/impl/WxMpQrcodeServiceImpl.java | 1 -
.../mp/api/impl/WxMpStoreServiceImpl.java | 2 +-
.../mp/api/impl/WxMpWifiServiceImpl.java | 8 +---
.../weixin/mp/bean/WxMpShakeInfoResult.java | 2 +-
.../bean/card/enums/BusinessServiceType.java | 2 +-
.../mp/bean/card/enums/CardCodeType.java | 2 +-
.../weixin/mp/bean/card/enums/CardColor.java | 2 +-
.../mp/bean/card/enums/CardFieldType.java | 2 +-
.../mp/bean/card/enums/CardRichFieldType.java | 2 +-
.../mp/bean/card/enums/CardSceneType.java | 2 +-
.../mp/bean/card/enums/CardStatusType.java | 2 +-
.../bean/card/enums/CardWechatFieldType.java | 2 +-
.../bean/card/enums/CustomFieldNameType.java | 2 +-
.../mp/bean/card/enums/DateInfoType.java | 2 +-
.../weixin/mp/bean/device/BaseResp.java | 2 +-
.../chanjar/weixin/mp/enums/AiLangType.java | 2 +-
.../chanjar/weixin/mp/enums/WxCardType.java | 2 +-
.../mp/util/WxMpConfigStorageHolder.java | 7 +---
.../weixin/mp/util/crypto/WxMpCryptUtil.java | 2 -
...terialDeleteApacheHttpRequestExecutor.java | 2 +-
...MaterialDeleteJoddHttpRequestExecutor.java | 3 +-
.../MaterialDeleteOkhttpRequestExecutor.java | 2 +-
.../MaterialDeleteRequestExecutor.java | 17 ++++++---
...rialNewsInfoApacheHttpRequestExecutor.java | 2 +-
...terialNewsInfoJoddHttpRequestExecutor.java | 5 +--
...MaterialNewsInfoOkhttpRequestExecutor.java | 2 +-
.../MaterialNewsInfoRequestExecutor.java | 17 ++++++---
...terialUploadApacheHttpRequestExecutor.java | 2 +-
...MaterialUploadJoddHttpRequestExecutor.java | 3 +-
.../MaterialUploadOkhttpRequestExecutor.java | 2 +-
.../MaterialUploadRequestExecutor.java | 17 ++++++---
...ialVideoInfoApacheHttpRequestExecutor.java | 2 +-
...erialVideoInfoJoddHttpRequestExecutor.java | 3 +-
...aterialVideoInfoOkhttpRequestExecutor.java | 2 +-
.../MaterialVideoInfoRequestExecutor.java | 17 ++++++---
...mageDownloadApacheHttpRequestExecutor.java | 2 +-
...dImageDownloadJoddHttpRequestExecutor.java | 3 +-
...AndImageDownloadOkhttpRequestExecutor.java | 4 +-
...lVoiceAndImageDownloadRequestExecutor.java | 17 ++++++---
...diaImgUploadApacheHttpRequestExecutor.java | 3 +-
.../MediaImgUploadHttpRequestExecutor.java | 3 +-
.../MediaImgUploadOkhttpRequestExecutor.java | 2 +-
.../media/MediaImgUploadRequestExecutor.java | 17 ++++++---
.../QrCodeApacheHttpRequestExecutor.java | 2 +-
.../qrcode/QrCodeJoddHttpRequestExecutor.java | 3 +-
.../qrcode/QrCodeOkhttpRequestExecutor.java | 2 +-
.../qrcode/QrCodeRequestExecutor.java | 18 ++++++---
.../VoiceUploadApacheHttpRequestExecutor.java | 3 +-
.../voice/VoiceUploadRequestExecutor.java | 9 +++--
.../weixin/open/api/WxOpenMaBasicService.java | 1 -
.../weixin/open/api/WxOpenService.java | 1 -
.../api/impl/WxOpenComponentServiceImpl.java | 38 +++++++++----------
.../api/impl/WxOpenFastMaServiceImpl.java | 1 -
.../api/impl/WxOpenInMemoryConfigStorage.java | 12 +-----
.../WxOpenInRedisTemplateConfigStorage.java | 2 -
.../api/impl/WxOpenMaBasicServiceImpl.java | 1 -
.../api/impl/WxOpenMinishopServiceImpl.java | 6 +--
.../open/api/impl/WxOpenMpServiceImpl.java | 4 --
.../api/impl/WxOpenServiceAbstractImpl.java | 2 -
.../WxOpenServiceApacheHttpClientImpl.java | 1 -
.../WxOpenIcpCreateIcpVerifyTaskResult.java | 2 -
.../bean/icp/WxOpenOnlineIcpOrderResult.java | 1 -
.../bean/icp/WxOpenUploadIcpMediaResult.java | 1 -
.../bean/result/WxOpenVersioninfoResult.java | 3 --
.../ShoppingInfoVerifyUpload.java | 1 -
.../GenericUploadRequestExecutor.java | 2 -
.../MaQrCodeApacheHttpRequestExecutor.java | 2 +-
.../MaQrCodeJoddHttpRequestExecutor.java | 3 +-
.../MaQrCodeOkhttpRequestExecutor.java | 2 +-
.../executor/MaQrCodeRequestExecutor.java | 18 ++++++---
.../weixin/open/util/WxOpenCryptUtil.java | 2 -
...WxOpenAuthorizerListResultGsonAdapter.java | 5 +--
...ubjectConfirmMerchantStateQueryResult.java | 1 -
.../wxpay/bean/bank/BankAccountResult.java | 2 -
.../binarywang/wxpay/bean/bank/BankInfo.java | 2 -
.../binarywang/wxpay/bean/bank/PageLink.java | 3 --
.../complaint/ComplaintNotifyUrlResult.java | 3 --
.../customs/VerifyCertificateRequest.java | 1 -
.../wxpay/bean/ecommerce/RefundsResult.java | 1 -
.../bean/ecommerce/ReturnAdvanceResult.java | 1 -
.../bean/ecommerce/ReturnOrdersResult.java | 1 -
.../transfer/BatchDetailsResult.java | 1 -
.../bean/notify/WxPayOrderNotifyResult.java | 2 +-
...erUserAuthorizationStatusNotifyResult.java | 1 -
.../bean/profitsharing/ReceiverList.java | 4 +-
.../ProfitSharingReceiverV3Request.java | 6 ---
.../request/ProfitSharingRequest.java | 4 --
.../result/ProfitSharingQueryResult.java | 2 +-
.../result/ProfitSharingReceiverV3Result.java | 5 ---
.../wxpay/bean/request/BaseWxPayRequest.java | 8 ++--
.../request/WxPayPartnerRefundV3Request.java | 1 -
.../wxpay/bean/result/BaseWxPayResult.java | 6 +--
.../bean/result/WxWithholdNotifyResult.java | 2 +-
.../result/WxWithholdOrderQueryResult.java | 2 +-
.../service/impl/BaseWxPayServiceImpl.java | 2 -
.../BrandMerchantTransferServiceImpl.java | 4 +-
.../impl/CustomDeclarationServiceImpl.java | 1 -
.../service/impl/EcommerceServiceImpl.java | 4 +-
.../impl/MerchantTransferServiceImpl.java | 4 +-
.../service/impl/TransferServiceImpl.java | 2 +-
.../wxpay/v3/WxPayV3HttpClientBuilder.java | 4 --
.../auth/AutoUpdateCertificatesVerifier.java | 4 +-
.../wxpay/v3/auth/WxPayValidator.java | 3 +-
.../wxpay/v3/util/RsaCryptoUtil.java | 6 +--
.../weixin/qidian/api/WxQidianService.java | 2 +-
.../api/impl/BaseWxQidianServiceImpl.java | 4 +-
.../api/impl/WxQidianServiceOkHttpImpl.java | 4 +-
.../util/WxQidianConfigStorageHolder.java | 7 +---
263 files changed, 559 insertions(+), 607 deletions(-)
diff --git a/pom.xml b/pom.xml
index 48b2795f09..9e5df38436 100644
--- a/pom.xml
+++ b/pom.xml
@@ -196,17 +196,19 @@
com.google.guava
guava
- 32.1.2-jre
+ 33.3.1-jre
com.google.code.gson
gson
- 2.10.1
+ 2.13.1
- com.fasterxml.jackson.dataformat
- jackson-dataformat-xml
- 2.15.2
+ com.fasterxml.jackson
+ jackson-bom
+ 2.18.1
+ pom
+ import
diff --git a/solon-plugins/wx-java-qidian-solon-plugin/src/main/java/com/binarywang/solon/wxjava/qidian/config/WxQidianStorageAutoConfiguration.java b/solon-plugins/wx-java-qidian-solon-plugin/src/main/java/com/binarywang/solon/wxjava/qidian/config/WxQidianStorageAutoConfiguration.java
index 7f78864226..a99a8178c9 100644
--- a/solon-plugins/wx-java-qidian-solon-plugin/src/main/java/com/binarywang/solon/wxjava/qidian/config/WxQidianStorageAutoConfiguration.java
+++ b/solon-plugins/wx-java-qidian-solon-plugin/src/main/java/com/binarywang/solon/wxjava/qidian/config/WxQidianStorageAutoConfiguration.java
@@ -18,11 +18,13 @@
import org.noear.solon.annotation.Configuration;
import org.noear.solon.annotation.Inject;
import org.noear.solon.core.AppContext;
+import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;
import redis.clients.jedis.JedisPoolConfig;
import redis.clients.jedis.JedisSentinelPool;
import redis.clients.jedis.util.Pool;
+import java.time.Duration;
import java.util.Set;
/**
@@ -75,7 +77,7 @@ private WxQidianConfigStorage defaultConfigStorage() {
}
private WxQidianConfigStorage jedisConfigStorage() {
- Pool jedisPool;
+ Pool jedisPool;
if (StringUtils.isNotEmpty(redisHost) || StringUtils.isNotEmpty(redisHost2)) {
jedisPool = getJedisPool();
} else {
@@ -104,7 +106,7 @@ private void setWxMpInfo(WxQidianDefaultConfigImpl config) {
}
}
- private Pool getJedisPool() {
+ private Pool getJedisPool() {
WxQidianProperties.ConfigStorage storage = wxQidianProperties.getConfigStorage();
RedisProperties redis = storage.getRedis();
@@ -116,7 +118,7 @@ private Pool getJedisPool() {
config.setMaxIdle(redis.getMaxIdle());
}
if (redis.getMaxWaitMillis() != null) {
- config.setMaxWaitMillis(redis.getMaxWaitMillis());
+ config.setMaxWait(Duration.ofMillis(redis.getMaxWaitMillis()));
}
if (redis.getMinIdle() != null) {
config.setMinIdle(redis.getMinIdle());
diff --git a/spring-boot-starters/wx-java-qidian-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/qidian/config/WxQidianStorageAutoConfiguration.java b/spring-boot-starters/wx-java-qidian-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/qidian/config/WxQidianStorageAutoConfiguration.java
index 80809fefce..01ba91b565 100644
--- a/spring-boot-starters/wx-java-qidian-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/qidian/config/WxQidianStorageAutoConfiguration.java
+++ b/spring-boot-starters/wx-java-qidian-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/qidian/config/WxQidianStorageAutoConfiguration.java
@@ -20,6 +20,7 @@
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.core.StringRedisTemplate;
+import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;
import redis.clients.jedis.JedisPoolConfig;
import redis.clients.jedis.JedisSentinelPool;
@@ -80,7 +81,7 @@ private WxQidianConfigStorage defaultConfigStorage() {
}
private WxQidianConfigStorage jedisConfigStorage() {
- Pool jedisPool;
+ Pool jedisPool;
if (StringUtils.isNotEmpty(redisHost) || StringUtils.isNotEmpty(redisHost2)) {
jedisPool = getJedisPool();
} else {
@@ -136,7 +137,7 @@ private void setWxMpInfo(WxQidianDefaultConfigImpl config) {
}
}
- private Pool getJedisPool() {
+ private Pool getJedisPool() {
WxQidianProperties.ConfigStorage storage = wxQidianProperties.getConfigStorage();
RedisProperties redis = storage.getRedis();
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/BaseWxChannelService.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/BaseWxChannelService.java
index f9f4cbed68..07278da7ef 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/BaseWxChannelService.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/BaseWxChannelService.java
@@ -131,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/impl/BaseWxChannelServiceImpl.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/BaseWxChannelServiceImpl.java
index f85a9116c6..1a608e1f6a 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
@@ -66,7 +66,7 @@ public abstract class BaseWxChannelServiceImpl implements WxChannelService
private int maxRetryTimes = 5;
@Override
- public RequestHttp getRequestHttp() {
+ public RequestHttp getRequestHttp() {
return this;
}
@@ -75,7 +75,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;
}
}
@@ -276,7 +276,7 @@ protected T executeInternal(RequestExecutor executor, String uri, E
* @throws WxErrorException 异常
*/
protected String extractAccessToken(String resultContent) throws WxErrorException {
- log.debug("access-token response: " + resultContent);
+ log.debug("access-token response: {}", resultContent);
WxChannelConfig config = this.getConfig();
WxError error = WxError.fromJson(resultContent, WxType.Channel);
if (error.getErrorCode() != 0) {
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
index 20572c5ef0..55be5abcca 100644
--- 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
@@ -28,7 +28,7 @@
public class WxAssistantServiceImpl implements WxAssistantService {
/** 微信商店服务 */
- private final BaseWxChannelServiceImpl shopService;
+ private final BaseWxChannelServiceImpl, ?> shopService;
@Override
public WxChannelBaseResponse addWindowProduct(AddWindowProductRequest req) throws WxErrorException {
String resJson = shopService.post(ADD_WINDOW_PRODUCT_URL, "{}");
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 a4be86f28d..cd90665865 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
@@ -23,9 +23,9 @@
public class WxChannelAfterSaleServiceImpl implements WxChannelAfterSaleService {
/** 微信商店服务 */
- private final BaseWxChannelServiceImpl shopService;
+ private final BaseWxChannelServiceImpl, ?> shopService;
- public WxChannelAfterSaleServiceImpl(BaseWxChannelServiceImpl shopService) {
+ public WxChannelAfterSaleServiceImpl(BaseWxChannelServiceImpl, ?> shopService) {
this.shopService = shopService;
}
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..f408298666 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
@@ -31,9 +31,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;
}
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 e5940e9879..23cd839848 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
@@ -37,9 +37,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 +56,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 + "}";
@@ -80,7 +80,7 @@ public CategoryDetailResult getCategoryDetail(String id) throws WxErrorException
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 + "}";
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
index acaad0c0c1..c80345aef2 100644
--- 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
@@ -20,9 +20,9 @@ public class WxChannelCompassFinderServiceImpl implements WxChannelCompassFinder
/**
* 微信商店服务
*/
- private final BaseWxChannelServiceImpl shopService;
+ private final BaseWxChannelServiceImpl, ?> shopService;
- public WxChannelCompassFinderServiceImpl(BaseWxChannelServiceImpl shopService) {this.shopService = shopService;}
+ public WxChannelCompassFinderServiceImpl(BaseWxChannelServiceImpl, ?> shopService) {this.shopService = shopService;}
@Override
public OverallResponse getOverall(String ds) throws WxErrorException {
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
index 36b5a23950..3a593a691f 100644
--- 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
@@ -41,9 +41,9 @@ public class WxChannelCompassShopServiceImpl implements WxChannelCompassShopServ
/**
* 微信商店服务
*/
- private final BaseWxChannelServiceImpl shopService;
+ private final BaseWxChannelServiceImpl, ?> shopService;
- public WxChannelCompassShopServiceImpl(BaseWxChannelServiceImpl shopService) {this.shopService = shopService;}
+ public WxChannelCompassShopServiceImpl(BaseWxChannelServiceImpl, ?> shopService) {this.shopService = shopService;}
@Override
public ShopOverallResponse getShopOverall(String ds) throws WxErrorException {
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/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/WxChannelLiveDashboardServiceImpl.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelLiveDashboardServiceImpl.java
index 7c9c876e9b..7eace4377b 100644
--- 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
@@ -27,10 +27,10 @@ public class WxChannelLiveDashboardServiceImpl implements WxChannelLiveDashboard
/**
* 微信商店服务
*/
- private final BaseWxChannelServiceImpl shopService;
+ private final BaseWxChannelServiceImpl, ?> shopService;
private final ObjectMapper objectMapper = new ObjectMapper();
- public WxChannelLiveDashboardServiceImpl(BaseWxChannelServiceImpl shopService) {this.shopService = shopService;}
+ public WxChannelLiveDashboardServiceImpl(BaseWxChannelServiceImpl, ?> shopService) {this.shopService = shopService;}
@Override
public LiveListResponse getLiveList(Long ds) throws WxErrorException {
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 e98294d189..4331185066 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
@@ -39,9 +39,9 @@
public class WxChannelOrderServiceImpl implements WxChannelOrderService {
/** 微信商店服务 */
- private final BaseWxChannelServiceImpl shopService;
+ private final BaseWxChannelServiceImpl, ?> shopService;
- public WxChannelOrderServiceImpl(BaseWxChannelServiceImpl shopService) {
+ public WxChannelOrderServiceImpl(BaseWxChannelServiceImpl, ?> shopService) {
this.shopService = shopService;
}
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 bb131d2eaa..08c9638f0c 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
@@ -56,9 +56,9 @@
public class WxChannelProductServiceImpl implements WxChannelProductService {
/** 微信商店服务 */
- private final BaseWxChannelServiceImpl shopService;
+ private final BaseWxChannelServiceImpl, ?> shopService;
- public WxChannelProductServiceImpl(BaseWxChannelServiceImpl shopService) {
+ public WxChannelProductServiceImpl(BaseWxChannelServiceImpl, ?> shopService) {
this.shopService = shopService;
}
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 676b310288..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
@@ -33,9 +33,9 @@
public class WxChannelSharerServiceImpl implements WxChannelSharerService {
/** 微信商店服务 */
- private final BaseWxChannelServiceImpl shopService;
+ private final BaseWxChannelServiceImpl, ?> shopService;
- public WxChannelSharerServiceImpl(BaseWxChannelServiceImpl shopService) {
+ public WxChannelSharerServiceImpl(BaseWxChannelServiceImpl, ?> shopService) {
this.shopService = shopService;
}
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
index c06e7ff7a4..4644989d60 100644
--- 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
@@ -18,9 +18,9 @@
@Slf4j
public class WxChannelVipServiceImpl implements WxChannelVipService {
- private BaseWxChannelServiceImpl shopService;
+ private final BaseWxChannelServiceImpl, ?> shopService;
- public WxChannelVipServiceImpl(BaseWxChannelServiceImpl shopService) {
+ public WxChannelVipServiceImpl(BaseWxChannelServiceImpl, ?> shopService) {
this.shopService = shopService;
}
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
index aecd1cccac..51623609cf 100644
--- 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
@@ -26,7 +26,7 @@
public class WxFinderLiveServiceImpl implements WxFinderLiveService {
/** 微信商店服务 */
- private final BaseWxChannelServiceImpl shopService;
+ private final BaseWxChannelServiceImpl, ?> shopService;
@Override
public FinderAttrResponse getFinderAttrByAppid() throws WxErrorException {
String resJson = shopService.post(GET_FINDER_ATTR_BY_APPID, "{}");
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
index b99cfe9f47..eb1bcee28c 100644
--- 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
@@ -38,7 +38,7 @@
public class WxLeadComponentServiceImpl implements WxLeadComponentService {
/** 微信商店服务 */
- private final BaseWxChannelServiceImpl shopService;
+ private final BaseWxChannelServiceImpl, ?> shopService;
private final ObjectMapper objectMapper = new ObjectMapper();
@Override
public LeadInfoResponse getLeadsInfoByComponentId(GetLeadInfoByComponentRequest req) throws WxErrorException {
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..d10a5b80f3 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;
}
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
index f82e35fa2f..56dc78e09e 100644
--- 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
@@ -25,9 +25,9 @@
public class WxStoreCooperationServiceImpl implements WxStoreCooperationService {
/** 微信小店服务 */
- private final BaseWxChannelServiceImpl storeService;
+ private final BaseWxChannelServiceImpl, ?> storeService;
- public WxStoreCooperationServiceImpl(BaseWxChannelServiceImpl storeService) {
+ public WxStoreCooperationServiceImpl(BaseWxChannelServiceImpl, ?> storeService) {
this.storeService = storeService;
}
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
index b5f3038e98..e3e9f06deb 100644
--- 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
@@ -37,9 +37,9 @@
public class WxStoreHomePageServiceImpl implements WxStoreHomePageService {
/** 微信小店服务 */
- private final BaseWxChannelServiceImpl storeService;
+ private final BaseWxChannelServiceImpl, ?> storeService;
- public WxStoreHomePageServiceImpl(BaseWxChannelServiceImpl storeService) {
+ public WxStoreHomePageServiceImpl(BaseWxChannelServiceImpl, ?> storeService) {
this.storeService = storeService;
}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/executor/ChannelFileUploadRequestExecutor.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/executor/ChannelFileUploadRequestExecutor.java
index 576f1c286a..9d7474c354 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/executor/ChannelFileUploadRequestExecutor.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/executor/ChannelFileUploadRequestExecutor.java
@@ -3,6 +3,7 @@
import java.io.File;
import java.io.IOException;
+
import me.chanjar.weixin.common.enums.WxType;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.common.util.http.RequestExecutor;
@@ -59,8 +60,13 @@ public void execute(String uri, File data, ResponseHandler handler, WxTy
handler.handle(this.execute(uri, data, wxType));
}
- public static RequestExecutor create(RequestHttp requestHttp) {
- return new ChannelFileUploadRequestExecutor(requestHttp);
+ public static RequestExecutor create(RequestHttp, ?> requestHttp) throws WxErrorException {
+ switch (requestHttp.getRequestType()) {
+ case APACHE_HTTP:
+ return new ChannelFileUploadRequestExecutor((RequestHttp) requestHttp);
+ default:
+ throw new WxErrorException("不支持的http框架");
+ }
}
}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/executor/ChannelMediaDownloadRequestExecutor.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/executor/ChannelMediaDownloadRequestExecutor.java
index 1b81dc6d15..8f841c2313 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/executor/ChannelMediaDownloadRequestExecutor.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/executor/ChannelMediaDownloadRequestExecutor.java
@@ -103,8 +103,13 @@ public void execute(String uri, String data, ResponseHandler create(RequestHttp requestHttp, File tmpDirFile) {
- return new ChannelMediaDownloadRequestExecutor(requestHttp, tmpDirFile);
+ public static RequestExecutor create(RequestHttp, ?> requestHttp, File tmpDirFile) throws WxErrorException {
+ switch (requestHttp.getRequestType()) {
+ case APACHE_HTTP:
+ return new ChannelMediaDownloadRequestExecutor((RequestHttp) requestHttp, tmpDirFile);
+ default:
+ throw new WxErrorException("不支持的http框架");
+ }
}
/**
@@ -138,7 +143,7 @@ private String createDefaultFileName() {
}
private String extractFileNameFromContentString(String content) throws WxErrorException {
- if (content == null || content.length() == 0) {
+ if (content == null || content.isEmpty()) {
return createDefaultFileName();
}
Matcher m = PATTERN.matcher(content);
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/message/WxChannelMessageRouter.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/message/WxChannelMessageRouter.java
index c35f75ac0b..3236e18303 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/message/WxChannelMessageRouter.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/message/WxChannelMessageRouter.java
@@ -137,7 +137,7 @@ public Object route(final WxChannelMessage message, final String content, final
}
}
- if (matchRules.size() == 0) {
+ if (matchRules.isEmpty()) {
return null;
}
final List> futures = new ArrayList<>();
@@ -157,7 +157,7 @@ public Object route(final WxChannelMessage message, final String content, final
}
}
- if (futures.size() > 0) {
+ if (!futures.isEmpty()) {
this.executorService.submit(() -> {
for (Future> future : futures) {
try {
diff --git a/weixin-java-common/src/main/java/me/chanjar/weixin/common/requestexecuter/ocr/OcrDiscernApacheHttpRequestExecutor.java b/weixin-java-common/src/main/java/me/chanjar/weixin/common/requestexecuter/ocr/OcrDiscernApacheHttpRequestExecutor.java
index 22cdab3f92..74fd12cf4c 100644
--- a/weixin-java-common/src/main/java/me/chanjar/weixin/common/requestexecuter/ocr/OcrDiscernApacheHttpRequestExecutor.java
+++ b/weixin-java-common/src/main/java/me/chanjar/weixin/common/requestexecuter/ocr/OcrDiscernApacheHttpRequestExecutor.java
@@ -24,7 +24,7 @@
* created on 2019/6/27 14:06
*/
public class OcrDiscernApacheHttpRequestExecutor extends OcrDiscernRequestExecutor {
- public OcrDiscernApacheHttpRequestExecutor(RequestHttp requestHttp) {
+ public OcrDiscernApacheHttpRequestExecutor(RequestHttp requestHttp) {
super(requestHttp);
}
diff --git a/weixin-java-common/src/main/java/me/chanjar/weixin/common/requestexecuter/ocr/OcrDiscernRequestExecutor.java b/weixin-java-common/src/main/java/me/chanjar/weixin/common/requestexecuter/ocr/OcrDiscernRequestExecutor.java
index 870f77d2ed..58e525bc0e 100644
--- a/weixin-java-common/src/main/java/me/chanjar/weixin/common/requestexecuter/ocr/OcrDiscernRequestExecutor.java
+++ b/weixin-java-common/src/main/java/me/chanjar/weixin/common/requestexecuter/ocr/OcrDiscernRequestExecutor.java
@@ -5,6 +5,8 @@
import me.chanjar.weixin.common.util.http.RequestExecutor;
import me.chanjar.weixin.common.util.http.RequestHttp;
import me.chanjar.weixin.common.util.http.ResponseHandler;
+import org.apache.http.HttpHost;
+import org.apache.http.impl.client.CloseableHttpClient;
import java.io.File;
import java.io.IOException;
@@ -18,7 +20,7 @@
public abstract class OcrDiscernRequestExecutor implements RequestExecutor {
protected RequestHttp requestHttp;
- public OcrDiscernRequestExecutor(RequestHttp requestHttp) {
+ public OcrDiscernRequestExecutor(RequestHttp requestHttp) {
this.requestHttp = requestHttp;
}
@@ -27,10 +29,11 @@ public void execute(String uri, File data, ResponseHandler handler, WxTy
handler.handle(this.execute(uri, data, wxType));
}
- public static RequestExecutor create(RequestHttp requestHttp) {
+ @SuppressWarnings("unchecked")
+ public static RequestExecutor create(RequestHttp, ?> requestHttp) {
switch (requestHttp.getRequestType()) {
case APACHE_HTTP:
- return new OcrDiscernApacheHttpRequestExecutor(requestHttp);
+ return new OcrDiscernApacheHttpRequestExecutor((RequestHttp) requestHttp);
default:
return null;
}
diff --git a/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/BeanUtils.java b/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/BeanUtils.java
index 73b6cff368..d3f8d00406 100644
--- a/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/BeanUtils.java
+++ b/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/BeanUtils.java
@@ -2,7 +2,6 @@
import com.google.common.collect.Lists;
import me.chanjar.weixin.common.annotation.Required;
-import me.chanjar.weixin.common.error.WxError;
import me.chanjar.weixin.common.error.WxErrorException;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
diff --git a/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/XmlUtils.java b/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/XmlUtils.java
index facf564e32..67faf319f4 100644
--- a/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/XmlUtils.java
+++ b/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/XmlUtils.java
@@ -65,7 +65,7 @@ private static Object element2MapOrString(Element element) {
final List names = names(nodes);
// 判断节点下有无非文本节点(非Text和CDATA),如无,直接取Text文本内容
- if (names.size() < 1) {
+ if (names.isEmpty()) {
return element.getText();
}
diff --git a/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/crypto/WxCryptUtil.java b/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/crypto/WxCryptUtil.java
index f02d087b7d..0a40d0e93c 100755
--- a/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/crypto/WxCryptUtil.java
+++ b/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/crypto/WxCryptUtil.java
@@ -1,6 +1,5 @@
package me.chanjar.weixin.common.util.crypto;
-import com.google.common.base.CharMatcher;
import lombok.AllArgsConstructor;
import lombok.Data;
import me.chanjar.weixin.common.error.WxRuntimeException;
diff --git a/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/BaseMediaDownloadRequestExecutor.java b/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/BaseMediaDownloadRequestExecutor.java
index ed5ec17bc9..fa60d364b0 100644
--- a/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/BaseMediaDownloadRequestExecutor.java
+++ b/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/BaseMediaDownloadRequestExecutor.java
@@ -3,11 +3,17 @@
import java.io.File;
import java.io.IOException;
+import jodd.http.HttpConnectionProvider;
+import jodd.http.ProxyInfo;
import me.chanjar.weixin.common.enums.WxType;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.common.util.http.apache.ApacheMediaDownloadRequestExecutor;
import me.chanjar.weixin.common.util.http.jodd.JoddHttpMediaDownloadRequestExecutor;
import me.chanjar.weixin.common.util.http.okhttp.OkHttpMediaDownloadRequestExecutor;
+import me.chanjar.weixin.common.util.http.okhttp.OkHttpProxyInfo;
+import okhttp3.OkHttpClient;
+import org.apache.http.HttpHost;
+import org.apache.http.impl.client.CloseableHttpClient;
/**
* 下载媒体文件请求执行器.
@@ -30,14 +36,15 @@ public void execute(String uri, String data, ResponseHandler handler, WxTy
handler.handle(this.execute(uri, data, wxType));
}
- public static RequestExecutor create(RequestHttp requestHttp, File tmpDirFile) {
+ @SuppressWarnings("unchecked")
+ public static RequestExecutor create(RequestHttp, ?> requestHttp, File tmpDirFile) {
switch (requestHttp.getRequestType()) {
case APACHE_HTTP:
- return new ApacheMediaDownloadRequestExecutor(requestHttp, tmpDirFile);
+ return new ApacheMediaDownloadRequestExecutor((RequestHttp) requestHttp, tmpDirFile);
case JODD_HTTP:
- return new JoddHttpMediaDownloadRequestExecutor(requestHttp, tmpDirFile);
+ return new JoddHttpMediaDownloadRequestExecutor((RequestHttp) requestHttp, tmpDirFile);
case OK_HTTP:
- return new OkHttpMediaDownloadRequestExecutor(requestHttp, tmpDirFile);
+ return new OkHttpMediaDownloadRequestExecutor((RequestHttp) requestHttp, tmpDirFile);
default:
return null;
}
diff --git a/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/MediaInputStreamUploadRequestExecutor.java b/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/MediaInputStreamUploadRequestExecutor.java
index de4be21709..cd92ba3b63 100644
--- a/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/MediaInputStreamUploadRequestExecutor.java
+++ b/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/MediaInputStreamUploadRequestExecutor.java
@@ -1,11 +1,17 @@
package me.chanjar.weixin.common.util.http;
+import jodd.http.HttpConnectionProvider;
+import jodd.http.ProxyInfo;
import me.chanjar.weixin.common.bean.result.WxMediaUploadResult;
import me.chanjar.weixin.common.enums.WxType;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.common.util.http.apache.ApacheMediaInputStreamUploadRequestExecutor;
import me.chanjar.weixin.common.util.http.jodd.JoddHttpMediaInputStreamUploadRequestExecutor;
import me.chanjar.weixin.common.util.http.okhttp.OkHttpMediaInputStreamUploadRequestExecutor;
+import me.chanjar.weixin.common.util.http.okhttp.OkHttpProxyInfo;
+import okhttp3.OkHttpClient;
+import org.apache.http.HttpHost;
+import org.apache.http.impl.client.CloseableHttpClient;
import java.io.IOException;
@@ -18,7 +24,7 @@
public abstract class MediaInputStreamUploadRequestExecutor implements RequestExecutor {
protected RequestHttp requestHttp;
- public MediaInputStreamUploadRequestExecutor(RequestHttp requestHttp) {
+ public MediaInputStreamUploadRequestExecutor(RequestHttp requestHttp) {
this.requestHttp = requestHttp;
}
@@ -27,14 +33,14 @@ public void execute(String uri, InputStreamData data, ResponseHandler create(RequestHttp requestHttp) {
+ public static RequestExecutor create(RequestHttp, ?> requestHttp) {
switch (requestHttp.getRequestType()) {
case APACHE_HTTP:
- return new ApacheMediaInputStreamUploadRequestExecutor(requestHttp);
+ return new ApacheMediaInputStreamUploadRequestExecutor((RequestHttp) requestHttp);
case JODD_HTTP:
- return new JoddHttpMediaInputStreamUploadRequestExecutor(requestHttp);
+ return new JoddHttpMediaInputStreamUploadRequestExecutor((RequestHttp) requestHttp);
case OK_HTTP:
- return new OkHttpMediaInputStreamUploadRequestExecutor(requestHttp);
+ return new OkHttpMediaInputStreamUploadRequestExecutor((RequestHttp) requestHttp);
default:
return null;
}
diff --git a/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/MediaUploadRequestExecutor.java b/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/MediaUploadRequestExecutor.java
index 83d0c099b3..9b4f2d5571 100644
--- a/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/MediaUploadRequestExecutor.java
+++ b/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/MediaUploadRequestExecutor.java
@@ -1,5 +1,7 @@
package me.chanjar.weixin.common.util.http;
+import jodd.http.HttpConnectionProvider;
+import jodd.http.ProxyInfo;
import me.chanjar.weixin.common.bean.CommonUploadParam;
import me.chanjar.weixin.common.bean.result.WxMediaUploadResult;
import me.chanjar.weixin.common.enums.WxType;
@@ -8,6 +10,10 @@
import me.chanjar.weixin.common.util.http.apache.ApacheMediaUploadRequestExecutor;
import me.chanjar.weixin.common.util.http.jodd.JoddHttpMediaUploadRequestExecutor;
import me.chanjar.weixin.common.util.http.okhttp.OkHttpMediaUploadRequestExecutor;
+import me.chanjar.weixin.common.util.http.okhttp.OkHttpProxyInfo;
+import okhttp3.OkHttpClient;
+import org.apache.http.HttpHost;
+import org.apache.http.impl.client.CloseableHttpClient;
import java.io.File;
import java.io.IOException;
@@ -25,7 +31,7 @@
public abstract class MediaUploadRequestExecutor implements RequestExecutor {
protected RequestHttp requestHttp;
- public MediaUploadRequestExecutor(RequestHttp requestHttp) {
+ public MediaUploadRequestExecutor(RequestHttp requestHttp) {
this.requestHttp = requestHttp;
}
@@ -34,14 +40,14 @@ public void execute(String uri, File data, ResponseHandler
handler.handle(this.execute(uri, data, wxType));
}
- public static RequestExecutor create(RequestHttp requestHttp) {
+ public static RequestExecutor create(RequestHttp, ?> requestHttp) {
switch (requestHttp.getRequestType()) {
case APACHE_HTTP:
- return new ApacheMediaUploadRequestExecutor(requestHttp);
+ return new ApacheMediaUploadRequestExecutor((RequestHttp) requestHttp);
case JODD_HTTP:
- return new JoddHttpMediaUploadRequestExecutor(requestHttp);
+ return new JoddHttpMediaUploadRequestExecutor((RequestHttp) requestHttp);
case OK_HTTP:
- return new OkHttpMediaUploadRequestExecutor(requestHttp);
+ return new OkHttpMediaUploadRequestExecutor((RequestHttp) requestHttp);
default:
return null;
}
diff --git a/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/MinishopUploadRequestCustomizeExecutor.java b/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/MinishopUploadRequestCustomizeExecutor.java
index e94b2d8d6a..97d4e1b3b8 100644
--- a/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/MinishopUploadRequestCustomizeExecutor.java
+++ b/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/MinishopUploadRequestCustomizeExecutor.java
@@ -1,11 +1,17 @@
package me.chanjar.weixin.common.util.http;
+import jodd.http.HttpConnectionProvider;
+import jodd.http.ProxyInfo;
import me.chanjar.weixin.common.bean.result.WxMinishopImageUploadCustomizeResult;
import me.chanjar.weixin.common.enums.WxType;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.common.util.http.apache.ApacheMinishopMediaUploadRequestCustomizeExecutor;
import me.chanjar.weixin.common.util.http.jodd.JoddHttpMinishopMediaUploadRequestCustomizeExecutor;
import me.chanjar.weixin.common.util.http.okhttp.OkHttpMinishopMediaUploadRequestCustomizeExecutor;
+import me.chanjar.weixin.common.util.http.okhttp.OkHttpProxyInfo;
+import okhttp3.OkHttpClient;
+import org.apache.http.HttpHost;
+import org.apache.http.impl.client.CloseableHttpClient;
import java.io.File;
import java.io.IOException;
@@ -16,7 +22,7 @@ public abstract class MinishopUploadRequestCustomizeExecutor implements Re
protected String uploadType;
protected String imgUrl;
- public MinishopUploadRequestCustomizeExecutor(RequestHttp requestHttp, String respType, String imgUrl) {
+ public MinishopUploadRequestCustomizeExecutor(RequestHttp requestHttp, String respType, String imgUrl) {
this.requestHttp = requestHttp;
this.respType = respType;
if (imgUrl == null || imgUrl.isEmpty()) {
@@ -33,14 +39,15 @@ public void execute(String uri, File data, ResponseHandler create(RequestHttp requestHttp, String respType, String imgUrl) {
+ @SuppressWarnings("unchecked")
+ public static RequestExecutor create(RequestHttp, ?> requestHttp, String respType, String imgUrl) {
switch (requestHttp.getRequestType()) {
case APACHE_HTTP:
- return new ApacheMinishopMediaUploadRequestCustomizeExecutor(requestHttp, respType, imgUrl);
+ return new ApacheMinishopMediaUploadRequestCustomizeExecutor((RequestHttp) requestHttp, respType, imgUrl);
case JODD_HTTP:
- return new JoddHttpMinishopMediaUploadRequestCustomizeExecutor(requestHttp, respType, imgUrl);
+ return new JoddHttpMinishopMediaUploadRequestCustomizeExecutor((RequestHttp) requestHttp, respType, imgUrl);
case OK_HTTP:
- return new OkHttpMinishopMediaUploadRequestCustomizeExecutor(requestHttp, respType, imgUrl);
+ return new OkHttpMinishopMediaUploadRequestCustomizeExecutor((RequestHttp) requestHttp, respType, imgUrl);
default:
return null;
}
diff --git a/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/MinishopUploadRequestExecutor.java b/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/MinishopUploadRequestExecutor.java
index ee4608edf3..7b7f9ca460 100644
--- a/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/MinishopUploadRequestExecutor.java
+++ b/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/MinishopUploadRequestExecutor.java
@@ -1,11 +1,17 @@
package me.chanjar.weixin.common.util.http;
+import jodd.http.HttpConnectionProvider;
+import jodd.http.ProxyInfo;
import me.chanjar.weixin.common.bean.result.WxMinishopImageUploadResult;
import me.chanjar.weixin.common.enums.WxType;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.common.util.http.apache.ApacheMinishopMediaUploadRequestExecutor;
import me.chanjar.weixin.common.util.http.jodd.JoddHttpMinishopMediaUploadRequestExecutor;
import me.chanjar.weixin.common.util.http.okhttp.OkHttpMinishopMediaUploadRequestExecutor;
+import me.chanjar.weixin.common.util.http.okhttp.OkHttpProxyInfo;
+import okhttp3.OkHttpClient;
+import org.apache.http.HttpHost;
+import org.apache.http.impl.client.CloseableHttpClient;
import java.io.File;
import java.io.IOException;
@@ -13,7 +19,7 @@
public abstract class MinishopUploadRequestExecutor implements RequestExecutor {
protected RequestHttp requestHttp;
- public MinishopUploadRequestExecutor(RequestHttp requestHttp) {
+ public MinishopUploadRequestExecutor(RequestHttp requestHttp) {
this.requestHttp = requestHttp;
}
@@ -22,14 +28,15 @@ public void execute(String uri, File data, ResponseHandler create(RequestHttp requestHttp) {
+ @SuppressWarnings("unchecked")
+ public static RequestExecutor create(RequestHttp, ?> requestHttp) {
switch (requestHttp.getRequestType()) {
case APACHE_HTTP:
- return new ApacheMinishopMediaUploadRequestExecutor(requestHttp);
+ return new ApacheMinishopMediaUploadRequestExecutor((RequestHttp) requestHttp);
case JODD_HTTP:
- return new JoddHttpMinishopMediaUploadRequestExecutor(requestHttp);
+ return new JoddHttpMinishopMediaUploadRequestExecutor((RequestHttp) requestHttp);
case OK_HTTP:
- return new OkHttpMinishopMediaUploadRequestExecutor(requestHttp);
+ return new OkHttpMinishopMediaUploadRequestExecutor((RequestHttp) requestHttp);
default:
return null;
}
diff --git a/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/SimpleGetRequestExecutor.java b/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/SimpleGetRequestExecutor.java
index 266fd226e7..4f2ad64afc 100644
--- a/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/SimpleGetRequestExecutor.java
+++ b/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/SimpleGetRequestExecutor.java
@@ -1,11 +1,17 @@
package me.chanjar.weixin.common.util.http;
+import jodd.http.HttpConnectionProvider;
+import jodd.http.ProxyInfo;
import me.chanjar.weixin.common.enums.WxType;
import me.chanjar.weixin.common.error.WxError;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.common.util.http.apache.ApacheSimpleGetRequestExecutor;
import me.chanjar.weixin.common.util.http.jodd.JoddHttpSimpleGetRequestExecutor;
+import me.chanjar.weixin.common.util.http.okhttp.OkHttpProxyInfo;
import me.chanjar.weixin.common.util.http.okhttp.OkHttpSimpleGetRequestExecutor;
+import okhttp3.OkHttpClient;
+import org.apache.http.HttpHost;
+import org.apache.http.impl.client.CloseableHttpClient;
import java.io.IOException;
@@ -27,14 +33,15 @@ public void execute(String uri, String data, ResponseHandler handler, Wx
handler.handle(this.execute(uri, data, wxType));
}
+ @SuppressWarnings("unchecked")
public static RequestExecutor create(RequestHttp, ?> requestHttp) {
switch (requestHttp.getRequestType()) {
case APACHE_HTTP:
- return new ApacheSimpleGetRequestExecutor(requestHttp);
+ return new ApacheSimpleGetRequestExecutor((RequestHttp< CloseableHttpClient, HttpHost>) requestHttp);
case JODD_HTTP:
- return new JoddHttpSimpleGetRequestExecutor(requestHttp);
+ return new JoddHttpSimpleGetRequestExecutor((RequestHttp) requestHttp);
case OK_HTTP:
- return new OkHttpSimpleGetRequestExecutor(requestHttp);
+ return new OkHttpSimpleGetRequestExecutor((RequestHttp) requestHttp);
default:
throw new IllegalArgumentException("非法请求参数");
}
diff --git a/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/SimplePostRequestExecutor.java b/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/SimplePostRequestExecutor.java
index 0366b156af..68265ace52 100644
--- a/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/SimplePostRequestExecutor.java
+++ b/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/SimplePostRequestExecutor.java
@@ -1,11 +1,17 @@
package me.chanjar.weixin.common.util.http;
+import jodd.http.HttpConnectionProvider;
+import jodd.http.ProxyInfo;
import me.chanjar.weixin.common.enums.WxType;
import me.chanjar.weixin.common.error.WxError;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.common.util.http.apache.ApacheSimplePostRequestExecutor;
import me.chanjar.weixin.common.util.http.jodd.JoddHttpSimplePostRequestExecutor;
+import me.chanjar.weixin.common.util.http.okhttp.OkHttpProxyInfo;
import me.chanjar.weixin.common.util.http.okhttp.OkHttpSimplePostRequestExecutor;
+import okhttp3.OkHttpClient;
+import org.apache.http.HttpHost;
+import org.apache.http.impl.client.CloseableHttpClient;
import org.jetbrains.annotations.NotNull;
import java.io.IOException;
@@ -18,7 +24,7 @@
public abstract class SimplePostRequestExecutor implements RequestExecutor {
protected RequestHttp requestHttp;
- public SimplePostRequestExecutor(RequestHttp requestHttp) {
+ public SimplePostRequestExecutor(RequestHttp requestHttp) {
this.requestHttp = requestHttp;
}
@@ -28,14 +34,14 @@ public void execute(String uri, String data, ResponseHandler handler, Wx
handler.handle(this.execute(uri, data, wxType));
}
- public static RequestExecutor create(RequestHttp requestHttp) {
+ public static RequestExecutor create(RequestHttp, ?> requestHttp) {
switch (requestHttp.getRequestType()) {
case APACHE_HTTP:
- return new ApacheSimplePostRequestExecutor(requestHttp);
+ return new ApacheSimplePostRequestExecutor((RequestHttp) requestHttp);
case JODD_HTTP:
- return new JoddHttpSimplePostRequestExecutor(requestHttp);
+ return new JoddHttpSimplePostRequestExecutor((RequestHttp) requestHttp);
case OK_HTTP:
- return new OkHttpSimplePostRequestExecutor(requestHttp);
+ return new OkHttpSimplePostRequestExecutor((RequestHttp) requestHttp);
default:
throw new IllegalArgumentException("非法请求参数");
}
diff --git a/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/apache/ApacheMediaDownloadRequestExecutor.java b/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/apache/ApacheMediaDownloadRequestExecutor.java
index e2f4611439..9a53677489 100644
--- a/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/apache/ApacheMediaDownloadRequestExecutor.java
+++ b/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/apache/ApacheMediaDownloadRequestExecutor.java
@@ -28,7 +28,7 @@
* created on 2017/5/5
*/
public class ApacheMediaDownloadRequestExecutor extends BaseMediaDownloadRequestExecutor {
- public ApacheMediaDownloadRequestExecutor(RequestHttp requestHttp, File tmpDirFile) {
+ public ApacheMediaDownloadRequestExecutor(RequestHttp requestHttp, File tmpDirFile) {
super(requestHttp, tmpDirFile);
}
diff --git a/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/apache/ApacheMediaInputStreamUploadRequestExecutor.java b/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/apache/ApacheMediaInputStreamUploadRequestExecutor.java
index ef09812cb2..79e1a072bf 100644
--- a/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/apache/ApacheMediaInputStreamUploadRequestExecutor.java
+++ b/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/apache/ApacheMediaInputStreamUploadRequestExecutor.java
@@ -26,7 +26,7 @@
* created on 2022/02/15
*/
public class ApacheMediaInputStreamUploadRequestExecutor extends MediaInputStreamUploadRequestExecutor {
- public ApacheMediaInputStreamUploadRequestExecutor(RequestHttp requestHttp) {
+ public ApacheMediaInputStreamUploadRequestExecutor(RequestHttp requestHttp) {
super(requestHttp);
}
diff --git a/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/apache/ApacheMediaUploadRequestExecutor.java b/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/apache/ApacheMediaUploadRequestExecutor.java
index ca33b8641f..9887340cc6 100644
--- a/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/apache/ApacheMediaUploadRequestExecutor.java
+++ b/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/apache/ApacheMediaUploadRequestExecutor.java
@@ -22,7 +22,7 @@
* Created by ecoolper on 2017/5/5.
*/
public class ApacheMediaUploadRequestExecutor extends MediaUploadRequestExecutor {
- public ApacheMediaUploadRequestExecutor(RequestHttp requestHttp) {
+ public ApacheMediaUploadRequestExecutor(RequestHttp requestHttp) {
super(requestHttp);
}
diff --git a/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/apache/ApacheMinishopMediaUploadRequestCustomizeExecutor.java b/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/apache/ApacheMinishopMediaUploadRequestCustomizeExecutor.java
index 9af02af5d0..926ffef1d4 100644
--- a/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/apache/ApacheMinishopMediaUploadRequestCustomizeExecutor.java
+++ b/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/apache/ApacheMinishopMediaUploadRequestCustomizeExecutor.java
@@ -24,7 +24,7 @@
*/
@Slf4j
public class ApacheMinishopMediaUploadRequestCustomizeExecutor extends MinishopUploadRequestCustomizeExecutor {
- public ApacheMinishopMediaUploadRequestCustomizeExecutor(RequestHttp requestHttp, String respType, String imgUrl) {
+ public ApacheMinishopMediaUploadRequestCustomizeExecutor(RequestHttp requestHttp, String respType, String imgUrl) {
super(requestHttp, respType, imgUrl);
}
@@ -64,7 +64,7 @@ public WxMinishopImageUploadCustomizeResult execute(String uri, File file, WxTyp
if (error.getErrorCode() != 0) {
throw new WxErrorException(error);
}
- log.info("responseContent: " + responseContent);
+ log.info("responseContent: {}", responseContent);
return WxMinishopImageUploadCustomizeResult.fromJson(responseContent);
} finally {
httpPost.releaseConnection();
diff --git a/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/apache/ApacheMinishopMediaUploadRequestExecutor.java b/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/apache/ApacheMinishopMediaUploadRequestExecutor.java
index 7adc6a2cfa..b39a0e2b50 100644
--- a/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/apache/ApacheMinishopMediaUploadRequestExecutor.java
+++ b/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/apache/ApacheMinishopMediaUploadRequestExecutor.java
@@ -5,7 +5,6 @@
import me.chanjar.weixin.common.enums.WxType;
import me.chanjar.weixin.common.error.WxError;
import me.chanjar.weixin.common.error.WxErrorException;
-import me.chanjar.weixin.common.util.http.MediaUploadRequestExecutor;
import me.chanjar.weixin.common.util.http.MinishopUploadRequestExecutor;
import me.chanjar.weixin.common.util.http.RequestHttp;
import org.apache.http.HttpEntity;
@@ -25,7 +24,7 @@
*/
@Slf4j
public class ApacheMinishopMediaUploadRequestExecutor extends MinishopUploadRequestExecutor {
- public ApacheMinishopMediaUploadRequestExecutor(RequestHttp requestHttp) {
+ public ApacheMinishopMediaUploadRequestExecutor(RequestHttp requestHttp) {
super(requestHttp);
}
@@ -50,7 +49,7 @@ public WxMinishopImageUploadResult execute(String uri, File file, WxType wxType)
if (error.getErrorCode() != 0) {
throw new WxErrorException(error);
}
- log.info("responseContent: " + responseContent);
+ log.info("responseContent: {}", responseContent);
return WxMinishopImageUploadResult.fromJson(responseContent);
} finally {
httpPost.releaseConnection();
diff --git a/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/apache/ApacheSimpleGetRequestExecutor.java b/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/apache/ApacheSimpleGetRequestExecutor.java
index be0784b076..5e831dc059 100644
--- a/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/apache/ApacheSimpleGetRequestExecutor.java
+++ b/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/apache/ApacheSimpleGetRequestExecutor.java
@@ -19,7 +19,7 @@
* created on 2017/5/4
*/
public class ApacheSimpleGetRequestExecutor extends SimpleGetRequestExecutor {
- public ApacheSimpleGetRequestExecutor(RequestHttp requestHttp) {
+ public ApacheSimpleGetRequestExecutor(RequestHttp requestHttp) {
super(requestHttp);
}
diff --git a/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/apache/ApacheSimplePostRequestExecutor.java b/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/apache/ApacheSimplePostRequestExecutor.java
index 52c8caaf3d..b3533fe109 100644
--- a/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/apache/ApacheSimplePostRequestExecutor.java
+++ b/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/apache/ApacheSimplePostRequestExecutor.java
@@ -21,7 +21,7 @@
* created on 2017/5/4
*/
public class ApacheSimplePostRequestExecutor extends SimplePostRequestExecutor {
- public ApacheSimplePostRequestExecutor(RequestHttp requestHttp) {
+ public ApacheSimplePostRequestExecutor(RequestHttp requestHttp) {
super(requestHttp);
}
diff --git a/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/apache/DefaultApacheHttpClientBuilder.java b/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/apache/DefaultApacheHttpClientBuilder.java
index 12f04ba20c..d071dc97d2 100644
--- a/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/apache/DefaultApacheHttpClientBuilder.java
+++ b/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/apache/DefaultApacheHttpClientBuilder.java
@@ -25,17 +25,13 @@
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
-import org.apache.http.protocol.HttpContext;
import org.apache.http.ssl.SSLContexts;
import javax.annotation.concurrent.NotThreadSafe;
import javax.net.ssl.SSLContext;
-import java.io.IOException;
import java.security.KeyManagementException;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
-import java.security.cert.CertificateException;
-import java.security.cert.X509Certificate;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;
diff --git a/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/jodd/JoddHttpMediaDownloadRequestExecutor.java b/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/jodd/JoddHttpMediaDownloadRequestExecutor.java
index 920cf2d03b..5d09ee7e1c 100644
--- a/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/jodd/JoddHttpMediaDownloadRequestExecutor.java
+++ b/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/jodd/JoddHttpMediaDownloadRequestExecutor.java
@@ -4,7 +4,6 @@
import jodd.http.HttpRequest;
import jodd.http.HttpResponse;
import jodd.http.ProxyInfo;
-import jodd.util.StringPool;
import me.chanjar.weixin.common.enums.WxType;
import me.chanjar.weixin.common.error.WxError;
import me.chanjar.weixin.common.error.WxErrorException;
@@ -28,7 +27,7 @@
* created on 2017/5/5
*/
public class JoddHttpMediaDownloadRequestExecutor extends BaseMediaDownloadRequestExecutor {
- public JoddHttpMediaDownloadRequestExecutor(RequestHttp requestHttp, File tmpDirFile) {
+ public JoddHttpMediaDownloadRequestExecutor(RequestHttp requestHttp, File tmpDirFile) {
super(requestHttp, tmpDirFile);
}
diff --git a/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/jodd/JoddHttpMediaInputStreamUploadRequestExecutor.java b/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/jodd/JoddHttpMediaInputStreamUploadRequestExecutor.java
index 311b7c49c5..915db21c65 100644
--- a/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/jodd/JoddHttpMediaInputStreamUploadRequestExecutor.java
+++ b/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/jodd/JoddHttpMediaInputStreamUploadRequestExecutor.java
@@ -25,7 +25,7 @@
* created on 2022/02/15
*/
public class JoddHttpMediaInputStreamUploadRequestExecutor extends MediaInputStreamUploadRequestExecutor {
- public JoddHttpMediaInputStreamUploadRequestExecutor(RequestHttp requestHttp) {
+ public JoddHttpMediaInputStreamUploadRequestExecutor(RequestHttp requestHttp) {
super(requestHttp);
}
diff --git a/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/jodd/JoddHttpMediaUploadRequestExecutor.java b/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/jodd/JoddHttpMediaUploadRequestExecutor.java
index 876caa29fb..1ed59a71da 100644
--- a/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/jodd/JoddHttpMediaUploadRequestExecutor.java
+++ b/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/jodd/JoddHttpMediaUploadRequestExecutor.java
@@ -4,7 +4,6 @@
import jodd.http.HttpRequest;
import jodd.http.HttpResponse;
import jodd.http.ProxyInfo;
-import jodd.util.StringPool;
import me.chanjar.weixin.common.enums.WxType;
import me.chanjar.weixin.common.bean.result.WxMediaUploadResult;
import me.chanjar.weixin.common.error.WxError;
@@ -23,7 +22,7 @@
* created on 2017/5/5
*/
public class JoddHttpMediaUploadRequestExecutor extends MediaUploadRequestExecutor {
- public JoddHttpMediaUploadRequestExecutor(RequestHttp requestHttp) {
+ public JoddHttpMediaUploadRequestExecutor(RequestHttp requestHttp) {
super(requestHttp);
}
diff --git a/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/jodd/JoddHttpMinishopMediaUploadRequestCustomizeExecutor.java b/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/jodd/JoddHttpMinishopMediaUploadRequestCustomizeExecutor.java
index 1d6f24fa2a..66074d8103 100644
--- a/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/jodd/JoddHttpMinishopMediaUploadRequestCustomizeExecutor.java
+++ b/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/jodd/JoddHttpMinishopMediaUploadRequestCustomizeExecutor.java
@@ -22,7 +22,7 @@
*/
@Slf4j
public class JoddHttpMinishopMediaUploadRequestCustomizeExecutor extends MinishopUploadRequestCustomizeExecutor {
- public JoddHttpMinishopMediaUploadRequestCustomizeExecutor(RequestHttp requestHttp, String respType, String imgUrl) {
+ public JoddHttpMinishopMediaUploadRequestCustomizeExecutor(RequestHttp requestHttp, String respType, String imgUrl) {
super(requestHttp, respType, imgUrl);
}
@@ -51,7 +51,7 @@ public WxMinishopImageUploadCustomizeResult execute(String uri, File file, WxTyp
if (error.getErrorCode() != 0) {
throw new WxErrorException(error);
}
- log.info("responseContent: " + responseContent);
+ log.info("responseContent: {}", responseContent);
return WxMinishopImageUploadCustomizeResult.fromJson(responseContent);
}
diff --git a/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/jodd/JoddHttpMinishopMediaUploadRequestExecutor.java b/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/jodd/JoddHttpMinishopMediaUploadRequestExecutor.java
index 4cb9c50ee0..c7c35dd798 100644
--- a/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/jodd/JoddHttpMinishopMediaUploadRequestExecutor.java
+++ b/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/jodd/JoddHttpMinishopMediaUploadRequestExecutor.java
@@ -5,12 +5,10 @@
import jodd.http.HttpResponse;
import jodd.http.ProxyInfo;
import lombok.extern.slf4j.Slf4j;
-import me.chanjar.weixin.common.bean.result.WxMediaUploadResult;
import me.chanjar.weixin.common.bean.result.WxMinishopImageUploadResult;
import me.chanjar.weixin.common.enums.WxType;
import me.chanjar.weixin.common.error.WxError;
import me.chanjar.weixin.common.error.WxErrorException;
-import me.chanjar.weixin.common.util.http.MediaUploadRequestExecutor;
import me.chanjar.weixin.common.util.http.MinishopUploadRequestExecutor;
import me.chanjar.weixin.common.util.http.RequestHttp;
@@ -26,7 +24,7 @@
*/
@Slf4j
public class JoddHttpMinishopMediaUploadRequestExecutor extends MinishopUploadRequestExecutor {
- public JoddHttpMinishopMediaUploadRequestExecutor(RequestHttp requestHttp) {
+ public JoddHttpMinishopMediaUploadRequestExecutor(RequestHttp requestHttp) {
super(requestHttp);
}
@@ -46,7 +44,7 @@ public WxMinishopImageUploadResult execute(String uri, File file, WxType wxType)
if (error.getErrorCode() != 0) {
throw new WxErrorException(error);
}
- log.info("responseContent: " + responseContent);
+ log.info("responseContent: {}", responseContent);
return WxMinishopImageUploadResult.fromJson(responseContent);
}
diff --git a/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/jodd/JoddHttpSimpleGetRequestExecutor.java b/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/jodd/JoddHttpSimpleGetRequestExecutor.java
index 869ea8c04e..ed8288b04f 100644
--- a/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/jodd/JoddHttpSimpleGetRequestExecutor.java
+++ b/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/jodd/JoddHttpSimpleGetRequestExecutor.java
@@ -4,7 +4,6 @@
import jodd.http.HttpRequest;
import jodd.http.HttpResponse;
import jodd.http.ProxyInfo;
-import jodd.util.StringPool;
import me.chanjar.weixin.common.enums.WxType;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.common.util.http.RequestHttp;
@@ -20,7 +19,7 @@
* created on 2017/5/4
*/
public class JoddHttpSimpleGetRequestExecutor extends SimpleGetRequestExecutor