-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
补充 添加/删除 公众号模板消息接口 #440
补充 添加/删除 公众号模板消息接口 #440
Conversation
officialaccount/message/template.go
Outdated
ShortID string `json:"template_id_short"` | ||
}{ShortID: shortID} | ||
uri := fmt.Sprintf("%s?access_token=%s", templateAddURL, accessToken) | ||
response, err := util.PostJSON(uri, msg) |
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.
这个err被重新定义了,已经不是返回值中的err了。
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.
fixed
officialaccount/message/template.go
Outdated
}{TemplateID: templateID} | ||
|
||
uri := fmt.Sprintf("%s?access_token=%s", templateDelURL, accessToken) | ||
response, err := util.PostJSON(uri, msg) |
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.
同上
officialaccount/message/template.go
Outdated
var result util.CommonError | ||
return util.DecodeWithError(response, &result, "DeleteTemplate") |
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.
这里可以直接使用DecodeWithCommonError
哈,其他没什么问题了
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.
学到了
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.
fixed
文档地址:https://developers.weixin.qq.com/doc/offiaccount/Message_Management/Template_Message_Interface.html#2