Skip to content

修复企业微信人事助手 HR API 接口地址错误#3900

Merged
binarywang merged 2 commits intodevelopfrom
copilot/fix-hr-api-endpoint-error
Mar 5, 2026
Merged

修复企业微信人事助手 HR API 接口地址错误#3900
binarywang merged 2 commits intodevelopfrom
copilot/fix-hr-api-endpoint-error

Conversation

Copy link
Contributor

Copilot AI commented Mar 4, 2026

企业微信人事助手 API 路径与官方文档不符,导致所有 HR 相关接口返回 404。

变更

WxCpApiPathConsts.java — 修正三个 HR API 路径常量:

常量 修复前 修复后
GET_FIELD_INFO /cgi-bin/hr/employee/get_field_info /cgi-bin/hr/get_fields
GET_EMPLOYEE_FIELD_INFO /cgi-bin/hr/employee/get_employee_field_info /cgi-bin/hr/get_staff_info
UPDATE_EMPLOYEE_FIELD_INFO /cgi-bin/hr/employee/update_employee_field_info /cgi-bin/hr/update_staff_info

WxCpHrService.java — 同步更新 Javadoc 中的请求地址注释。

Original prompt

This section details on the original issue you should resolve

<issue_title>人事助手api接口地址错误</issue_title>
<issue_description>> @binarywang ,请求地址都是错的【请求地址】: https://qyapi.weixin.qq.com/cgi-bin/hr/employee/get_employee_field_info?access_token=tS54VJkwRRv5lYW3qh6aKxrfbofyC2uzCua0IlKkzrWHpoOp2bIm3h4UbGAK1nEKCiQnRomzAKvd9Ixl109eSbr07WF4BMoCAL4-2OevDM3tx2WwLaOtNEcuDGZ_sgoyBH3pnwEHzUD5p-V19AxhG_NX_iWv3yZ5Lc4Jo5DU6XfPCHAOqmHgYca3R5PVCA4PdCOslDdoka242ghlOkWwrQ

【请求参数】:{"userids":["ZhouYiJing"]}
【异常信息】:status code: 404, reason phrase: Not Found,

interface Hr {
/**
* 获取员工档案字段信息.
*/
String GET_FIELD_INFO = "/cgi-bin/hr/employee/get_field_info";

/**
 * 获取员工档案数据.
 */
String GET_EMPLOYEE_FIELD_INFO = "/cgi-bin/hr/employee/get_employee_field_info";

/**
 * 更新员工档案数据.
 */
String UPDATE_EMPLOYEE_FIELD_INFO = "/cgi-bin/hr/employee/update_employee_field_info";

}
https://qyapi.weixin.qq.com/cgi-bin/hr/get_fields?access_token=ACCESS_TOKEN
https://qyapi.weixin.qq.com/cgi-bin/hr/get_staff_info?access_token=ACCESS_TOKEN
https://qyapi.weixin.qq.com/cgi-bin/hr/update_staff_info?access_token=ACCESS_TOKEN

Originally posted by @softboy99 in #3891</issue_description>

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

Custom agent used: 全部用中文
需要用中文,包括PR标题和分析总结过程


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

Co-authored-by: binarywang <1343140+binarywang@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix incorrect HR API endpoint address 修复企业微信人事助手 HR API 接口地址错误 Mar 4, 2026
@binarywang binarywang marked this pull request as ready for review March 4, 2026 11:49
Copilot AI review requested due to automatic review settings March 4, 2026 11:49
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

该 PR 修复企业微信「人事助手(HR)」相关 API 的路径常量与官方文档不一致的问题,避免调用 HR 接口时因路径错误导致的 404,从而恢复 HR 相关功能的可用性。

Changes:

  • 修正 WxCpApiPathConsts.Hr 中 3 个 HR API 路径常量为官方文档对应的真实路径(去掉错误的 /hr/employee/ 前缀与旧路径段)。
  • 同步更新 WxCpHrService 中对应方法的 Javadoc 请求地址说明,保持文档与实现一致。

Reviewed changes

Copilot reviewed 2 out of 2 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 修复 HR API 路径常量(get_fields / get_staff_info / update_staff_info),使实现调用到正确的接口地址。
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpHrService.java 更新 HR 接口 Javadoc 中的请求地址,避免文档误导使用方。

@binarywang binarywang merged commit fd710e3 into develop Mar 5, 2026
5 checks passed
@binarywang binarywang deleted the copilot/fix-hr-api-endpoint-error branch March 5, 2026 02:27
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接口地址错误

3 participants