wx

package
v1.2.8 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// access_token 地址
	AccessTokenUrl = "https://api.weixin.qq.com/cgi-bin/token"
	//获取无限制小程序二维码
	CreateUqrcodeUrl = "https://api.weixin.qq.com/wxa/getwxacodeunlimit"
	TemplatedSendUrl = "https://api.weixin.qq.com/cgi-bin/message/wxopen/template/send"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type GetUnLimitQRCodeRequest

type GetUnLimitQRCodeRequest struct {
	Scene     string `json:"scene"`
	Page      string `json:"page"`
	AutoColor bool   `json:"auto_color"`
	IsHyaline bool   `json:"is_hyaline"`
	Width     int64  `json:"width"`
}

type SendRequest

type SendRequest struct {
	Openid          string `json:"touser"`
	TemplateId      string `json:"template_id"`
	Page            string `json:"page"`
	FormId          string `json:"form_id"`
	Data            string `json:"data"`
	EmphasisKeyword string `json:"emphasis_keyword"`
}

type Wx

type Wx struct {
	// contains filtered or unexported fields
}

func NewWx

func NewWx(appId, secret, grantType string, getRedis func() *redis.Client) *Wx

@desc 初始化 @auth liuguoqiang 2020-02-25 @param @return

func (*Wx) GetUnLimitQRCode

func (s *Wx) GetUnLimitQRCode(params *GetUnLimitQRCodeRequest, isFresh bool) ([]byte, error)

@desc 获取二维码 @auth liuguoqiang 2020-02-25 @param @return

func (*Wx) InitAuthToken

func (s *Wx) InitAuthToken(isFresh bool) (string, error)

@desc 根据access_token值进行授权 @auth liuguoqiang 2020-02-25 @param $isFresh 是否刷新access_token @return

func (*Wx) Request

func (s *Wx) Request(params interface{}, url string, isFresh bool) ([]byte, error)

func (*Wx) Send

func (s *Wx) Send(params *SendRequest, isFresh bool) ([]byte, error)

@desc 微信小程序模板消息推送 @auth liuguoqiang 2020-02-25 @param $openid 接收者(用户)的 openid @param $template_id 所需下发的模板消息的id @param $page 点击模板卡片后的跳转页面,仅限本小程序内的页面。支持带参数,(示例index?foo=bar)。该字段不填则模板无跳转。 @param $form_id 表单提交场景下,为 submit 事件带上的 formId;支付场景下,为本次支付的 prepay_id @param $data type:object 模板内容,不填则下发空模板。具体格式请参考示例。 @param $emphasis_keyword 模板需要放大的关键词,不填则默认无放大

Jump to

Keyboard shortcuts

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