-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat: 微信小程序-动态消息及订阅消息 #835
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: v2
Are you sure you want to change the base?
Conversation
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
This PR introduces new API endpoints and methods to support WeChat mini program subscription and dynamic messaging functionalities.
- Adds new endpoints for message templates, categories, notify status, and related response types in subscribe.go.
- Updates dynamic message creation to include unionid and openid parameters and adds a new API for updating chat tool messages in updatable_msg.go.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
miniprogram/subscribe/subscribe.go | Added endpoints and functions for category, template keywords/title, and service card notifications. |
miniprogram/message/updatable_msg.go | Updated createActivityID to include unionid/openid parameters and added support for chat tool dynamic messages. |
miniprogram/subscribe/subscribe.go
Outdated
// getPubTemplateKeyWordsByIDURL 获取关键词列表 | ||
getPubTemplateKeyWordsByIDURL = "https://api.weixin.qq.com/wxaapi/newtmpl/getpubtemplatekeywords?access_token=%s&tid=%s" | ||
// getPubTemplateTitleListURL 获取所属类目下的公共模板 | ||
getPubTemplateTitleListURL = "https://api.weixin.qq.com/wxaapi/newtmpl/getpubtemplatekeywords?access_token=%s&ids=%s&start=%d&limit=%d" |
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.
The URL for getPubTemplateTitleList appears to be identical to getPubTemplateKeyWordsByIDURL. Please verify the endpoint URL to ensure it matches the intended API for fetching public template titles.
getPubTemplateTitleListURL = "https://api.weixin.qq.com/wxaapi/newtmpl/getpubtemplatekeywords?access_token=%s&ids=%s&start=%d&limit=%d" | |
getPubTemplateTitleListURL = "https://api.weixin.qq.com/wxaapi/newtmpl/getpubtemplatetitles?access_token=%s&ids=%s&start=%d&limit=%d" |
Copilot uses AI. Check for mistakes.
func (updatableMessage *UpdatableMessage) CreateActivityID() (CreateActivityIDResponse, error) { | ||
return updatableMessage.CreateActivityIDWithReq(&CreateActivityIDRequest{}) |
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.
CreateActivityID now calls CreateActivityIDWithReq with an empty request, but the updated URL requires unionid and openid parameters. Ensure that the necessary values are provided to avoid potential API errors.
func (updatableMessage *UpdatableMessage) CreateActivityID() (CreateActivityIDResponse, error) { | |
return updatableMessage.CreateActivityIDWithReq(&CreateActivityIDRequest{}) | |
func (updatableMessage *UpdatableMessage) CreateActivityID(unionid, openid string) (CreateActivityIDResponse, error) { | |
return updatableMessage.CreateActivityIDWithReq(&CreateActivityIDRequest{ | |
UnionID: unionid, | |
OpenID: openid, | |
}) |
Copilot uses AI. Check for mistakes.
No description provided.