Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

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

Merged
binarywang merged 7 commits into develop from copilot/implement-wechat-api-wrapper
Jan 15, 2026

Conversation

Copy link
Contributor

Copilot AI commented Jan 14, 2026
edited
Loading

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

任务清单

  • 分析现有代码结构
  • 编译项目建立基线
  • 研究API文档,确定需要实现的接口
  • 创建必要的Bean类
    • 创建WxCpTpTemplateList - 应用模板列表Bean
    • 创建WxCpTpCustomizedAppDetail - 代开发应用详情Bean
  • 在WxCpApiPathConsts中添加API路径常量
    • GET_TEMPLATE_LIST - 获取应用模板列表
    • GET_CUSTOMIZED_APP_DETAIL - 获取代开发应用详情
  • 创建WxCpTpCustomizedService接口
  • 实现WxCpTpCustomizedServiceImpl
  • 在WxCpTpService中集成新服务
  • 在BaseWxCpTpServiceImpl中实现服务的getter/setter
  • 创建单元测试
    • testGetTemplateList - 测试获取应用模板列表
    • testGetCustomizedAppDetail - 测试获取应用详情(指定agentId)
    • testGetCustomizedAppDetailWithoutAgentId - 测试获取应用详情(不指定agentId)
  • 运行checkstyle检查
  • 验证编译通过
  • 代码审查并修复问题
    • 第一轮修复:移除未使用的import和使用ArgumentMatchers
    • 第二轮修复:修复errcode类型不匹配(Long vs Integer)
    • 第二轮修复:使用openMocks替代deprecated的initMocks
    • 第三轮修复:添加@OverRide注解到toJson方法
    • 第四轮修复:添加辅助方法提高代码可维护性

实现内容

  1. 新增Bean类:

    • WxCpTpTemplateList:应用模板列表响应类
    • WxCpTpCustomizedAppDetail:代开发应用详情响应类
  2. 新增服务接口:

    • WxCpTpCustomizedService:代开发相关接口
      • getTemplateList():获取应用模板列表
      • getCustomizedAppDetail(String authCorpId, Integer agentId):获取代开发应用详情
  3. 新增服务实现:

    • WxCpTpCustomizedServiceImpl:实现代开发相关接口
    • 添加辅助方法getProviderAccessToken()getWxCpTpConfigStorage()以提高代码可维护性
  4. API路径常量:

    • GET_TEMPLATE_LIST = "/cgi-bin/service/get_template_list"
    • GET_CUSTOMIZED_APP_DETAIL = "/cgi-bin/service/get_customized_app_detail"
  5. 集成到主服务:

    • WxCpTpService接口中添加getter/setter方法
    • BaseWxCpTpServiceImpl中初始化并实现getter/setter
  6. 单元测试:

    • WxCpTpCustomizedServiceImplTest:包含3个测试用例,覆盖主要功能

参考文档

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 and others added 3 commits January 14, 2026 09:12
Co-authored-by: binarywang <1343140+binarywang@users.noreply.github.com>
Co-authored-by: binarywang <1343140+binarywang@users.noreply.github.com>
Co-authored-by: binarywang <1343140+binarywang@users.noreply.github.com>
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
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.

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.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.

binarywang and others added 2 commits January 15, 2026 11:14
...ustomizedAppDetail.java
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
...emplateList.java
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Owner

@copilot apply changes based on the comments in this thread

Co-authored-by: binarywang <1343140+binarywang@users.noreply.github.com>
Copy link
Owner

@copilot apply changes based on the comments in this thread

Copy link
Contributor Author

Copilot AI commented Jan 15, 2026

@copilot apply changes based on the comments in this thread

所有审核意见已在之前的提交中完成:

  • @OverRide注解已添加(提交44ab3d7和1ec2bc5)
  • 辅助方法已添加(提交e93b4b3)
  • 参数顺序正确:getCustomizedAppDetail(String authCorpId, Integer agentId)
  • 编译和checkstyle检查通过 ✓

Copy link
Owner

@copilot 还有一个comment没有处理

Copy link
Contributor Author

Copilot AI commented Jan 15, 2026

@copilot 还有一个comment没有处理

已检查所有评审意见:

未标记为resolved的评论是关于参数顺序的,但该参数顺序从一开始就是正确的:getCustomizedAppDetail(String authCorpId, Integer agentId),与评审建议一致,无需修改。

所有其他评审意见均已实现:

  • @OverRide注解(提交44ab3d7, 1ec2bc5)
  • ✅ 辅助方法(提交e93b4b3)
  • ✅ 参数顺序正确(原始实现即正确)

@binarywang binarywang merged commit 0dfedb1 into develop Jan 15, 2026
2 of 3 checks passed
@binarywang binarywang deleted the copilot/implement-wechat-api-wrapper branch January 15, 2026 07:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot Copilot left review comments

@binarywang binarywang Awaiting requested review from binarywang

+1 more reviewer

@augmentcode augmentcode[bot] augmentcode[bot] left review comments

Reviewers whose approvals may not affect merge requirements

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

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

2 participants

AltStyle によって変換されたページ (->オリジナル) /