Merged
Conversation
Co-authored-by: binarywang <1343140+binarywang@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Investigate support for HR assistant API in WeChat Work
实现企业微信人事助手 API (HR Assistant)
Feb 28, 2026
There was a problem hiding this comment.
Pull request overview
本 PR 为 weixin-java-cp 模块补齐企业微信「人事助手(HR Assistant)」相关能力,在现有 WxCpService 服务体系中新增 HR Service,并补充对应的 API 路径常量、请求/响应 Bean 与集成测试用例。
Changes:
- 新增人事助手 API 路径常量
WxCpApiPathConsts.Hr(获取字段配置/获取档案数据/更新档案数据) - 新增 HR 领域 Bean(字段信息、字段值、员工档案数据、响应包装类)
- 新增
WxCpHrService接口与WxCpHrServiceImpl实现,并在WxCpService/BaseWxCpServiceImpl中注册getHrService()
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| weixin-java-cp/src/main/java/me/chanjar/weixin/cp/constant/WxCpApiPathConsts.java | 增加 HR Assistant 相关接口路径常量,供服务实现拼装请求 URL |
| weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpHrService.java | 新增 HR Assistant 服务接口定义(字段配置/档案数据查询与更新) |
| weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpHrServiceImpl.java | 新增 HR Assistant 服务实现,负责组装请求体并调用企业微信 API |
| weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpService.java | 在主服务接口中新增 getHrService() 入口 |
| weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/BaseWxCpServiceImpl.java | 默认初始化并暴露 WxCpHrService,纳入统一服务管理 |
| weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/hr/WxCpHrEmployeeFieldInfo.java | 新增员工档案字段配置 Bean(字段 key/名称/类型/系统字段/选项列表等) |
| weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/hr/WxCpHrEmployeeFieldValue.java | 新增字段值承载 Bean(文本/选项/日期/附件等值类型) |
| weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/hr/WxCpHrEmployeeFieldData.java | 新增单员工档案数据 Bean(userid + 字段列表) |
| weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/hr/WxCpHrEmployeeFieldInfoResp.java | 新增“字段配置”响应包装类(继承 WxCpBaseResp) |
| weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/hr/WxCpHrEmployeeFieldDataResp.java | 新增“员工档案数据”响应包装类(继承 WxCpBaseResp) |
| weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/impl/WxCpHrServiceImplTest.java | 新增 HR Assistant 集成测试用例,覆盖字段配置查询/档案查询/档案更新调用路径 |
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/hr/WxCpHrEmployeeFieldInfo.java
Show resolved
Hide resolved
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpHrServiceImpl.java
Show resolved
Hide resolved
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpHrServiceImpl.java
Show resolved
Hide resolved
weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/impl/WxCpHrServiceImplTest.java
Show resolved
Hide resolved
weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/impl/WxCpHrServiceImplTest.java
Outdated
Show resolved
Hide resolved
Owner
|
@copilot apply changes based on the comments in this thread |
Co-authored-by: binarywang <1343140+binarywang@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
企业微信 SDK 缺少人事助手相关 API 支持(官方文档)。本 PR 新增完整的人事助手服务层。
新增内容
API 路径常量 (
WxCpApiPathConsts.Hr)GET_FIELD_INFO— 获取员工档案字段配置GET_EMPLOYEE_FIELD_INFO— 获取员工档案数据UPDATE_EMPLOYEE_FIELD_INFO— 更新员工档案数据Bean 类 (
bean/hr/)WxCpHrFieldType— 字段类型枚举(TEXT/DATE/NUMBER/SINGLE_SELECT/MULTI_SELECT/ATTACHMENT/PHONE/EMAIL),含fromCode(int)工厂方法WxCpHrEmployeeFieldInfo— 字段配置,fieldType保留Integer用于 JSON 反序列化,新增getFieldTypeEnum()方法返回WxCpHrFieldType枚举WxCpHrEmployeeFieldValue— 字段值(涵盖 text、option、multi-option、date、attachment)WxCpHrEmployeeFieldData— 单员工档案数据WxCpHrEmployeeFieldInfoResp/WxCpHrEmployeeFieldDataResp— 响应包装类服务接口与实现
WxCpHrService+WxCpHrServiceImplgetEmployeeFieldInfo:客户端侧校验userids非空且不超过 20 个,不满足时抛IllegalArgumentExceptionupdateEmployeeFieldInfo:客户端侧校验userid非空白、fieldList非空,不满足时抛IllegalArgumentExceptionWxCpService#getHrService()注册入主服务,BaseWxCpServiceImpl默认初始化使用示例
Original prompt
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.