-
-
Notifications
You must be signed in to change notification settings - Fork 9k
🎨 #3808 【小程序】重构微信小程序用工关系文档地址,请求实体,增加单元测试 #3867
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
base: develop
Are you sure you want to change the base?
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都不对 我用我这边的实际业务和权限测过了 辛苦~ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| public void testSendEmployeeMsg() throws WxErrorException { | ||
| WxMaSendEmployeeMsgRequest wxMaSendEmployeeMsgRequest = new WxMaSendEmployeeMsgRequest(); | ||
| wxMaSendEmployeeMsgRequest.setPage("/pages/index/index"); | ||
| wxMaSendEmployeeMsgRequest.setTouser("o0uBr12b1zdgCk1qDoBivmSYb9GA"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 | 新增单元测试类,包含推送用工消息和解绑用工关系两个测试方法 |
| import com.google.gson.JsonObject; | ||
| import com.google.inject.Inject; | ||
| import lombok.extern.slf4j.Slf4j; | ||
| import me.chanjar.weixin.common.error.WxErrorException; | ||
| import me.chanjar.weixin.common.util.json.GsonParser; |
Copilot
AI
Jan 22, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
测试文件中导入了 JsonObject 和 GsonParser 但未实际使用。建议删除这些未使用的导入语句以保持代码整洁。
| import com.google.gson.JsonObject; | |
| import com.google.inject.Inject; | |
| import lombok.extern.slf4j.Slf4j; | |
| import me.chanjar.weixin.common.error.WxErrorException; | |
| import me.chanjar.weixin.common.util.json.GsonParser; | |
| import com.google.inject.Inject; | |
| import lombok.extern.slf4j.Slf4j; | |
| import me.chanjar.weixin.common.error.WxErrorException; |
| import cn.binarywang.wx.miniapp.bean.device.WxMaDeviceSubscribeMessageRequest; | ||
| import cn.binarywang.wx.miniapp.bean.device.WxMaDeviceTicketRequest; |
Copilot
AI
Jan 22, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
测试文件中导入了未使用的类 WxMaDeviceSubscribeMessageRequest 和 WxMaDeviceTicketRequest。这些是设备相关的类,与用工关系功能无关。建议删除这些未使用的导入语句。
| import cn.binarywang.wx.miniapp.bean.device.WxMaDeviceSubscribeMessageRequest; | |
| import cn.binarywang.wx.miniapp.bean.device.WxMaDeviceTicketRequest; |
修正了 issue#3808 中ai开发导致的url错误,请求实体错误,增加了单元测试
