wx

package
v1.4.5 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2020 License: Apache-2.0 Imports: 11 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"
	//授权$code 访问地址
	CodeAccessUrl    = "https://api.weixin.qq.com/sns/jscode2session"
	TemplatedSendUrl = "https://api.weixin.qq.com/cgi-bin/message/wxopen/template/send"
)

Variables

This section is empty.

Functions

func AesDecrypt added in v1.3.8

func AesDecrypt(crytedByte []byte, key []byte, iv []byte) []byte

func AesEncrypt added in v1.3.8

func AesEncrypt(origData []byte, k []byte, iv []byte) string

func DecryptData added in v1.3.8

func DecryptData(req *DecryptDataRequest) (interface{}, error)

@desc 检验数据的真实性,并且获取解密后的明文. @auth liuguoqiang 2020-04-08 @param @return

func PKCS7Padding added in v1.3.8

func PKCS7Padding(ciphertext []byte, blocksize int) []byte

补码 AES加密数据块分组长度必须为128bit(byte[16]),密钥长度可以是128bit(byte[16])、192bit(byte[24])、256bit(byte[32])中的任意一个。

func PKCS7UnPadding added in v1.3.8

func PKCS7UnPadding(origData []byte) []byte

去码

Types

type CheckLoginResponse added in v1.3.8

type CheckLoginResponse struct {
	OpenId     string `json:"openId"`
	SessionKey string `json:"session_key"`
}

type DecryptDataRequest added in v1.3.8

type DecryptDataRequest struct {
	SessionKey string
	Iv         string
	Data       string
}

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 added in v1.3.6

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 added in v1.2.9

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

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

func (*Wx) CheckLogin added in v1.3.8

func (s *Wx) CheckLogin(code string) (*CheckLoginResponse, error)

@desc 根据微信code获取授权信息 @auth liuguoqiang 2020-04-08 @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 added in v1.3.6

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

func (*Wx) Send added in v1.3.6

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