pubacc

package
v0.0.0-...-849f898 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InteractEntry

func InteractEntry(wxcfg *wechat.WxConfig, req *MsgRequestData, handler MsgHandler) (interface{}, error)

InteractEntry the entry of user and public account server interactive with each other

return reply message

Types

type MsgHandler

type MsgHandler func(*message.MixMessage) (*message.Reply, error)

type MsgRequestData

type MsgRequestData struct {
	OpenID    string `json:"openid"`
	Nonce     string `json:"nonce"`
	Signature string `json:"signature"`
	Timestamp string `json:"timestamp"`
	// echostr 随机字符串, 用于校验开发者接入是否成功
	//     若确认此次GET请求来自微信服务器,请原样返回echostr参数内容,则接入生效,否则接入失败
	EchoStr      string `json:"echostr"`
	EchoStrExist bool   `json:"echostr_exist"`
	// encrypt_type == aes
	SafeMode bool
	Random   []byte
	// input message data
	InputMixMsg *message.MixMessage
}

MsgRequestData struct of request

func ParseRequestFromGin

func ParseRequestFromGin(c *gin.Context, wxcfg *wechat.WxConfig, needCheckSign bool) (*MsgRequestData, error)

ParseRequestFromGin parse message from gin's request

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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