公众号

开发前必读:微信公众官方文档

获取微信公众号操作对象

wc := wechat.NewWechat()
//设置全局cache,也可以单独为每个操作实例设置
redisOpts := &cache.RedisOpts{
    Host:       "127.0.0.1:6379",
}
redisCache := cache.NewRedis(redisOpts)
wc.SetCache(redisCache)
cfg := &offConfig.Config{
    AppID:     "xxx",
    AppSecret: "xxx",
    Token:     "xxx",
    //EncodingAESKey: "xxxx",
    //Cache: redisCache, //也可以单独设置
}
officialAccount := wc.GetOfficialAccount(cfg)
//TODO 使用 `officialAccount` 操作公众号相关接口
Copyright © Wechat SDK For Go 2020 all right reserved,powered by Gitbook该文件修订时间: 2020-05-24 21:56:37

results matching ""

    No results matching ""