Skip to content

Commit 4f08aad

Browse files
gxh0797guoxianhui
authored and
guoxianhui
committed
1 parent d056cc8 commit 4f08aad

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/message/WxCpMessageSendResult.java

+6
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@ public static WxCpMessageSendResult fromJson(String json) {
4747
@SerializedName("msgid")
4848
private String msgId;
4949

50+
/**
51+
* 仅消息类型为“按钮交互型”,“投票选择型”和“多项选择型”的模板卡片消息返回,应用可使用response_code调用更新模版卡片消息接口,24小时内有效,且只能使用一次
52+
*/
53+
@SerializedName("response_code")
54+
private String responseCode;
55+
5056
public List<String> getInvalidUserList() {
5157
return this.content2List(this.invalidUser);
5258
}

weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/templatecard/TemplateCardButton.java

+16
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,18 @@ public class TemplateCardButton implements Serializable {
3434
*/
3535
private String key;
3636

37+
/**
38+
* 按钮点击事件类型,0 或不填代表回调点击事件,1 代表跳转url
39+
*/
40+
private int type;
41+
42+
/**
43+
* 跳转事件的url,button_list.type是1时必填
44+
*/
45+
private String url;
46+
47+
48+
3749
public JsonObject toJson() {
3850
JsonObject btnObject = new JsonObject();
3951

@@ -44,6 +56,10 @@ public JsonObject toJson() {
4456
btnObject.addProperty("style", this.getStyle());
4557
}
4658
btnObject.addProperty("key", this.getKey());
59+
btnObject.addProperty("type", this.getType());
60+
if (null != this.getUrl()) {
61+
btnObject.addProperty("url", this.getUrl());
62+
}
4763
return btnObject;
4864
}
4965
}

0 commit comments

Comments
 (0)