request

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2021 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateQrCode

type CreateQrCode struct {
	// 扫码进入的小程序页面路径,最大长度 128 字节,不能为空;
	// 对于小游戏,可以只传入 query 部分,来实现传参效果,
	// 如:传入 "?foo=bar",即可在 wx.getLaunchOptionsSync 接口中的 query 参数获取到 {foo:"bar"}。
	Path string `json:"path"`
	// 二维码的宽度,单位 px。最小 280px,最大 1280px
	Width int `json:"width"`
}

获取小程序二维码请求参数

type Image

type Image struct {
	// 发送的图片的媒体ID,通过 新增素材接口 上传图片文件获得。
	MediaId string `json:"media_id"`
}

image 的结构

type Link struct {
	// 消息标题
	Title string `json:"title"`
	// 图文链接消息
	Description string `json:"description"`
	// 图文链接消息被点击后跳转的链接
	Url string `json:"url"`
	// 图文链接消息的图片链接,支持 JPG、PNG 格式,
	// 较好的效果为大图 640 X 320,小图 80 X 80
	ThumbUrl string `json:"thumb_url"`
}

link 的结构

type MiniProgramPage

type MiniProgramPage struct {
	// 消息标题
	Title string `json:"title"`
	// 小程序的页面路径,跟app.json对齐,支持参数,
	// 比如pages/index/index?foo=bar
	PagePath string `json:"pagepath"`
	// 小程序消息卡片的封面, image 类型的 media_id,
	// 通过 新增素材接口 上传图片文件获得,建议大小为 520*416
	ThumbMediaId string `json:"thumb_media_id"`
}

miniprogrampage 的结构

type MpTemplateMsg

type MpTemplateMsg struct {
	// 公众号appid,要求与小程序有绑定且同主体
	Appid string `json:"appid"`
	// 公众号模板id
	TemplateId string `json:"template_id"`
	// 公众号模板消息所要跳转的url
	Url string `json:"url"`
	// 公众号模板消息所要跳转的小程序,小程序的必须与公众号具有绑定关系
	Miniprogram string `json:"miniprogram"`
	// 公众号模板消息的数据
	Data string `json:"data"`
}

mp_template_msg 的结构

type SendKfMessage

type SendKfMessage struct {
	// 用户的 OpenID
	ToUser string `json:"touser"`
	// 消息类型
	MsgType string `json:"msgtype"`
	// 文本消息,msgtype="text" 时必填
	Text Text `json:"text"`
	// 图片消息,msgtype="image" 时必填
	Image Image `json:"image"`
	// 图文链接,msgtype="link" 时必填
	Link Link `json:"link"`
	// 小程序卡片,msgtype="miniprogrampage" 时必填
	MiniProgramPage MiniProgramPage `json:"miniprogrampage"`
}

发送客服消息请求参数

type SetTyping

type SetTyping struct {
	// 用户的 OpenID
	ToUser string `json:"touser"`
	// command 的合法值: Typing,CancelTyping
	Command string `json:"command"`
}

下发客服当前输入状态请求参数

type SubscribeMsg

type SubscribeMsg struct {
	// 接收者(用户)的 openid
	ToUser string `json:"touser"`
	// 所需下发的订阅模板id
	TemplateId string `json:"template_id"`
	// 点击模板卡片后的跳转页面,仅限本小程序内的页面。
	// 支持带参数,(示例index?foo=bar)。该字段不填则模板无跳转。
	Page string `json:"page"`
	// 模板内容,格式形如 { "key1": { "value": any }, "key2": { "value": any } }
	Data interface{} `json:"data"`
	// 跳转小程序类型:developer为开发版;trial为体验版;formal为正式版;默认为正式版
	MiniprogramState string `json:"miniprogram_state"`
	// 进入小程序查看”的语言类型,
	// 支持zh_CN(简体中文)、en_US(英文)、zh_HK(繁体中文)、zh_TW(繁体中文),默认为zh_CN
	Lang string `json:"lang"`
}

订阅消息请求参数

type Text

type Text struct {
	// 文本消息内容
	Content string `json:"content"`
}

text 的结构

type UniformMessage

type UniformMessage struct {
	// 用户openid,可以是小程序的openid,
	// 也可以是mp_template_msg.appid对应的公众号的openid
	ToUser string `json:"touser"`
	// 小程序模板消息相关的信息,可以参考小程序模板消息接口;
	// 有此节点则优先发送小程序模板消息
	WeappTemplateMsg *WeappTemplateMsg `json:"weapp_template_msg"`
	//公众号模板消息相关的信息,可以参考公众号模板消息接口;
	//有此节点并且没有weapp_template_msg节点时,发送公众号模板消息
	MpTemplateMsg *MpTemplateMsg `json:"mp_template_msg"`
}

统一服务消息请求参数

type WeappTemplateMsg

type WeappTemplateMsg struct {
	// 小程序模板ID
	TemplateId string `json:"template_id"`
	// 小程序页面路径
	Page string `json:"page"`
	// 小程序模板消息formid
	FormId string `json:"form_id"`
	// 小程序模板数据
	Data string `json:"data"`
	// 小程序模板放大关键词
	EmphasisKeyword string `json:"emphasis_keyword"`
}

weapp_template_msg 的结构

Jump to

Keyboard shortcuts

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