1
0
mirror of https://github.com/silenceper/wechat.git synced 2026-02-04 21:02:25 +08:00
Files
wechat/miniprogram/tcb
silenceper c4cb394d80 Feature v2 (#264)
* 添加TODO:待完善接口

* 【模板消息】将message.DataItem改为message.TemplateDataItem

* fix PKG.DEV
2020-05-30 12:16:56 +08:00
..
2020-05-22 14:37:58 +08:00
2020-05-22 14:37:58 +08:00
2020-05-22 14:37:58 +08:00
2020-05-30 12:16:56 +08:00
2020-05-22 14:37:58 +08:00

小程序-云开发 SDK

Tencent Cloud Base 文档

使用说明

初始化配置

//使用memcache保存access_token也可选择redis或自定义cache
memCache=cache.NewMemcache("127.0.0.1:11211")

//配置小程序参数
config := &wechat.Config{
    AppID:     "your app id",
    AppSecret: "your app secret",
    Cache:     memCache,
}
wc := wechat.NewWechat(config)
wcTcb := wc.GetTcb()

举例

触发云函数

res, err := wcTcb.InvokeCloudFunction("test-xxxx", "add", `{"a":1,"b":2}`)
if err != nil {
    panic(err)
}

更多使用方法参考PKG.DEV