Golang 开发的微信 SDK go-wechat-sdk

码农软件 · 软件分类 · 微信/微信小程序 · 2019-03-14 07:11:24

软件介绍

WeChat SDK for Go

使用Golang开发的微信SDK,简单、易用。

快速开始

以下是一个处理消息接收以及回复的例子:

//配置微信参数
config := &wechat.Config{
    AppID:          "xxxx",
    AppSecret:      "xxxx",
    Token:          "xxxx",
    EncodingAESKey: "xxxx",
    Cache:          memCache
}
wc := wechat.NewWechat(config)

// 传入request和responseWriter
server := wc.GetServer(request, responseWriter)
server.SetMessageHandler(func(msg message.MixMessage) *message.Reply {

    //回复消息:演示回复用户发送的消息
    text := message.NewText(msg.Content)
    return &message.Reply{message.MsgText, text}
})

server.Serve()
server.Send()

和主流框架配合使用

主要是request和responseWriter在不同框架中获取方式可能不一样:

目前实现的API:

  • 消息管理

    • 回复文本消息

    • 回复图片消息

    • 回复视频消息

    • 回复音乐消息

    • 回复图文消息

    • 接收普通消息

    • 接收事件推送

    • 被动回复消息

  • 自定义菜单

    • 添加个性化菜单

    • 删除个性化菜单

    • 测试个性化菜单匹配结果

    • 自定义菜单创建接口

    • 自定义菜单查询接口

    • 自定义菜单删除接口

    • 自定义菜单事件推送

    • 个性化菜单接口

    • 获取公众号菜单配置

  • 微信网页开发

    • 发起授权

    • 通过code换取access_token

    • 拉取用户信息

    • 刷新access_token

    • 检验access_token是否有效

    • Oauth2 授权

    • 获取js-sdk配置

  • 素材管理

本文地址:https://www.codercto.com/soft/d/1303.html

The Java Language Specification, Java SE 7 Edition

The Java Language Specification, Java SE 7 Edition

James Gosling、Bill Joy、Guy L. Steele Jr.、Gilad Bracha、Alex Buckley / Addison-Wesley Professional / 2013-2-24 / USD 59.99

Written by the inventors of the technology, The Java(r) Language Specification, Java SE 7 Edition, is the definitive technical reference for the Java programming language. The book provides complete, ......一起来看看 《The Java Language Specification, Java SE 7 Edition》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

URL 编码/解码
URL 编码/解码

URL 编码/解码

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具