Skip to content
Open
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 @@ -6,6 +6,7 @@
import lombok.Data;
import lombok.NoArgsConstructor;
import me.chanjar.weixin.cp.bean.external.msg.Attachment;
import me.chanjar.weixin.cp.bean.external.msg.TagFilter;
import me.chanjar.weixin.cp.bean.external.msg.Text;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;

Expand Down Expand Up @@ -43,6 +44,12 @@ public class WxCpMsgTemplate implements Serializable {
@SerializedName("chat_id_list")
private List<String> chatIdList;

/**
* 要进行群发的客户标签列表,同组标签之间按或关系进行筛选,不同组标签按且关系筛选,每组最多指定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 TagFilter tagFilter;
Comment on lines +47 to +51
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.

/**
* 发送企业群发消息的成员userid,当类型为发送给客户群时必填
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package me.chanjar.weixin.cp.bean.external.msg;

import com.google.gson.annotations.SerializedName;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

/**
* 群发的客户标签
*
* @author <a href="https://github.com/Winnie-by996">Winnie</a>
*/
@Data
public class TagFilter implements Serializable {
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.

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package me.chanjar.weixin.cp.bean.external.msg;

import com.google.gson.annotations.SerializedName;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

/**
* 客户标签列表
*
* @author <a href="https://github.com/Winnie-by996">Winnie</a>
*/
@Data
public class TagList implements Serializable {
private static final long serialVersionUID = 1133054307780310675L;

@SerializedName("tag_list")
private List<String> tagList;
}