From 4f08aad65ced116c6f5b915966c4b2b4c8a3d810 Mon Sep 17 00:00:00 2001 From: gxh0797 <350488995@qq.com> Date: Wed, 27 Jul 2022 19:30:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=81=E5=BE=AE=E6=8C=89=E9=92=AE=E4=BA=A4?= =?UTF-8?q?=E4=BA=92=E6=80=A7=E6=B2=A1=E6=9C=89=E6=8C=89=E9=92=AE=E4=B8=8D?= =?UTF-8?q?=E6=94=AF=E6=8C=81URL=E6=96=B9=E5=BC=8F=20#2729=20=E5=AE=98?= =?UTF-8?q?=E6=96=B9=E6=96=87=E6=A1=A3=E5=9C=B0=E5=9D=80=20https://develop?= =?UTF-8?q?er.work.weixin.qq.com/document/path/90236#%E6%8C%89%E9%92%AE%E4?= =?UTF-8?q?%BA%A4%E4%BA%92%E5%9E%8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cp/bean/message/WxCpMessageSendResult.java | 6 ++++++ .../cp/bean/templatecard/TemplateCardButton.java | 16 ++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/message/WxCpMessageSendResult.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/message/WxCpMessageSendResult.java index 6b02941dd7..fdb72c7a74 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/message/WxCpMessageSendResult.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/message/WxCpMessageSendResult.java @@ -47,6 +47,12 @@ public static WxCpMessageSendResult fromJson(String json) { @SerializedName("msgid") private String msgId; + /** + * 仅消息类型为“按钮交互型”,“投票选择型”和“多项选择型”的模板卡片消息返回,应用可使用response_code调用更新模版卡片消息接口,24小时内有效,且只能使用一次 + */ + @SerializedName("response_code") + private String responseCode; + public List getInvalidUserList() { return this.content2List(this.invalidUser); } diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/templatecard/TemplateCardButton.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/templatecard/TemplateCardButton.java index 28722c8d75..df7812fd15 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/templatecard/TemplateCardButton.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/templatecard/TemplateCardButton.java @@ -34,6 +34,18 @@ public class TemplateCardButton implements Serializable { */ private String key; + /** + * 按钮点击事件类型,0 或不填代表回调点击事件,1 代表跳转url + */ + private int type; + + /** + * 跳转事件的url,button_list.type是1时必填 + */ + private String url; + + + public JsonObject toJson() { JsonObject btnObject = new JsonObject(); @@ -44,6 +56,10 @@ public JsonObject toJson() { btnObject.addProperty("style", this.getStyle()); } btnObject.addProperty("key", this.getKey()); + btnObject.addProperty("type", this.getType()); + if (null != this.getUrl()) { + btnObject.addProperty("url", this.getUrl()); + } return btnObject; } }