Skip to content

Commit

Permalink
🎨 #2729 【企业微信】发送应用消息时完善对按钮交互型卡片消息的支持
Browse files Browse the repository at this point in the history
  • Loading branch information
gxh0797 authored Jul 27, 2022
1 parent 18a79b5 commit 44ce1e9
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> getInvalidUserList() {
return this.content2List(this.invalidUser);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -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;
}
}

0 comments on commit 44ce1e9

Please sign in to comment.