🎨 #3808 【小程序】重构微信小程序用工关系文档地址,请求实体,增加单元测试#3867
Conversation
|
@binarywang 帮忙cr一下 单元测试本地通过 |
|
auggie review |
|
#3866 这个PR就直接关掉了是吧 |
🤖 Augment PR SummarySummary: This PR fixes the Mini Program “laboruse/employee relation” integration introduced in #3808 by correcting the official documentation links, updating API endpoints, refactoring request DTOs to match the current server-side contract, and adding a new test. Changes:
Technical Notes: The laboruse “send message” API uses a 🤖 Was this summary useful? React with 👍 or 👎 |
可以关掉了 ai写的整体的请求pojo都不对 我用我这边的实际业务和权限测过了 辛苦~ |
| public void testSendEmployeeMsg() throws WxErrorException { | ||
| WxMaSendEmployeeMsgRequest wxMaSendEmployeeMsgRequest = new WxMaSendEmployeeMsgRequest(); | ||
| wxMaSendEmployeeMsgRequest.setPage("/pages/index/index"); | ||
| wxMaSendEmployeeMsgRequest.setTouser("o0uBr12b1zdgCk1qDoBivmSYb9GA"); |
There was a problem hiding this comment.
testSendEmployeeMsg/testUnbinduserb2cauthinfo hardcode openid/templateId values that look environment-specific (and potentially sensitive). Consider sourcing these from TestConfig like other miniapp API tests so the test is portable across environments.
Other Locations
weixin-java-miniapp/src/test/java/cn/binarywang/wx/miniapp/api/impl/WxMaEmployeeRelationServiceImplTest.java:34weixin-java-miniapp/src/test/java/cn/binarywang/wx/miniapp/api/impl/WxMaEmployeeRelationServiceImplTest.java:73
🤖 Was this useful? React with 👍 or 👎
There was a problem hiding this comment.
Pull request overview
此 PR 修复了 issue#3808 中由 AI 开发导致的微信小程序用工关系功能错误,主要包括 URL 地址修正、请求实体类重构以及新增单元测试。
Changes:
- 修正了用工关系相关的两个 API URL 地址(解绑用工关系和推送用工消息)
- 重构了两个请求实体类的字段结构,使其符合微信官方文档规范
- 新增了用工关系功能的单元测试类
- 更新了相关接口的文档注释
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| WxMaApiUrlConstants.java | 修正了解绑用工关系和推送用工消息的 API URL,并更新了文档注释 |
| WxMaUnbindEmployeeRequest.java | 重构请求字段从单个 openid 和 corp_id 改为 openid_list 列表,符合官方文档 |
| WxMaSendEmployeeMsgRequest.java | 重构请求字段从简单的 openid/corp_id/msg 改为 template_id/page/touser/data,并添加了详细的使用示例 |
| WxMaEmployeeRelationServiceImpl.java | 添加了更新日期注释 |
| WxMaService.java | 更新了用工关系服务的文档链接,分别指向服务端 API 文档和整体流程文档 |
| WxMaEmployeeRelationServiceImplTest.java | 新增单元测试类,包含推送用工消息和解绑用工关系两个测试方法 |
...app/src/test/java/cn/binarywang/wx/miniapp/api/impl/WxMaEmployeeRelationServiceImplTest.java
Outdated
Show resolved
Hide resolved
...app/src/test/java/cn/binarywang/wx/miniapp/api/impl/WxMaEmployeeRelationServiceImplTest.java
Outdated
Show resolved
Hide resolved
…/impl/WxMaEmployeeRelationServiceImplTest.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…/impl/WxMaEmployeeRelationServiceImplTest.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
修正了 issue#3808 中ai开发导致的url错误,请求实体错误,增加了单元测试
