-
-
Notifications
You must be signed in to change notification settings - Fork 9.1k
fix: WxSignQueryResult 缺少 change_type 和 operate_time 字段导致签约回调无法判断类型 #3942
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
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -102,6 +102,20 @@ public class WxSignQueryResult extends BaseWxPayResult implements Serializable { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| @XStreamAlias("openid") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private String openId; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /** | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| * 变更类型, ADD:签约,DELETE:解约 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| * 签约/解约回调通知时返回 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @XStreamAlias("change_type") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private String changeType; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /** | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| * 操作时间 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| * 签约/解约回调通知时返回 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @XStreamAlias("operate_time") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private String operateTime; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /** | |
| * 兼容旧版本的构造函数(不包含 changeType、operateTime 字段)。 | |
| * <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
AI
Mar 29, 2026
There was a problem hiding this comment.
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 的断言)。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding new fields to this class changes the Lombok-generated
@AllArgsConstructorsignature, so downstream code compiled against the previous 11-argument constructor will hitNoSuchMethodErrorat runtime after upgrading this library jar. This is a backward-compatibility regression for consumers who instantiateWxSignQueryResultdirectly; consider keeping the old constructor explicitly (or avoiding a public all-args API) before adding new constructor parameters.Useful? React with 👍 / 👎.