sdk

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2022 License: MulanPSL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountParam

type AccountParam struct {
	//binding:"required"修饰的字段,若接收为空值,则报错,是必须字段
	Signature string   `form:"signature" xml:"signature" binding:"required"` //微信加密签名
	Timestamp string   `form:"timestamp" xml:"timestamp" binding:"required"` //时间戳
	Nonce     string   `form:"nonce" xml:"nonce" binding:"required"`         //随机数
	Echostr   string   `form:"echostr"`                                      //随机字符串
	XmlBody   *xmlBody //xml消息内容体
	// contains filtered or unexported fields
}

定义接收数据的结构体

func AccountInit

func AccountInit(token, appid, secret string) (*AccountParam, string)

初始化

func (*AccountParam) GetParam

func (p *AccountParam) GetParam(body []byte) (*AccountParam, string)

获取参数及请求内容

func (*AccountParam) TransmitImage

func (p *AccountParam) TransmitImage(content string) string

回复图片消息

func (*AccountParam) TransmitMusic

func (p *AccountParam) TransmitMusic(content map[string]string) string

回复音乐消息

func (*AccountParam) TransmitNews

func (p *AccountParam) TransmitNews(content []map[string]string, count int) string

回复图文消息,目前微信只支持一组图文

func (*AccountParam) TransmitText

func (p *AccountParam) TransmitText(content string) string

回复文本消息

func (*AccountParam) TransmitVideo

func (p *AccountParam) TransmitVideo(content map[string]string) string

回复视频消息

func (*AccountParam) TransmitVoice

func (p *AccountParam) TransmitVoice(content string) string

回复语音消息

Jump to

Keyboard shortcuts

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