GeezerVison is showing github.com — feat(cp): 添加企业微信会话存档音视频通话(voiptext)消息类型支持 by Copilot · Pull Request #3779 · binarywang/WxJava
Conversation
Copilot
AI
commented
Nov 28, 2025
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
企业微信会话存档功能缺少对音视频通话消息类型 voiptext 的支持。根据官方文档添加该消息类型的数据模型。
修改内容
- 在
WxCpChatModel 中添加 voiptext 字段
- 新增
VoipText 内部类,包含:
callDuration - 通话时长
inviteType - 邀请类型 (1: 用户主动发起, 2: 群主发起)
使用示例
WxCpChatModel chatModel = WxCpChatModel.fromJson(decryptedJson);
if ("voiptext".equals(chatModel.getMsgType())) {
WxCpChatModel.VoipText voipText = chatModel.getVoipText();
Integer duration = voipText.getCallDuration();
Integer inviteType = voipText.getInviteType();
}
Original prompt
This section details on the original issue you should resolve
<issue_title>企业微信会话存档功能 未接收消息类型为视频通话的类型</issue_title>
<issue_description>
简要描述
企业微信会话存档功能 未接收消息类型为视频通话的类型
文档链接为:https://developer.work.weixin.qq.com/document/path/91361#%E9%9F%B3%E8%A7%86%E9%A2%91%E9%80%9A%E8%AF%9D
- WxJava 模块名: weixin-java-cp
- WxJava 版本号:4.7.0
详细描述
Comments on the Issue (you are @copilot in this section)
@binarywang
欢迎提供PR代码来支持
Custom agent used: 自定义的
需要用中文
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Copilot
AI
changed the title
[WIP] Fix missing video call message type in WeChat archiving
feat(cp): 添加企业微信会话存档音视频通话(voiptext)消息类型支持
Nov 28, 2025
Uh oh!
There was an error while loading. Please reload this page.
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 为企业微信会话存档功能添加了音视频通话消息类型 voiptext 的支持,填补了该消息类型在 SDK 中的空白。根据企业微信官方文档的要求,实现了该消息类型的数据模型。
主要变更:
- 在
WxCpChatModel 中添加 voiptext 字段映射
- 新增
VoipText 内部类,包含 callDuration(通话时长)和 inviteType(邀请类型)两个字段
- 遵循了现有代码的风格和结构模式,包括
fromJson 和 toJson 方法
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Comment on lines
+1349
to
+1352
|
|
|
|
|
@SerializedName("callduration")
|
|
|
private Integer callDuration;
|
|
|
|
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.
建议为 callDuration 和 inviteType 字段添加 Javadoc 注释,说明其具体含义和值的说明。例如:
callDuration: 通话时长(单位:秒)
inviteType: 邀请类型(1-用户主动发起, 2-群主发起)
参考同文件中其他字段的文档风格,如 Details.id 和 Meeting.meetingId 都有类似的注释说明。
|
|
|
@SerializedName("callduration") |
|
private Integer callDuration; |
|
|
|
/** |
|
* 通话时长(单位:秒) |
|
*/ |
|
@SerializedName("callduration") |
|
private Integer callDuration; |
|
|
|
/** |
|
* 邀请类型(1-用户主动发起,2-群主发起) |
|
*/ |
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Copilot uses AI. Check for mistakes.
Comment on lines
+1347
to
+1375
|
|
public static class VoipText implements Serializable {
|
|
|
private static final long serialVersionUID = -5028321625140879571L;
|
|
|
|
|
|
@SerializedName("callduration")
|
|
|
private Integer callDuration;
|
|
|
|
|
|
@SerializedName("invitetype")
|
|
|
private Integer inviteType;
|
|
|
|
|
|
/**
|
|
|
* From json voip text.
|
|
|
*
|
|
|
* @param json the json
|
|
|
* @return the voip text
|
|
|
*/
|
|
|
public static VoipText fromJson(String json) {
|
|
|
return WxCpGsonBuilder.create().fromJson(json, VoipText.class);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* To json string.
|
|
|
*
|
|
|
* @return the string
|
|
|
*/
|
|
|
public String toJson() {
|
|
|
return WxCpGsonBuilder.create().toJson(this);
|
|
|
}
|
|
|
|
|
|
}
|
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.
新增的 VoipText 消息类型缺少测试用例。建议在 WxCpMsgAuditTest.java 中添加 voiptext 消息类型的测试用例,以保持与其他消息类型一致的测试覆盖率。
可以参考同文件中其他消息类型的测试方式,例如 modelMeetingVoiceCall、modelSphFeed 等的测试实现。
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Copilot uses AI. Check for mistakes.
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.
|