Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 28, 2025

企业微信会话存档功能缺少对音视频通话消息类型 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

详细描述

Image

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.

Co-authored-by: binarywang <1343140+binarywang@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix missing video call message type in WeChat archiving feat(cp): 添加企业微信会话存档音视频通话(voiptext)消息类型支持 Nov 28, 2025
Copilot AI requested a review from binarywang November 28, 2025 13:55
@binarywang binarywang added this to the 4.8.0 milestone Dec 2, 2025
@binarywang binarywang marked this pull request as ready for review December 4, 2025 11:41
Copilot AI review requested due to automatic review settings December 4, 2025 11:41
@binarywang binarywang merged commit 4e46486 into develop Dec 4, 2025
4 of 5 checks passed
@binarywang binarywang deleted the copilot/fix-video-call-message-type branch December 4, 2025 11:43
Copy link

Copilot AI left a 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(邀请类型)两个字段
  • 遵循了现有代码的风格和结构模式,包括 fromJsontoJson 方法

Comment on lines +1349 to +1352

@SerializedName("callduration")
private Integer callDuration;

Copy link

Copilot AI Dec 4, 2025

Choose a reason for hiding this comment

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

建议为 callDurationinviteType 字段添加 Javadoc 注释,说明其具体含义和值的说明。例如:

  • callDuration: 通话时长(单位:秒)
  • inviteType: 邀请类型(1-用户主动发起, 2-群主发起)

参考同文件中其他字段的文档风格,如 Details.idMeeting.meetingId 都有类似的注释说明。

Suggested change
@SerializedName("callduration")
private Integer callDuration;
/**
* 通话时长单位
*/
@SerializedName("callduration")
private Integer callDuration;
/**
* 邀请类型1-用户主动发起2-群主发起
*/

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);
}

}
Copy link

Copilot AI Dec 4, 2025

Choose a reason for hiding this comment

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

新增的 VoipText 消息类型缺少测试用例。建议在 WxCpMsgAuditTest.java 中添加 voiptext 消息类型的测试用例,以保持与其他消息类型一致的测试覆盖率。

可以参考同文件中其他消息类型的测试方式,例如 modelMeetingVoiceCallmodelSphFeed 等的测试实现。

Copilot uses AI. Check for mistakes.
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