Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 14, 2026

实现企业微信服务商代开发API的完整封装(文档),支持获取应用模板列表和代开发应用详情。

新增API

  • getTemplateList() - 获取服务商的应用模板列表(模板ID、名称、Logo、描述、状态)
  • getCustomizedAppDetail(authCorpId, agentId) - 获取授权企业的代开发应用详情,agentId为可选参数,不传时返回所有应用

实现

Bean类

  • WxCpTpTemplateList - 应用模板列表响应
  • WxCpTpCustomizedAppDetail - 代开发应用详情响应(包含企业信息、应用列表、可见范围)

服务层

  • WxCpTpCustomizedService - 新增服务接口
  • WxCpTpCustomizedServiceImpl - 实现,使用provider_access_token调用API
  • 集成到WxCpTpService主服务

常量

  • GET_TEMPLATE_LIST = "/cgi-bin/service/get_template_list"
  • GET_CUSTOMIZED_APP_DETAIL = "/cgi-bin/service/get_customized_app_detail"

使用示例

WxCpTpService tpService = ...;

// 获取模板列表
WxCpTpTemplateList templates = tpService.getWxCpTpCustomizedService().getTemplateList();

// 获取指定应用详情
WxCpTpCustomizedAppDetail detail = tpService.getWxCpTpCustomizedService()
    .getCustomizedAppDetail("ww1234567890abcdef", 1000001);

// 获取所有应用
WxCpTpCustomizedAppDetail allApps = tpService.getWxCpTpCustomizedService()
    .getCustomizedAppDetail("ww1234567890abcdef", null);

测试: 3个单元测试覆盖主要场景(使用Mock,不依赖外部API)

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • developer.work.weixin.qq.com
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js (dns block)
  • open.work.weixin.qq.com
    • Triggering command: /usr/bin/curl curl -s REDACTED (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>企业微信服务商代开发的API封装</issue_title>
<issue_description>文档地址:https://developer.work.weixin.qq.com/document/path/97111</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.

Copilot AI changed the title [WIP] Add API wrapper for WeChat service provider 企业微信服务商代开发API封装 Jan 14, 2026
Copilot AI requested a review from binarywang January 14, 2026 09:22
@binarywang binarywang marked this pull request as ready for review January 14, 2026 09:48
Copilot AI review requested due to automatic review settings January 14, 2026 09:48
@augmentcode
Copy link

augmentcode bot commented Jan 14, 2026

🤖 Augment PR Summary

变更概述:本 PR 为“企业微信第三方应用(服务商)代开发”能力补齐接口封装,覆盖应用模板列表与代开发应用详情查询。

主要变更:

  • 新增 Bean:WxCpTpTemplateList(应用模板列表响应)
  • 新增 Bean:WxCpTpCustomizedAppDetail(代开发应用详情响应,含企业信息/应用列表/可见范围)
  • 新增服务接口:WxCpTpCustomizedService,提供 getTemplateList()getCustomizedAppDetail(authCorpId, agentId)
  • 新增实现:WxCpTpCustomizedServiceImpl,使用 provider_access_token 调用对应 API
  • WxCpApiPathConsts.Tp 中补充路径常量:GET_TEMPLATE_LISTGET_CUSTOMIZED_APP_DETAIL
  • 将新服务集成到 WxCpTpService / BaseWxCpTpServiceImpl,提供 getter/setter
  • 新增单元测试:WxCpTpCustomizedServiceImplTest(Mock 调用,覆盖含/不含 agentId 场景)

备注:实现遵循现有 tp 模块调用惯例(URL 拼接 provider_access_token,并在请求时设置 withoutSuiteAccessToken=true)。

🤖 Was this summary useful? React with 👍 or 👎

Copy link

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

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

Review completed. No suggestions at this time.

Comment augment review to trigger a new review at any time.

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

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.

企业微信服务商代开发的API封装

2 participants