1
0
mirror of https://github.com/silenceper/wechat.git synced 2026-02-10 15:52:26 +08:00

企业微信内部开发API:消息推送与接收,以及回调处理

This commit is contained in:
hb
2021-11-24 14:18:10 +08:00
parent 73adb7dcdd
commit 7ae8e08a3e
10 changed files with 445 additions and 117 deletions

View File

@@ -0,0 +1,30 @@
package message
//UpdateButton 模板卡片按钮
type UpdateButton struct {
CommonToken `json:"-"`
Button struct {
ReplaceName string `xml:"ReplaceName" json:"replace_name"`
} `xml:"Button" json:"button"`
}
//NewUpdateButton 更新点击用户的按钮文案
func NewUpdateButton(replaceName string) *UpdateButton {
btn := new(UpdateButton)
btn.Button.ReplaceName = replaceName
return btn
}
//TemplateCard 被动回复模板卡片
//https://open.work.weixin.qq.com/api/doc/90000/90135/90241
type TemplateCard struct {
CommonToken `json:"-"`
TemplateCard interface{} `xml:"TemplateCard" json:"template_card"`
}
// NewTemplateCard 更新点击用户的整张卡片
func NewTemplateCard(cardXml interface{}) *TemplateCard {
card := new(TemplateCard)
card.TemplateCard = cardXml
return card
}