GeezerVison is showing github.com — 添加获取应用管理员列表接口 by Copilot · Pull Request #3823 · binarywang/WxJava
Conversation
Copilot
AI
commented
Dec 24, 2025
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
添加企业微信代开发应用"获取应用管理员列表"API支持。该接口用于获取授权企业中第三方应用或代开发应用的管理员列表(不包括外部管理员)。
变更内容
- API常量: 在
WxCpApiPathConsts.Agent 中添加 AGENT_GET_ADMIN_LIST = "/cgi-bin/agent/get_admin_list"
- 接口方法: 在
WxCpAgentService 中添加 getAdminList(Integer agentId) 方法
- 实现: 在
WxCpAgentServiceImpl 中实现该方法,使用POST请求,包含参数校验和标准错误处理
- Bean复用: 使用现有
WxCpTpAdmin bean承载返回数据
- 单元测试: 添加真实环境和Mock测试用例
使用示例
// 获取指定应用的管理员列表
Integer agentId = 1000001;
WxCpTpAdmin adminList = wxCpService.getAgentService().getAdminList(agentId);
// 遍历管理员信息
for (WxCpTpAdmin.Admin admin : adminList.getAdmin()) {
String userId = admin.getUserId(); // 用户ID
String openUserId = admin.getOpenUserId(); // OpenUserID
Integer authType = admin.getAuthType(); // 权限类型:1=应用管理员,2=分级管理员
}
参考文档: https://developer.work.weixin.qq.com/document/path/90506
Original prompt
This section details on the original issue you should resolve
<issue_title>自建代开发应用,没有获取应用管理员的接口吗</issue_title>
<issue_description>
</issue_description>
Comments on the Issue (you are @copilot in this section)
Custom agent used: 全部用中文
需要用中文,包括PR标题和分析总结过程
💡 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] Add API endpoint for application admin access
添加获取应用管理员列表接口
Dec 24, 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 支持。该接口允许第三方服务商获取授权企业中指定应用的管理员列表(不包括外部管理员),便于服务商根据用户的管理员身份进行权限区分。
主要变更包括:
- 新增 API 端点常量定义
- 在
WxCpAgentService 接口中添加 getAdminList 方法
- 在
WxCpAgentServiceImpl 中实现该方法,包含参数校验和错误处理
- 复用现有的
WxCpTpAdmin Bean 承载响应数据
- 添加完整的真实环境测试和 Mock 单元测试
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File |
Description |
| weixin-java-cp/src/main/java/me/chanjar/weixin/cp/constant/WxCpApiPathConsts.java |
在 Agent 接口中添加 AGENT_GET_ADMIN_LIST 常量,定义 API 路径 "/cgi-bin/agent/get_admin_list" |
| weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpAgentService.java |
添加 getAdminList 接口方法定义,包含完整的 JavaDoc 文档说明 |
| weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpAgentServiceImpl.java |
实现 getAdminList 方法,包含参数校验、JSON 请求构建、API 调用和标准错误处理 |
| weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/impl/WxCpAgentServiceImplTest.java |
添加真实环境测试 testGetAdminList 和 Mock 测试,验证接口调用和响应解析的正确性 |
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.
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.