mirror of
https://github.com/silenceper/wechat.git
synced 2026-02-09 23:22:27 +08:00
improve comment ,参考:https://github.com/huacnlee/autocorrect
This commit is contained in:
@@ -26,7 +26,7 @@ func NewMessageManager(context *context.Context) *Manager {
|
||||
|
||||
// CustomerMessage 客服消息
|
||||
type CustomerMessage struct {
|
||||
ToUser string `json:"touser"` // 接受者OpenID
|
||||
ToUser string `json:"touser"` // 接受者 OpenID
|
||||
Msgtype MsgType `json:"msgtype"` // 客服消息类型
|
||||
Text *MediaText `json:"text,omitempty"` // 可选
|
||||
Image *MediaResource `json:"image,omitempty"` // 可选
|
||||
@@ -93,12 +93,12 @@ type MediaText struct {
|
||||
Content string `json:"content"`
|
||||
}
|
||||
|
||||
// MediaResource 消息使用的永久素材id
|
||||
// MediaResource 消息使用的永久素材 id
|
||||
type MediaResource struct {
|
||||
MediaID string `json:"media_id"`
|
||||
}
|
||||
|
||||
// MediaArticle 消息使用的已发布文章id
|
||||
// MediaArticle 消息使用的已发布文章 id
|
||||
type MediaArticle struct {
|
||||
ArticleID string `json:"article_id"`
|
||||
}
|
||||
@@ -146,7 +146,7 @@ type MsgmenuItem struct {
|
||||
Content string `json:"content"`
|
||||
}
|
||||
|
||||
// MediaWxcard 卡券的id
|
||||
// MediaWxcard 卡券的 id
|
||||
type MediaWxcard struct {
|
||||
CardID string `json:"card_id"`
|
||||
}
|
||||
|
||||
@@ -31,14 +31,14 @@ func NewSubscribe(context *context.Context) *Subscribe {
|
||||
|
||||
// SubscribeMessage 发送的订阅消息内容
|
||||
type SubscribeMessage struct {
|
||||
ToUser string `json:"touser"` // 必须, 接受者OpenID
|
||||
TemplateID string `json:"template_id"` // 必须, 模版ID
|
||||
Page string `json:"page,omitempty"` // 可选, 跳转网页时填写
|
||||
Data map[string]*SubscribeDataItem `json:"data"` // 必须, 模板数据
|
||||
ToUser string `json:"touser"` // 必须,接受者 OpenID
|
||||
TemplateID string `json:"template_id"` // 必须,模版 ID
|
||||
Page string `json:"page,omitempty"` // 可选,跳转网页时填写
|
||||
Data map[string]*SubscribeDataItem `json:"data"` // 必须,模板数据
|
||||
MiniProgram struct {
|
||||
AppID string `json:"appid"` // 所需跳转到的小程序appid(该小程序appid必须与发模板消息的公众号是绑定关联关系)
|
||||
PagePath string `json:"pagepath"` // 所需跳转到小程序的具体页面路径,支持带参数,(示例index?foo=bar)
|
||||
} `json:"miniprogram"` // 可选,跳转至小程序地址
|
||||
AppID string `json:"appid"` // 所需跳转到的小程序 appid(该小程序 appid 必须与发模板消息的公众号是绑定关联关系)
|
||||
PagePath string `json:"pagepath"` // 所需跳转到小程序的具体页面路径,支持带参数,(示例 index?foo=bar)
|
||||
} `json:"miniprogram"` // 可选,跳转至小程序地址
|
||||
}
|
||||
|
||||
// SubscribeDataItem 模版内某个 .DATA 的值
|
||||
@@ -143,7 +143,7 @@ func (tpl *Subscribe) Delete(templateID string) (err error) {
|
||||
|
||||
// PublicTemplateCategory 公众号类目
|
||||
type PublicTemplateCategory struct {
|
||||
ID int `json:"id"` // 类目ID
|
||||
ID int `json:"id"` // 类目 ID
|
||||
Name string `json:"name"` // 类目的中文名
|
||||
}
|
||||
|
||||
|
||||
@@ -29,17 +29,17 @@ func NewTemplate(context *context.Context) *Template {
|
||||
|
||||
// TemplateMessage 发送的模板消息内容
|
||||
type TemplateMessage struct {
|
||||
ToUser string `json:"touser"` // 必须, 接受者OpenID
|
||||
TemplateID string `json:"template_id"` // 必须, 模版ID
|
||||
URL string `json:"url,omitempty"` // 可选, 用户点击后跳转的URL, 该URL必须处于开发者在公众平台网站中设置的域中
|
||||
Color string `json:"color,omitempty"` // 可选, 整个消息的颜色, 可以不设置
|
||||
Data map[string]*TemplateDataItem `json:"data"` // 必须, 模板数据
|
||||
ClientMsgID string `json:"client_msg_id,omitempty"` // 可选, 防重入ID
|
||||
ToUser string `json:"touser"` // 必须,接受者 OpenID
|
||||
TemplateID string `json:"template_id"` // 必须,模版 ID
|
||||
URL string `json:"url,omitempty"` // 可选,用户点击后跳转的 URL, 该 URL 必须处于开发者在公众平台网站中设置的域中
|
||||
Color string `json:"color,omitempty"` // 可选,整个消息的颜色,可以不设置
|
||||
Data map[string]*TemplateDataItem `json:"data"` // 必须,模板数据
|
||||
ClientMsgID string `json:"client_msg_id,omitempty"` // 可选,防重入 ID
|
||||
|
||||
MiniProgram struct {
|
||||
AppID string `json:"appid"` // 所需跳转到的小程序appid(该小程序appid必须与发模板消息的公众号是绑定关联关系)
|
||||
PagePath string `json:"pagepath"` // 所需跳转到小程序的具体页面路径,支持带参数,(示例index?foo=bar)
|
||||
} `json:"miniprogram"` // 可选,跳转至小程序地址
|
||||
AppID string `json:"appid"` // 所需跳转到的小程序 appid(该小程序 appid 必须与发模板消息的公众号是绑定关联关系)
|
||||
PagePath string `json:"pagepath"` // 所需跳转到小程序的具体页面路径,支持带参数,(示例 index?foo=bar)
|
||||
} `json:"miniprogram"` // 可选,跳转至小程序地址
|
||||
}
|
||||
|
||||
// TemplateDataItem 模版内某个 .DATA 的值
|
||||
@@ -80,7 +80,7 @@ func (tpl *Template) Send(msg *TemplateMessage) (msgID int64, err error) {
|
||||
return
|
||||
}
|
||||
|
||||
// TemplateItem 模板消息.
|
||||
// TemplateItem 模板消息。
|
||||
type TemplateItem struct {
|
||||
TemplateID string `json:"template_id"`
|
||||
Title string `json:"title"`
|
||||
@@ -121,7 +121,7 @@ type resTemplateAdd struct {
|
||||
TemplateID string `json:"template_id"`
|
||||
}
|
||||
|
||||
// Add 添加模板.
|
||||
// Add 添加模板。
|
||||
func (tpl *Template) Add(shortID string, keyNameList []string) (templateID string, err error) {
|
||||
var accessToken string
|
||||
accessToken, err = tpl.GetAccessToken()
|
||||
@@ -144,7 +144,7 @@ func (tpl *Template) Add(shortID string, keyNameList []string) (templateID strin
|
||||
return result.TemplateID, err
|
||||
}
|
||||
|
||||
// Delete 删除私有模板.
|
||||
// Delete 删除私有模板。
|
||||
func (tpl *Template) Delete(templateID string) (err error) {
|
||||
var accessToken string
|
||||
accessToken, err = tpl.GetAccessToken()
|
||||
|
||||
Reference in New Issue
Block a user