Skip to content

feat: 添加 微信物流服务 /微信物流服务(商家查看) /消息组件#842

Merged
silenceper merged 4 commits into
silenceper:v2from
ccfish86:v2
Jul 5, 2025
Merged

feat: 添加 微信物流服务 /微信物流服务(商家查看) /消息组件#842
silenceper merged 4 commits into
silenceper:v2from
ccfish86:v2

Conversation

@ccfish86
Copy link
Copy Markdown
Contributor

@ccfish86 ccfish86 commented Jul 4, 2025

微信小程序 物流服务 消息组件
物流消息是微信官方为小程序提供的免费物流消息通知接口。

@silenceper silenceper requested a review from Copilot July 4, 2025 04:09
Copy link
Copy Markdown
Contributor

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

This PR integrates the WeChat logistics (express) service into the mini-program SDK, providing endpoints for waybill operations and delivery company listing.

  • Registers a new GetExpress method on MiniProgram
  • Introduces the express package with service constructor
  • Implements delivery endpoints, request/response types, and status enums

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
miniprogram/miniprogram.go Imported express package and added GetExpress method
miniprogram/express/express.go Defined Express type and NewExpress constructor
miniprogram/express/delivery.go Added waybill operations (Follow, Query, Update) and company list
Comments suppressed due to low confidence (4)

miniprogram/express/delivery.go:25

  • [nitpick] The receiver name express shadows the package name and can be confusing; consider renaming it to e or srv for clarity.
func (express *Express) FollowWaybill(ctx context.Context, in *FollowWaybillRequest) (res FollowWaybillResponse, err error) {

miniprogram/express/delivery.go:21

  • [nitpick] For consistency with other URL constants (which include URL suffix), consider renaming this to openMsgGetDeliveryListURL.
	openMsgGetDeliveryList = "https://api.weixin.qq.com/cgi-bin/express/delivery/open_msg/get_delivery_list?access_token=%s"

miniprogram/express/delivery.go:100

  • [nitpick] The comment for SenderPhone doesn’t indicate whether it’s required or optional; consider adding 必选 or 可选 to clarify.
	SenderPhone     string                 `json:"sender_phone"`      // 寄件人手机号

miniprogram/express/delivery.go:25

  • No unit tests accompany this new endpoint; consider adding tests that mock util.PostJSONContext and verify correct URL formatting and error handling.
func (express *Express) FollowWaybill(ctx context.Context, in *FollowWaybillRequest) (res FollowWaybillResponse, err error) {

@ccfish86
Copy link
Copy Markdown
Contributor Author

ccfish86 commented Jul 4, 2025

不好意思刚才测试的时候发现查询结果写错了一点,已提交
image

@houseme
Copy link
Copy Markdown
Collaborator

houseme commented Jul 4, 2025

建议在描述添加一下相关的官方文档地址,谢谢

@silenceper silenceper merged commit 86ef690 into silenceper:v2 Jul 5, 2025
13 checks passed
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.

4 participants