Skip to content

【企业微信】重载获取企业标签库接口,添加groupId数组参数 #2181

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,20 @@ WxCpExternalContactBatchInfo getContactDetailBatch(String userId, String cursor,
*/
WxCpUserExternalTagGroupList getCorpTagList(String[] tagId) throws WxErrorException;

/**
* <pre>
* 企业可通过此接口获取企业客户标签详情。
* 若tag_id和group_id均为空,则返回所有标签。
* 同时传递tag_id和group_id时,忽略tag_id,仅以group_id作为过滤条件。
* </pre>
*
* @param tagId the tag id
* @param groupId the tagGroup id
* @return corp tag list
* @throws WxErrorException the wx error exception
*/
WxCpUserExternalTagGroupList getCorpTagList(String[] tagId, String[] groupId) throws WxErrorException;

/**
* <pre>
* 企业可通过此接口向客户标签库中添加新的标签组和标签,每个企业最多可配置3000个企业标签。
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,20 @@ public WxCpUserExternalTagGroupList getCorpTagList(String[] tagId) throws WxErro
return WxCpUserExternalTagGroupList.fromJson(result);
}

@Override
public WxCpUserExternalTagGroupList getCorpTagList(String[] tagId, String[] groupId) throws WxErrorException {
JsonObject json = new JsonObject();
if (ArrayUtils.isNotEmpty(tagId)) {
json.add("tag_id", new Gson().toJsonTree(tagId).getAsJsonArray());
}
if (ArrayUtils.isNotEmpty(groupId)) {
json.add("group_id", new Gson().toJsonTree(groupId).getAsJsonArray());
}
final String url = this.mainService.getWxCpConfigStorage().getApiUrl(GET_CORP_TAG_LIST);
final String result = this.mainService.post(url, json.toString());
return WxCpUserExternalTagGroupList.fromJson(result);
}

@Override
public WxCpUserExternalTagGroupInfo addCorpTag(WxCpUserExternalTagGroupInfo tagGroup) throws WxErrorException {

Expand Down