offiaccount

package
v0.0.0-...-0269c40 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 25, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MessageTypeText       = "text"
	MessageTypeImage      = "image"
	MessageTypeVoice      = "voice"
	MessageTypeVideo      = "video"
	MessageTypeShortVideo = "shortvideo"
	MessageTypeLocation   = "location"
	MessageTypeLink       = "link"
)

Variables

This section is empty.

Functions

func EchoStr

func EchoStr(next http.HandlerFunc) func(http.ResponseWriter, *http.Request)

Types

type Article

type Article struct {
	Title       Title       `xml:"Title"`
	Description Description `xml:"Description"`
	PicURL      PicURL      `xml:"PicUrl"`
	URL         URL         `xml:"Url"`
}

https://developers.weixin.qq.com/doc/offiaccount/Message_Management/Passive_user_reply_message.html

type ArticleRespMessage

type ArticleRespMessage struct {
	RespMessageBase
	ArticleCount int       `xml:"ArticleCount"`
	Articles     []Article `xml:"Articles>item"`
}

https://developers.weixin.qq.com/doc/offiaccount/Message_Management/Passive_user_reply_message.html

type Description

type Description struct {
	Text    string   `xml:",cdata"`
	XMLName xml.Name `xml:"Description"`
}

type Format

type Format struct {
	Text    string   `xml:",cdata"`
	XMLName xml.Name `xml:"Format"`
}

type FromUserName

type FromUserName struct {
	Text    string   `xml:",cdata"`
	XMLName xml.Name `xml:"FromUserName"`
}

type HQMusicURL

type HQMusicURL struct {
	Text    string   `xml:",cdata"`
	XMLName xml.Name `xml:"HQMusicUrl"`
}

type Label

type Label struct {
	Text    string   `xml:",cdata"`
	XMLName xml.Name `xml:"Label"`
}
type Link struct {
	ReqMessageBase
	URL         URL         `xml:"Url"`
	Title       Title       `xml:"Title"`
	Description Description `xml:"Description"`
}

https://developers.weixin.qq.com/doc/offiaccount/Message_Management/Receiving_standard_messages.html

type LocationReqMessage

type LocationReqMessage struct {
	ReqMessageBase
	Label     Label   `xml:"Label"`
	Scale     int     `xml:"Scale"`
	LocationX float64 `xml:"Location_X"`
	LocationY float64 `xml:"Location_Y"`
}

https://developers.weixin.qq.com/doc/offiaccount/Message_Management/Receiving_standard_messages.html

type MediaID

type MediaID struct {
	Text    string   `xml:",cdata"`
	XMLName xml.Name `xml:"MediaId"`
}

type MessageContent

type MessageContent struct {
	Text    string   `xml:",cdata"`
	XMLName xml.Name `xml:"Content"`
}

type MessageHandlerFunc

type MessageHandlerFunc func(context.Context, []byte) (interface{}, error)

type MessageMux

type MessageMux struct {
	Unimplemented MessageHandlerFunc
	// contains filtered or unexported fields
}

func NewMessageMux

func NewMessageMux() *MessageMux

func (*MessageMux) HandlerFunc

func (mux *MessageMux) HandlerFunc(typ string, f MessageHandlerFunc)

func (*MessageMux) StdHandlerFunc

func (mux *MessageMux) StdHandlerFunc() http.HandlerFunc

type MessageType

type MessageType struct {
	Text    string   `xml:",cdata"`
	XMLName xml.Name `xml:"MsgType"`
}

type Music

type Music struct {
	Title        Title        `xml:"Title"`
	Description  Description  `xml:"Description"`
	MusicURL     MusicURL     `xml:"MusicUrL"`
	HQMusicURL   HQMusicURL   `xml:"HQMusicUrL"`
	ThumbMediaID ThumbMediaID `xml:"ThumbMediaId"`
}

https://developers.weixin.qq.com/doc/offiaccount/Message_Management/Passive_user_reply_message.html

type MusicURL

type MusicURL struct {
	Text    string   `xml:",cdata"`
	XMLName xml.Name `xml:"MusicUrl"`
}

type PicURL

type PicURL struct {
	Text    string   `xml:",cdata"`
	XMLName xml.Name `xml:"PicUrl"`
}

type Recognition

type Recognition struct {
	Text    string   `xml:",cdata"`
	XMLName xml.Name `xml:"Recognition"`
}

type ReqMessageBase

type ReqMessageBase struct {
	XMLName      xml.Name     `xml:"xml"`
	ToUserName   ToUserName   `xml:"ToUserName"`
	FromUserName FromUserName `xml:"FromUserName"`
	CreateTime   int64        `xml:"CreateTime"`
	MessageID    uint64       `xml:"MsgId"`
	MessageType  MessageType  `xml:"MsgType"`
}

https://developers.weixin.qq.com/doc/offiaccount/Message_Management/Receiving_standard_messages.html

func GetBaseMessage

func GetBaseMessage(ctx context.Context) *ReqMessageBase

type RespMessageBase

type RespMessageBase struct {
	XMLName      xml.Name     `xml:"xml"`
	ToUserName   ToUserName   `xml:"ToUserName"`
	FromUserName FromUserName `xml:"FromUserName"`
	CreateTime   int64        `xml:"CreateTime"`
	MessageType  MessageType  `xml:"MsgType"`
}

https://developers.weixin.qq.com/doc/offiaccount/Message_Management/Passive_user_reply_message.html

type ThumbMediaID

type ThumbMediaID struct {
	Text    string   `xml:",cdata"`
	XMLName xml.Name `xml:"ThumbMediaId"`
}

type Title

type Title struct {
	Text    string   `xml:",cdata"`
	XMLName xml.Name `xml:"Title"`
}

type ToUserName

type ToUserName struct {
	Text    string   `xml:",cdata"`
	XMLName xml.Name `xml:"ToUserName"`
}

type URL

type URL struct {
	Text    string   `xml:",cdata"`
	XMLName xml.Name `xml:"Url"`
}

type Video

type Video struct {
	Title       Title       `xml:"Title"`
	MediaID     MediaID     `xml:"MediaId"`
	Description Description `xml:"Description"`
}

https://developers.weixin.qq.com/doc/offiaccount/Message_Management/Passive_user_reply_message.html

type VideoReqMessage

type VideoReqMessage struct {
	ReqMessageBase
	Format       Format       `xml:"Format"`
	MediaID      MediaID      `xml:"MediaId"`
	ThumbMediaID ThumbMediaID `xml:"ThumbMediaId"`
}

https://developers.weixin.qq.com/doc/offiaccount/Message_Management/Receiving_standard_messages.html

type VoiceReqMessage

type VoiceReqMessage struct {
	ReqMessageBase
	Format      Format      `xml:"Format"`
	MediaID     MediaID     `xml:"MediaId"`
	Recognition Recognition `xml:"Recognition"`
}

https://developers.weixin.qq.com/doc/offiaccount/Message_Management/Receiving_standard_messages.html

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL