feat: 添加 微信物流服务 /微信物流服务(商家查看) /消息组件#842
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
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
GetExpressmethod onMiniProgram - Introduces the
expresspackage 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
expressshadows the package name and can be confusing; consider renaming it toeorsrvfor 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
URLsuffix), consider renaming this toopenMsgGetDeliveryListURL.
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
SenderPhonedoesn’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.PostJSONContextand verify correct URL formatting and error handling.
func (express *Express) FollowWaybill(ctx context.Context, in *FollowWaybillRequest) (res FollowWaybillResponse, err error) {
houseme
approved these changes
Jul 4, 2025
Contributor
Author
Collaborator
|
建议在描述添加一下相关的官方文档地址,谢谢 |
houseme
approved these changes
Jul 4, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

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