1
0
mirror of https://github.com/silenceper/wechat.git synced 2026-03-01 00:35:26 +08:00

群发消息接口 (#259)

* 添加TODO:待完善接口

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

* 【群发消息】基本框架

* 群发消息-基本方法

* fix golint

* fix:SendWxCard log
This commit is contained in:
silenceper
2020-05-29 23:17:04 +08:00
committed by GitHub
parent 880ab20a6b
commit 5e8e16444c
10 changed files with 363 additions and 17 deletions
+8 -1
View File
@@ -5,6 +5,7 @@ import (
"github.com/silenceper/wechat/v2/credential"
"github.com/silenceper/wechat/v2/officialaccount/basic"
"github.com/silenceper/wechat/v2/officialaccount/broadcast"
"github.com/silenceper/wechat/v2/officialaccount/config"
"github.com/silenceper/wechat/v2/officialaccount/context"
"github.com/silenceper/wechat/v2/officialaccount/device"
@@ -52,7 +53,7 @@ func (officialAccount *OfficialAccount) GetMenu() *menu.Menu {
return menu.NewMenu(officialAccount.ctx)
}
// GetServer 消息管理
// GetServer 消息管理:接收事件,被动回复消息管理
func (officialAccount *OfficialAccount) GetServer(req *http.Request, writer http.ResponseWriter) *server.Server {
srv := server.NewServer(officialAccount.ctx)
srv.Request = req
@@ -94,3 +95,9 @@ func (officialAccount *OfficialAccount) GetTemplate() *message.Template {
func (officialAccount *OfficialAccount) GetDevice() *device.Device {
return device.NewDevice(officialAccount.ctx)
}
//GetBroadcast 群发消息
//TODO 待完善
func (officialAccount *OfficialAccount) GetBroadcast() *broadcast.Broadcast {
return broadcast.NewBroadcast(officialAccount.ctx)
}