添加获取应用管理员列表接口 by Copilot · Pull Request #3823 · binarywang/WxJava
添加企业微信代开发应用"获取应用管理员列表"API支持。该接口用于获取授权企业中第三方应用或代开发应用的管理员列表(不包括外部管理员)。
变更内容
- API常量: 在
WxCpApiPathConsts.Agent中添加AGENT_GET_ADMIN_LIST = "/cgi-bin/agent/get_admin_list" - 接口方法: 在
WxCpAgentService中添加getAdminList(Integer agentId)方法 - 实现: 在
WxCpAgentServiceImpl中实现该方法,使用POST请求,包含参数校验和标准错误处理 - Bean复用: 使用现有
WxCpTpAdminbean承载返回数据 - 单元测试: 添加真实环境和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.
