Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 28, 2025

WxMaExpressDeliveryReturnServiceImpl 的三个方法错误使用 service.get() 传递 JSON 参数。GET 请求执行器期望 URL 查询字符串格式(return_id=xxx),而非 JSON 格式({"return_id":"xxx"})。

根据微信 API 约定及项目中同类实现(如 WxMaExpressServiceImpl.getOrder),这些接口应使用 POST 请求。

修复内容

  • addDeliveryReturn: service.get()service.post()
  • getDeliveryReturn: service.get()service.post(),直接传递 JsonObject
  • unbindDeliveryReturn: service.get()service.post(),直接传递 JsonObject

修复前后对比

// Before (错误)
String result = this.service.get(GET_DELIVERY_RETURN_URL, param.toString());

// After (正确)
String result = this.service.post(GET_DELIVERY_RETURN_URL, param);
Original prompt

This section details on the original issue you should resolve

<issue_title>WxMaExpressDeliveryReturnServiceImpl类的getDeliveryReturn方法和unbindDeliveryReturn方法有bug</issue_title>
<issue_description># 提问前,请确保阅读过项目首页说明以及wiki开发文档相关内容,尤其是常见问题部分。完成内容后,请务必移除包括本句在内的无用内容,以免影响阅读,否则直接关闭,谢谢合作~

另外如果确认属于bug,而且已明确如何修复,请参考贡献指南直接提交PR,省的浪费时间在这里描述问题,非常感谢配合

简要描述

WxMaExpressDeliveryReturnServiceImpl类的getDeliveryReturn方法和unbindDeliveryReturn方法有bug。

模块版本情况

  • WxJava 模块名:
  • WxJava 版本号:(旧版本不予支持,谢谢配合)

详细描述

WxMaExpressDeliveryReturnServiceImpl类的getDeliveryReturn方法和unbindDeliveryReturn方法。他们这样写:
JsonObject param = new JsonObject();
param.addProperty("return_id",returnId);
应该会有bug吧,因为OkHttpSimpleGetRequestExecutor执行器的实现是:
if (queryParam != null) {
if (uri.indexOf('?') == -1) {
uri += '?';
}
uri += uri.endsWith("?") ? queryParam : '&' + queryParam;
}
并没有处理 "{" "}"

日志

日志请写于此处

</issue_description>

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

@binarywang 那你完全可以提交代码了,okhttp的实现代码确实不够完整,欢迎帮忙检查优化提交PR,谢谢

Custom agent used: 自定义的
需要用中文


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: binarywang <1343140+binarywang@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix bugs in getDeliveryReturn and unbindDeliveryReturn methods 修复 WxMaExpressDeliveryReturnServiceImpl 中 GET/POST 方法使用错误 Nov 28, 2025
Copilot AI requested a review from binarywang November 28, 2025 02:12
@binarywang binarywang marked this pull request as ready for review November 28, 2025 03:13
@binarywang binarywang added this to the 4.7.9 milestone Nov 28, 2025
@binarywang binarywang merged commit 9940546 into develop Nov 28, 2025
1 check passed
@binarywang binarywang deleted the copilot/fix-delivery-return-methods branch November 28, 2025 03: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.

WxMaExpressDeliveryReturnServiceImpl类的getDeliveryReturn方法和unbindDeliveryReturn方法有bug

2 participants