Skip to content

【企业微信】新增创建企业群发API接口支持tag_filter参数设置。#3920

Open
Winnie-by996 wants to merge 1 commit intobinarywang:developfrom
Winnie-by996:企业微信创建群聊会话

Hidden character warning

The head ref may contain hidden characters: "\u4f01\u4e1a\u5fae\u4fe1\u521b\u5efa\u7fa4\u804a\u4f1a\u8bdd"
Open

【企业微信】新增创建企业群发API接口支持tag_filter参数设置。#3920
Winnie-by996 wants to merge 1 commit intobinarywang:developfrom
Winnie-by996:企业微信创建群聊会话

Conversation

@Winnie-by996
Copy link
Contributor

@Winnie-by996 Winnie-by996 commented Mar 10, 2026

feat: WxCpMsgTemplate 增加tag_filter支持.

@augmentcode
Copy link

augmentcode bot commented Mar 10, 2026

🤖 Augment PR Summary

Summary: 为企业微信“创建企业群发”请求模型补充按客户标签筛选能力(tag_filter)。

Changes:

  • WxCpMsgTemplate 中新增 tagFilter 字段并映射为 tag_filter
  • 新增 TagFilter/TagListgroup_list/tag_list 结构
Technical Notes: 该字段用于 add_msg_template 请求体,结构对齐官方文档 tag_filter.group_list[].tag_list

🤖 Was this summary useful? React with 👍 or 👎

Copy link

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 2 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

/**
* 要进行群发的客户标签列表,同组标签之间按或关系进行筛选,不同组标签按且关系筛选,每组最多指定100个标签,支持规则组标签
*/
@SerializedName("tag_filter")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

根据官方“创建企业群发”文档,sender/external_userid/tag_filter 不能同时为空,且当指定 external_useridtag_filter 不生效。建议在 tagFilter(以及相关字段)的注释中补充这些约束,避免调用方误用。

Severity: low

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

private static final long serialVersionUID = -6756444546744020234L;

@SerializedName("group_list")
private List<TagList> groupList;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tag_filter 的 JSON 层级(group_list[].tag_list)比较容易在后续重构中回归,考虑补一个简单的序列化单测断言 WxCpMsgTemplate.toJson() 输出结构与文档示例一致。

Severity: low

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

该 PR 为企业微信「创建企业群发」消息模板对象补充 tag_filter 参数的数据结构与序列化字段支持,以便调用方在群发任务创建时按客户标签规则进行筛选。

Changes:

  • 新增 TagFilter / TagList 两个 bean,用于承载 tag_filter.group_list[].tag_list 的 JSON 结构
  • WxCpMsgTemplate 中新增 tagFilter 字段并增加 @SerializedName("tag_filter") 映射

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/msg/TagList.java 新增标签列表承载对象(tag_list
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/msg/TagFilter.java 新增标签筛选承载对象(group_list
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpMsgTemplate.java 模板新增 tag_filter 字段以支持按标签筛选

Comment on lines +47 to +51
/**
* 要进行群发的客户标签列表,同组标签之间按或关系进行筛选,不同组标签按且关系筛选,每组最多指定100个标签,支持规则组标签
*/
@SerializedName("tag_filter")
private TagFilter tagFilter;
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里新增 tagFilter 字段会导致 Lombok 生成的 @AllArgsConstructor 构造函数签名发生变化,从而对依赖 new WxCpMsgTemplate(...) 的存量调用方造成编译期破坏(SDK 公共 API 兼容性问题)。建议保留一个与此前参数列表一致的显式构造函数并标注 @deprecated(内部委托到新构造/为 tagFilter 赋默认值 null),或评估是否可以移除/替换 @AllArgsConstructor 以避免后续继续出现类似破坏性变更。

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants