-
-
Notifications
You must be signed in to change notification settings - Fork 9k
feat(cp): 添加企业微信会话存档音视频通话(voiptext)消息类型支持 #3779
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
Conversation
Co-authored-by: binarywang <1343140+binarywang@users.noreply.github.com>
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方法
|
|
||
| @SerializedName("callduration") | ||
| private Integer callDuration; | ||
|
|
Copilot
AI
Dec 4, 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.
建议为 callDuration 和 inviteType 字段添加 Javadoc 注释,说明其具体含义和值的说明。例如:
callDuration: 通话时长(单位:秒)inviteType: 邀请类型(1-用户主动发起, 2-群主发起)
参考同文件中其他字段的文档风格,如 Details.id 和 Meeting.meetingId 都有类似的注释说明。
| @SerializedName("callduration") | |
| private Integer callDuration; | |
| /** | |
| * 通话时长(单位:秒) | |
| */ | |
| @SerializedName("callduration") | |
| private Integer callDuration; | |
| /** | |
| * 邀请类型(1-用户主动发起,2-群主发起) | |
| */ |
| 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); | ||
| } | ||
|
|
||
| } |
Copilot
AI
Dec 4, 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.
新增的 VoipText 消息类型缺少测试用例。建议在 WxCpMsgAuditTest.java 中添加 voiptext 消息类型的测试用例,以保持与其他消息类型一致的测试覆盖率。
可以参考同文件中其他消息类型的测试方式,例如 modelMeetingVoiceCall、modelSphFeed 等的测试实现。
企业微信会话存档功能缺少对音视频通话消息类型
voiptext的支持。根据官方文档添加该消息类型的数据模型。修改内容
WxCpChatModel中添加voiptext字段VoipText内部类,包含:callDuration- 通话时长inviteType- 邀请类型 (1: 用户主动发起, 2: 群主发起)使用示例
Original prompt
💡 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.