Documentation
¶
Overview ¶
Package customerservice 微信小程序客服.
目前支持:CheckSignature()验证消息是否来自微信服务器,SendMessage()发送客服消息给用户,UploadTempMedia()把媒体文件上传到微信服务器
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckSignature ¶
CheckSignature 验证消息是否来自微信服务器
Types ¶
type MessageImg ¶
type MessageImg struct {
MediaID string `json:"media_id,omitempty"`
}
MessageImg 图片消息
type MessageLink ¶
type MessageLink struct {
// 图文链接消息
Description string `json:"description,omitempty"`
// 图文链接消息的图片链接
ThumbURL string `json:"thumb_url,omitempty"`
// 消息标题
Title string `json:"title,omitempty"`
// 图文链接消息被点击后跳转的链接
URL string `json:"url,omitempty"`
}
MessageLink 图文链接
type MessageMiniProgramPage ¶
type MessageMiniProgramPage struct {
// 消息标题
Title string `json:"title,omitempty"`
// 小程序的页面路径
Pagepath string `json:"pagepath,omitempty"`
// 小程序消息卡片的封面(media_id)
ThumbMediaID string `json:"thumb_media_id,omitempty"`
}
MessageMiniProgramPage 小程序卡片
type MessageText ¶
type MessageText struct {
Content string `json:"content,omitempty"`
}
MessageText 文本消息
type SendMessageReq ¶
type SendMessageReq struct {
AccessToken string `json:"access_token,omitempty"`
Image MessageImg `json:"image,omitempty"`
// 图文链接
Link MessageLink `json:"link,omitempty"`
// 小程序卡片
Miniprogrampage MessageMiniProgramPage `json:"miniprogrampage,omitempty"`
// 消息类型:text,image,link,miniprogrampage
Msgtype string `json:"msgtype,omitempty"`
// 文本消息
Text MessageText `json:"text,omitempty"`
// 用户的 OpenID
Touser string `json:"touser,omitempty"`
}
SendMessageReq 发送客服消息请求参数
type SendMessageResp ¶
type SendMessageResp struct {
// contains filtered or unexported fields
}
SendMessageResp 发送客服消息响应参数
type UploadTempMediaReq ¶
type UploadTempMediaReq struct {
AccessToken string `json:"access_token,omitempty"`
// 图片内容
Image []byte `json:"image,omitempty"`
}
UploadTempMediaReq 文件上传请求参数.
type UploadTempMediaResp ¶
type UploadTempMediaResp struct {
// 媒体文件上传时间戳
CreatedAt int64 `json:"created_at,omitempty"`
// 媒体文件上传后,获取标识,3天内有效
MediaID string `json:"media_id,omitempty"`
// 文件类型
Type string `json:"type,omitempty"`
// contains filtered or unexported fields
}
UploadTempMediaResp 文件上传响应参数
func UploadTempMedia ¶
func UploadTempMedia(req UploadTempMediaReq) (utmr UploadTempMediaResp, err error)
UploadTempMedia 把媒体文件上传到微信服务器
Click to show internal directories.
Click to hide internal directories.