From 5604a16ae89dcbfb2cf4db45d2f908bdc6a72758 Mon Sep 17 00:00:00 2001
From: Binary Wang
Date: Sun, 23 Mar 2025 20:00:52 +0800
Subject: [PATCH 1/7] :art: fix doc
---
CONTRIBUTING.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index c70396482..0b16b4779 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 2/7] =?UTF-8?q?:art:=20#3532=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=E6=94=AF=E4=BB=98?=
=?UTF-8?q?=E9=80=9A=E7=9F=A5=E5=9B=9E=E8=B0=83=E8=A7=A3=E6=9E=90=E6=96=B9?=
=?UTF-8?q?=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 077562f03..05d1f8c22 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 abstract class BaseWxPayServiceImpl implements WxPayService {
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 3/7] =?UTF-8?q?:art:=20#3530=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=E6=9C=AA=E8=AE=BE?=
=?UTF-8?q?=E7=BD=AE=E5=B9=B3=E5=8F=B0=E8=AF=81=E4=B9=A6=E5=BC=95=E8=B5=B7?=
=?UTF-8?q?=E7=9A=84v3=E8=AF=B7=E6=B1=82=E6=9E=84=E9=80=A0=E5=BC=82?=
=?UTF-8?q?=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 dedbc6413..7a14ea152 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 class WxPayConfig {
}
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 45f76818c..8c9c4f356 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 class PublicCertificateVerifier implements 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 4/7] =?UTF-8?q?:art:=20#3538=20=E3=80=90=E5=BE=AE=E4=BF=A1?=
=?UTF-8?q?=E6=94=AF=E4=BB=98=E3=80=91V3=E6=8E=A5=E5=8F=A3=E5=A2=9E?=
=?UTF-8?q?=E5=8A=A0=E5=AE=9E=E5=90=8D=E6=94=AF=E4=BB=98=E5=8F=82=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 98dae388e..8ac588de8 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 class WxPayUnifiedOrderV3Request implements Serializable {
*/
@SerializedName(value = "openid")
private String openid;
+
+ /**
+ * 实名支付用户身份标识
+ */
+ @SerializedName(value = "identity")
+ private Identity identity;
}
@Data
@@ -572,4 +578,36 @@ public class WxPayUnifiedOrderV3Request 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 5/7] =?UTF-8?q?:art:=20#3534=20=E4=B8=BAconnectionRequestT?=
=?UTF-8?q?imeout=E8=AE=BE=E7=BD=AE=E9=BB=98=E8=AE=A4=E5=80=BC=EF=BC=8C?=
=?UTF-8?q?=E9=81=BF=E5=85=8D=E5=BC=80=E5=8F=91=E8=80=85=E5=9C=A8=E8=99=9A?=
=?UTF-8?q?=E6=8B=9F=E7=BA=BF=E7=A8=8B=E4=B8=AD=E8=B0=83=E7=94=A8=E6=A1=86?=
=?UTF-8?q?=E6=9E=B6=E7=9A=84httpClient=E6=97=B6=E9=80=A0=E6=88=90?=
=?UTF-8?q?=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 4c06f5168..12f04ba20 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 6/7] =?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 05e8f2e0a..342224eff 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 class WxMaImmediateDeliveryServiceImpl implements WxMaImmediateDeliverySe
@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 d61ade73c..30d52b17c 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 class WxMaApiUrlConstants {
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 7/7] =?UTF-8?q?:new:=20#3529=20=E3=80=90=E4=BC=81=E4=B8=9A?=
=?UTF-8?q?=E5=BE=AE=E4=BF=A1=E3=80=91=E5=A2=9E=E5=8A=A0=E6=89=B9=E9=87=8F?=
=?UTF-8?q?=E8=AE=BE=E7=BD=AE=E5=BA=94=E7=94=A8=E5=9C=A8=E7=94=A8=E6=88=B7?=
=?UTF-8?q?=E5=B7=A5=E4=BD=9C=E5=8F=B0=E5=B1=95=E7=A4=BA=E7=9A=84=E6=95=B0?=
=?UTF-8?q?=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 c50aa2f5f..67c57a8a8 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 bb5c191e9..b0bbb3864 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 class WxCpAgentWorkBenchServiceImpl implements WxCpAgentWorkBenchService
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 e74173ee3..6687e8761 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.AllArgsConstructor;
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 class WxCpAgentWorkBench implements Serializable {
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 @@ public class WxCpAgentWorkBench implements Serializable {
}
}
+ /**
+ * 处理不用类型的工作台数据
+ */
+ 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 3aecf7212..d70f0ff4c 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 @@ public interface WxCpApiPathConsts {
* 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";
}
/**