wechat

module
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2022 License: MIT

README

Go Wechat

Go Doc Production Ready License

Installation

go get -u -v github.com/strugglerx/wechat/v2

suggested using go.mod:

require github.com/strugglerx/wechat/v2 latest

Usage


appid := "xx"
secret := "xx"

//sample
app := miniapp.App{Appid:  appid, Secret: secret,}

//verify 
app := New(&App{ Appid:  appid, Secret: secret, Verify: true,})

//hook
var cacheToken utils.Token
app := &miniapp.App{
    Appid:  appid,
    Secret: secret,
    Read: func(appid string) *utils.Token {return &cacheToken},
    Write: func(appid, accessToken string) *utils.Token {
            cacheToken.Token = accessToken
            cacheToken.UpdateTime = int(time.Now().Unix())
            return &cacheToken
        },
    }
	
//custom 
app.Custom.PostBody("/wxa/business/getuserphonenumber", []byte(`{
        "code":"03c52dedef3306d529d53bb31452ec9a2f46880b2040cec9d760876e821f9429"
    }`),true)

//To Do

License

Go Wechat is licensed under the MIT License, 100% free and open-source, forever.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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