Skip to content

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

Open
wants to merge 3 commits into
base: v2
Choose a base branch
from

Conversation

markwang1992
Copy link
Contributor

No description provided.

@silenceper silenceper requested a review from Copilot May 7, 2025 06:38
Copy link
Contributor

@Copilot 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 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.

// 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"
Copy link
Preview

Copilot AI May 7, 2025

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.

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

Comment on lines +50 to +51
func (updatableMessage *UpdatableMessage) CreateActivityID() (CreateActivityIDResponse, error) {
return updatableMessage.CreateActivityIDWithReq(&CreateActivityIDRequest{})
Copy link
Preview

Copilot AI May 7, 2025

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.

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

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.

1 participant