Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 17, 2025

任务计划:为 wx.getGroupEnterInfo 添加支持

根据问题描述,需要为小程序SDK添加wx.getGroupEnterInfo的响应数据结构定义和方法支持。这是wx.getShareInfo的升级版本。

需要完成的工作清单:

  • 1. 创建 WxMaGroupEnterInfo 类,包含以下字段:

    • opengid (群唯一标识 - 多聊群)
    • openSingleRoomid (群唯一标识 - 单聊群)
    • groupOpenid (用户在当前群的唯一标识)
    • chatType (聊天室类型)
  • 2. 在 WxMaShareService 接口中添加 getGroupEnterInfo() 方法

  • 3. 在 WxMaShareServiceImpl 实现类中实现 getGroupEnterInfo() 方法

  • 4. 在测试文件中添加 getGroupEnterInfo 的测试用例

  • 5. 运行 checkstyle 验证代码风格 ✅ 通过

  • 6. 运行编译验证修改没有问题 ✅ 通过

  • 7. 修正代码审查反馈:移除不正确的 @author 标注

已完成的修改:

  1. 新增文件

    • WxMaGroupEnterInfo.java - 群入口信息的数据模型类,包含了微信官方文档中定义的所有字段
  2. 修改文件

    • WxMaShareService.java - 添加了 getGroupEnterInfo() 接口方法
    • WxMaShareServiceImpl.java - 实现了 getGroupEnterInfo() 方法
    • WxMaShareServiceImplTest.java - 添加了测试用例
  3. 代码审查反馈修正

    • WxMaGroupEnterInfo.java 中移除了不正确的 @author 标注

实现细节:

  • 使用了与 WxMaShareInfo 相同的实现模式
  • 使用 @SerializedName 注解确保 JSON 字段名称与微信 API 返回的字段名称一致
  • 复用了现有的解密工具 WxMaCryptUtils.decrypt()
  • 遵循项目的代码规范(Google Java Style,2空格缩进)
  • 所有修改均通过 checkstyle 检查和完整编译验证
Original prompt

This section details on the original issue you should resolve

<issue_title>wx.getShareInfo升级版本wx.getGroupEnterInfo响应参数定义</issue_title>
<issue_description>### 简要描述
当前最新sdk,没有wx.getGroupEnterInfo响应信息的定义,这个对应旧的wx.getShareInfo
wx.getShareInfo:https://developers.weixin.qq.com/miniprogram/dev/api/share/wx.getShareInfo.html

wx.getGroupEnterInfo:https://developers.weixin.qq.com/miniprogram/dev/api/open-api/group/wx.getGroupEnterInfo.html

需要在sdk中定义wx.getGroupEnterInfo的success返回encryptedData、iv解密后的结果
字段如下:
{
"opengid": "OPENGID", // 多聊群下返回的群唯一标识
"open_single_roomid": "", // 单聊群下返回的群唯一标识
"group_openid": "", // 用户在当前群的唯一标识
"chat_type": 3, // 聊天室类型
}

在WxMaShareService接口中添加getGroupEnterInfo()方法
public interface WxMaShareService {
WxMaShareInfo getShareInfo(String sessionKey, String encryptedData, String ivStr);
}

官方文档地址

参考文档:https://developers.weixin.qq.com/miniprogram/dev/api/open-api/group/wx.getGroupEnterInfo.html
</issue_description>

Comments on the Issue (you are @copilot in this section)

Custom agent used: 自定义的
需要用中文


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Add getGroupEnterInfo method to WxMaShareService 添加 wx.getGroupEnterInfo 解密支持 Nov 17, 2025
Copilot AI requested a review from binarywang November 17, 2025 03:26
@binarywang binarywang marked this pull request as ready for review November 17, 2025 03:27
Copilot AI requested a review from binarywang November 17, 2025 03:33
@binarywang binarywang added this to the 4.7.9 milestone Nov 17, 2025
@binarywang binarywang merged commit 833f60c into develop Nov 17, 2025
1 check passed
@binarywang binarywang deleted the copilot/add-getgroupenterinfo-method branch November 17, 2025 04:01
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.

wx.getShareInfo升级版本wx.getGroupEnterInfo响应参数定义

2 participants