🎨 #2729 【企业微信】发送应用消息时完善对按钮交互型卡片消息的支持

This commit is contained in:
Xianhui Guo 2022-07-27 20:04:56 +08:00 committed by GitHub
parent 18a79b5b6c
commit 44ce1e9fbc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 0 deletions

View File

@ -47,6 +47,12 @@ public class WxCpMessageSendResult implements Serializable {
@SerializedName("msgid")
private String msgId;
/**
* 仅消息类型为按钮交互型投票选择型多项选择型的模板卡片消息返回应用可使用response_code调用更新模版卡片消息接口24小时内有效且只能使用一次
*/
@SerializedName("response_code")
private String responseCode;
public List<String> getInvalidUserList() {
return this.content2List(this.invalidUser);
}

View File

@ -34,6 +34,18 @@ public class TemplateCardButton implements Serializable {
*/
private String key;
/**
* 按钮点击事件类型0 或不填代表回调点击事件1 代表跳转url
*/
private int type;
/**
* 跳转事件的urlbutton_list.type是1时必填
*/
private String url;
public JsonObject toJson() {
JsonObject btnObject = new JsonObject();
@ -44,6 +56,10 @@ public class TemplateCardButton implements Serializable {
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;
}
}