1
0
mirror of https://github.com/silenceper/wechat.git synced 2026-02-11 16:22:26 +08:00

增加小程序-云开发http api

This commit is contained in:
silenceper
2019-11-26 13:09:36 +08:00
parent 7ea817a7c6
commit 96678d2279
12 changed files with 831 additions and 9 deletions

32
tcb/README.md Normal file
View File

@@ -0,0 +1,32 @@
# 小程序-云开发 SDK
Tencent Cloud Base [文档](https://developers.weixin.qq.com/miniprogram/dev/wxcloud/reference-http-api/)
## 使用说明
**初始化配置**
```golang
//使用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()
```
### 举例
#### 触发云函数
```golang
res, err := wcTcb.UploadFile("test-6ku2s", "golang.png")
if err != nil {
panic(err)
}
```
更多使用方法参考[GODOC](https://godoc.org/github.com/silenceper/wechat/tcb)