Skip to content
Open
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 @@ -102,6 +102,20 @@ public class WxSignQueryResult extends BaseWxPayResult implements Serializable {
@XStreamAlias("openid")
private String openId;

/**
* 变更类型, ADD:签约,DELETE:解约
* 签约/解约回调通知时返回
*/
@XStreamAlias("change_type")
private String changeType;
Comment on lines +109 to +110
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve all-args constructor binary compatibility

Adding new fields to this class changes the Lombok-generated @AllArgsConstructor signature, so downstream code compiled against the previous 11-argument constructor will hit NoSuchMethodError at runtime after upgrading this library jar. This is a backward-compatibility regression for consumers who instantiate WxSignQueryResult directly; consider keeping the old constructor explicitly (or avoiding a public all-args API) before adding new constructor parameters.

Useful? React with 👍 / 👎.


/**
* 操作时间
* 签约/解约回调通知时返回
*/
@XStreamAlias("operate_time")
private String operateTime;

Copy link

Copilot AI Mar 29, 2026

Choose a reason for hiding this comment

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

该类使用了 Lombok 的 @AllArgsConstructor;新增 changeType/operateTime 字段会改变全参构造函数签名,导致依赖旧构造函数的调用方在编译期或运行期出现不兼容(NoSuchMethodError)。为保持向后兼容,建议显式补一个与旧字段列表一致的构造函数并标注 @deprecated(内部委托到新的全参构造),或移除/限制全参构造函数的对外暴露(例如改为 Builder)。

Suggested change
/**
* 兼容旧版本的构造函数不包含 changeTypeoperateTime 字段)。
* <p>
* 新增字段后为保持向后兼容而保留旧签名内部委托到新的全参构造函数
*
* @deprecated 建议使用包含所有字段的新构造函数或其他构建方式
*/
@Deprecated
public WxSignQueryResult(String contractId,
String planId,
Long requestSerial,
String contractCode,
String contractDisplayAccount,
Integer contractState,
String contractSignedTime,
String contractExpiredTime,
String contractTerminatedTime,
Integer contractTerminatedMode,
String contractTerminationRemark,
String openId) {
this(contractId, planId, requestSerial, contractCode, contractDisplayAccount,
contractState, contractSignedTime, contractExpiredTime, contractTerminatedTime,
contractTerminatedMode, contractTerminationRemark, openId, null, null);
}

Copilot uses AI. Check for mistakes.

@Override
protected void loadXml(Document d) {
Expand All @@ -117,6 +131,8 @@ protected void loadXml(Document d) {
contractTerminatedMode = readXmlInteger(d, "contract_termination_mode");
contractTerminationRemark = readXmlString(d, "contract_termination_remark");
openId = readXmlString(d, "openid");
changeType = readXmlString(d, "change_type");
operateTime = readXmlString(d, "operate_time");
Comment on lines 131 to +135
Copy link

Copilot AI Mar 29, 2026

Choose a reason for hiding this comment

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

新增字段的 XML 解析逻辑(change_type/operate_time)目前没有对应的单元测试覆盖。仓库中已存在 WxSignQueryResultTest 且会开启 XmlConfig.fastMode 覆盖 loadXml 分支,建议补充包含 change_type/operate_time 的回调 XML 样例并断言 changeType/operateTime 能被正确解析(同时可保留字段缺失时为 null 的断言)。

Copilot uses AI. Check for mistakes.
}

@Override
Expand Down
Loading