Skip to content

fix: 消除旧通知头空值重载歧义 - #4096

Merged
binarywang merged 3 commits into
developfrom
agent/fix-notify-header-null
Aug 18, 2026
Merged

fix: 消除旧通知头空值重载歧义#4096
binarywang merged 3 commits into
developfrom
agent/fix-notify-header-null

Conversation

@binarywang

Copy link
Copy Markdown
Owner

背景

#4095 为旧版退款、提现通知解析添加 bean.ecommerce.SignatureHeader 重载后,parse*NotifyResult(notifyData, null) 因两个无关参数类型而出现编译期重载歧义。

变更

  • 使旧 bean.ecommerce.SignatureHeader 继承新的 bean.notify.SignatureHeader
  • 保留旧字段 signedserialNo,并继续通过适配器映射到新的 signatureserial
  • 旧参数类型因此成为更具体的重载类型,原有 null 调用不再二义
  • 增加类型关系与字段映射回归测试

验证

  • git diff --check
  • 当前环境未安装 Maven;请由 CI 运行模块测试。

@binarywang
binarywang marked this pull request as ready for review August 18, 2026 04:54
Copilot AI lite review requested due to automatic review settings August 18, 2026 04:54
@augmentcode

augmentcode Bot commented Aug 18, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

摘要:本 PR 修复旧版电商通知头与新版通知头重载共存时,null 实参造成的编译期重载歧义。

  • 让废弃的 `bean.ecommerce.SignatureHeader` 继承统一的 `bean.notify.SignatureHeader`。
  • 两处模型改用 Lombok `@SuperBuilder`,使子类构建器可设置继承的时间戳和随机串字段。
  • 保留旧版 `signed`、`serialNo` 字段,并通过现有适配器映射到统一模型的 `signature`、`serial`。
  • 新增兼容性测试,验证类型层级、构建字段与适配后的字段值。
  • 该类型关系使旧通知头成为更具体的重载参数类型,从而保持旧的 `null` 调用可编译。

🤖 Was this summary useful? React with 👍 or 👎

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown

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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

该 PR 针对 weixin-java-pay 电商收付通旧版通知解析兼容层,在引入旧 bean.ecommerce.SignatureHeader 重载后出现的 parse*NotifyResult(notifyData, null) 编译期重载歧义问题,通过建立类型继承关系来消除歧义,并补充回归验证以确保字段适配仍然正确。

Changes:

  • 将旧 com.github.binarywang.wxpay.bean.ecommerce.SignatureHeader 调整为继承新 com.github.binarywang.wxpay.bean.notify.SignatureHeader,使旧重载在 null 场景下成为更具体的匹配类型。
  • 将新旧 SignatureHeader 的 Lombok @Builder 调整为 @SuperBuilder 以支持继承场景下的 builder。
  • LegacyEcommerceApiCompatibilityTest 增加类型关系与字段映射的回归测试。

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/notify/SignatureHeader.java @Builder 改为 @SuperBuilder,为旧类继承提供 builder 支持。
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/SignatureHeader.java SignatureHeader 继承新类型并保留旧字段,为重载消歧与字段适配铺路。
weixin-java-pay/src/test/java/com/github/binarywang/wxpay/service/LegacyEcommerceApiCompatibilityTest.java 新增回归测试验证继承关系与 signed/serialNo -> signature/serial 字段映射。

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3d8746e1b6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@binarywang
binarywang merged commit dceeaf3 into develop Aug 18, 2026
1 check passed
@binarywang
binarywang deleted the agent/fix-notify-header-null branch August 18, 2026 07:12
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