🎨 #3541【企业微信】增加设置WebView型应用在用户工作台展示的参数

This commit is contained in:
谈笑 2025-04-07 07:01:35 +00:00 committed by Binary Wang
parent b6c3d74cba
commit b44dd2e347

View File

@ -13,7 +13,6 @@ 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.
@ -38,7 +37,7 @@ public class WxCpAgentWorkBench implements Serializable {
/**
* 用户的userIds
*/
private Set<String> userIds;
private List<String> useridList;
/**
* 应用id
*/
@ -64,6 +63,15 @@ public class WxCpAgentWorkBench implements Serializable {
* 参考示例<a href="wxwork://openurl?url=https%3A%2F%2Fwork.weixin.qq.com%2F">今日要闻</a>
*/
private Boolean enableWebviewClick;
/**
* 高度可以有两种选择single_row与double_row当为single_row时高度为106px如果隐藏标题则为147px
* 当为double_row时高度固定为171px如果隐藏标题则为212px默认值为double_row
*/
private String height;
/**
* 是否要隐藏展示了应用名称的标题部分默认值为false
*/
private Boolean hideTitle;
private List<WorkBenchKeyData> keyDataList;
@ -107,7 +115,7 @@ public class WxCpAgentWorkBench implements Serializable {
public String toBatchUserDataString() {
JsonObject userDataObject = new JsonObject();
userDataObject.addProperty("agentid", this.agentId);
JsonArray useridList = WxGsonBuilder.create().toJsonTree(this.userIds).getAsJsonArray();
JsonArray useridList = WxGsonBuilder.create().toJsonTree(this.useridList).getAsJsonArray();
userDataObject.add("userid_list", useridList);
this.handleBatch(userDataObject);
return userDataObject.toString();
@ -160,9 +168,9 @@ public class WxCpAgentWorkBench implements Serializable {
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);
}
webview.addProperty("height", this.height);
webview.addProperty("hide_title", this.hideTitle);
templateObject.add("webview", webview);
break;
}
@ -228,9 +236,9 @@ public class WxCpAgentWorkBench implements Serializable {
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);
}
webview.addProperty("height", this.height);
webview.addProperty("hide_title", this.hideTitle);
JsonObject dataObject = new JsonObject();
dataObject.addProperty("type", WxCpConsts.WorkBenchType.WEBVIEW);
dataObject.add("webview", webview);