 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
  
    Index ¶
- Constants
- type CommonToken
- type CustomerMessage
- func NewCustomerImgMessage(toUser, mediaID string) *CustomerMessage
- func NewCustomerLinkMessage(toUser, title, description, url, thumbURL string) *CustomerMessage
- func NewCustomerMiniprogrampageMessage(toUser, title, pagepath, thumbMediaID string) *CustomerMessage
- func NewCustomerTextMessage(toUser, text string) *CustomerMessage
 
- type EventType
- type InfoType
- type Manager
- type MediaLink
- type MediaMiniprogrampage
- type MediaResource
- type MediaText
- type MiniProgramMixMessage
- type MsgType
Constants ¶
      View Source
      
  
const ( //MsgTypeText 文本消息 MsgTypeText MsgType = "text" //MsgTypeImage 图片消息 MsgTypeImage = "image" //MsgTypeLink 图文链接 MsgTypeLink = "link" //MsgTypeMiniProgramPage 小程序卡片 MsgTypeMiniProgramPage = "miniprogrampage" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommonToken ¶
type CommonToken struct {
	XMLName      xml.Name `xml:"xml"`
	ToUserName   string   `xml:"ToUserName"`
	FromUserName string   `xml:"FromUserName"`
	CreateTime   int64    `xml:"CreateTime"`
	MsgType      MsgType  `xml:"MsgType"`
}
    CommonToken 消息中通用的结构
type CustomerMessage ¶
type CustomerMessage struct {
	ToUser          string                `json:"touser"`                    //接受者OpenID
	Msgtype         MsgType               `json:"msgtype"`                   //客服消息类型
	Text            *MediaText            `json:"text,omitempty"`            //可选
	Image           *MediaResource        `json:"image,omitempty"`           //可选
	Link            *MediaLink            `json:"link,omitempty"`            //可选
	Miniprogrampage *MediaMiniprogrampage `json:"miniprogrampage,omitempty"` //可选
}
    CustomerMessage 客服消息
func NewCustomerImgMessage ¶
func NewCustomerImgMessage(toUser, mediaID string) *CustomerMessage
NewCustomerImgMessage 图片消息的构造方法
func NewCustomerLinkMessage ¶
func NewCustomerLinkMessage(toUser, title, description, url, thumbURL string) *CustomerMessage
NewCustomerLinkMessage 图文链接消息的构造方法
func NewCustomerMiniprogrampageMessage ¶
func NewCustomerMiniprogrampageMessage(toUser, title, pagepath, thumbMediaID string) *CustomerMessage
NewCustomerMiniprogrampageMessage 小程序卡片消息的构造方法
func NewCustomerTextMessage ¶
func NewCustomerTextMessage(toUser, text string) *CustomerMessage
NewCustomerTextMessage 文本消息结构体构造方法
type Manager ¶
Manager 消息管理者,可以发送消息
func NewCustomerMessageManager ¶
NewCustomerMessageManager 实例化消息管理者
type MediaLink ¶
type MediaLink struct {
	Title       string `json:"title"`
	Description string `json:"description"`
	URL         string `json:"url"`
	ThumbURL    string `json:"thumb_url"`
}
    MediaLink 发送图文链接
type MediaMiniprogrampage ¶
type MediaMiniprogrampage struct {
	Title        string `json:"title"`
	Appid        string `json:"appid"`
	Pagepath     string `json:"pagepath"`
	ThumbMediaID string `json:"thumb_media_id"`
}
    MediaMiniprogrampage 小程序卡片
type MediaResource ¶
type MediaResource struct {
	MediaID string `json:"media_id"`
}
    MediaResource 消息使用的临时素材id
type MiniProgramMixMessage ¶
type MiniProgramMixMessage struct {
	CommonToken
	MsgID int64 `xml:"MsgId"`
	// 文本消息
	Content string `xml:"Content"`
	// 图片消息
	PicURL  string `xml:"PicUrl"`
	MediaID string `xml:"MediaId"`
	// 小程序卡片消息
	Title        string `xml:"Title"`
	AppID        string `xml:"AppId"`
	PagePath     string `xml:"PagePath"`
	ThumbURL     string `xml:"ThumbUrl"`
	ThumbMediaID string `xml:"ThumbMediaId"`
	// 进入会话事件
	Event       string `xml:"Event"`
	SessionFrom string `xml:"SessionFrom"`
}
    MiniProgramMixMessage 小程序回调的消息结构
 Click to show internal directories. 
   Click to hide internal directories.