Skip to content

Conversation

@yclnycl
Copy link

@yclnycl yclnycl commented Jan 22, 2026

修正了 issue#3808 中ai开发导致的url错误,请求实体错误,增加了单元测试
96cb954822d5726d05825b0db9894eb7

@yclnycl
Copy link
Author

yclnycl commented Jan 22, 2026

@binarywang 帮忙cr一下 单元测试本地通过

@binarywang
Copy link
Owner

auggie review

@binarywang
Copy link
Owner

#3866 这个PR就直接关掉了是吧

@augmentcode
Copy link

augmentcode bot commented Jan 22, 2026

🤖 Augment PR Summary

Summary: 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:

  • Updated WxMaService Javadoc to point to the correct laboruse server API docs and overall流程 docs.
  • Adjusted laboruse API URL constants to the latest endpoints for “unbind employee relation” and “send employee relation message”.
  • Refactored WxMaSendEmployeeMsgRequest fields to align with the current request payload (template_id, page, touser, data).
  • Refactored WxMaUnbindEmployeeRequest to use openid_list (batch unbind) instead of single openid/corp_id.
  • Added WxMaEmployeeRelationServiceImplTest exercising send/unbind flows via the existing test module.

Technical Notes: The laboruse “send message” API uses a data field that is a JSON string payload per the updated WeChat server documentation, and the unbind API now expects an openid_list array.

🤖 Was this summary useful? React with 👍 or 👎

@yclnycl
Copy link
Author

yclnycl commented Jan 22, 2026

#3866 这个PR就直接关掉了是吧

可以关掉了 ai写的整体的请求pojo都不对 我用我这边的实际业务和权限测过了 辛苦~

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. 1 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

public void testSendEmployeeMsg() throws WxErrorException {
WxMaSendEmployeeMsgRequest wxMaSendEmployeeMsgRequest = new WxMaSendEmployeeMsgRequest();
wxMaSendEmployeeMsgRequest.setPage("/pages/index/index");
wxMaSendEmployeeMsgRequest.setTouser("o0uBr12b1zdgCk1qDoBivmSYb9GA");
Copy link

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:34
  • weixin-java-miniapp/src/test/java/cn/binarywang/wx/miniapp/api/impl/WxMaEmployeeRelationServiceImplTest.java:73

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎

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 修复了 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 新增单元测试类,包含推送用工消息和解绑用工关系两个测试方法

Comment on lines +10 to +14
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;
Copy link

Copilot AI Jan 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

测试文件中导入了 JsonObject 和 GsonParser 但未实际使用。建议删除这些未使用的导入语句以保持代码整洁。

Suggested change
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;

Copilot uses AI. Check for mistakes.
Comment on lines +4 to +5
import cn.binarywang.wx.miniapp.bean.device.WxMaDeviceSubscribeMessageRequest;
import cn.binarywang.wx.miniapp.bean.device.WxMaDeviceTicketRequest;
Copy link

Copilot AI Jan 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

测试文件中导入了未使用的类 WxMaDeviceSubscribeMessageRequest 和 WxMaDeviceTicketRequest。这些是设备相关的类,与用工关系功能无关。建议删除这些未使用的导入语句。

Suggested change
import cn.binarywang.wx.miniapp.bean.device.WxMaDeviceSubscribeMessageRequest;
import cn.binarywang.wx.miniapp.bean.device.WxMaDeviceTicketRequest;

Copilot uses AI. Check for mistakes.
@binarywang binarywang linked an issue Jan 22, 2026 that may be closed by this pull request
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.

【小程序】用工关系

2 participants