GeezerVison is showing github.com — 添加客服消息aimsgcontext字段支持 by Copilot · Pull Request #3795 · binarywang/WxJava
Conversation
Copilot
AI
commented
Dec 5, 2025
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Copilot
AI
changed the title
[WIP] Add additional fields to customer message parameters
添加客服消息aimsgcontext字段支持
Dec 5, 2025
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.
Pull request overview
本 PR 为小程序客服消息 API 添加了 aimsgcontext 字段支持,使得开发者可以在回复消息时关联之前的消息 ID 作为 AI 对话上下文。这是根据微信官方文档更新新增的功能字段,该字段为可选字段,不影响现有代码的向后兼容性。
主要变更
- 在
WxMaKefuMessage 中新增 AiMsgContext 内部类和 aiMsgContext 字段,支持 JSON 序列化
- 在
BaseBuilder 中添加 aiMsgContextMsgId() 方法,支持所有消息类型的构建器使用该字段
- 添加了序列化测试用例,验证 JSON 输出格式符合微信 API 要求
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File |
Description |
| weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/WxMaKefuMessage.java |
新增 AiMsgContext 内部类和 aiMsgContext 字段,使用 Gson 注解支持 JSON 序列化 |
| weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/builder/BaseBuilder.java |
在基础构建器中添加 aiMsgContextMsgId 字段和对应的链式设置方法,并在 build() 方法中条件性创建 AiMsgContext 对象 |
| weixin-java-miniapp/src/test/java/cn/binarywang/wx/miniapp/bean/WxMaKefuMessageTest.java |
添加测试方法验证带有 aimsgcontext 字段的消息序列化为正确的 JSON 格式 |
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
binarywang
Awaiting requested review from binarywang
Uh oh!
There was an error while loading. Please reload this page.
Development
Successfully merging this pull request may close these issues.
客服消息参数增加了一些字段
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.